/* ── ALPE Dashboard — Frontend Styles ── */
*, *::before, *::after { box-sizing: border-box; }

.alpedash-wrap {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #2d2d2d;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ── Login ── */
.alpedash-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 24px;
}

.alpedash-login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}

.alpedash-login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.alpedash-login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 6px;
    color: #1a1a1a;
}

.alpedash-login-sub {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin: 0 0 24px;
}

.alpedash-login-form { display: flex; flex-direction: column; gap: 16px; }

.alpedash-field { display: flex; flex-direction: column; gap: 6px; }

.alpedash-field label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.alpedash-field input[type="text"],
.alpedash-field input[type="email"],
.alpedash-pw-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    transition: border-color .15s;
    /* suppress browser password reveal icon */
    -webkit-appearance: none;
    appearance: none;
}

/* Hide MS Edge/IE built-in reveal button */
.alpedash-pw-input::-ms-reveal,
.alpedash-pw-input::-ms-clear { display: none !important; }

/* Hide Chrome built-in reveal button */
.alpedash-pw-input::-webkit-contacts-auto-fill-button,
.alpedash-pw-input::-webkit-credentials-auto-fill-button { display: none !important; }

.alpedash-field input:focus,
.alpedash-pw-input:focus {
    outline: none;
    border-color: #F79420;
    box-shadow: 0 0 0 3px rgba(247,148,32,.12);
}

/* Password wrapper */
.alpedash-pw-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.alpedash-pw-wrap .alpedash-pw-input {
    padding-right: 44px; /* space for toggle */
}

.alpedash-pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: #F79420 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 8px 8px 0;
    opacity: 1 !important;
    pointer-events: all !important;
    transition: background .15s;
}

.alpedash-pw-toggle svg,
.alpedash-pw-toggle svg * { stroke: #F79420 !important; }

.alpedash-pw-toggle:hover,
.alpedash-pw-toggle:focus,
.alpedash-pw-toggle:active {
    background: #F79420 !important;
    background-color: #F79420 !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    outline: none !important;
}
.alpedash-pw-toggle:hover svg,
.alpedash-pw-toggle:focus svg,
.alpedash-pw-toggle:active svg,
.alpedash-pw-toggle:hover svg *,
.alpedash-pw-toggle:focus svg *,
.alpedash-pw-toggle:active svg * { stroke: #fff !important; }

.alpedash-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.alpedash-btn-primary {
    background: #F79420 !important;
    color: #fff !important;
    border: 2px solid #F79420 !important;
    border-radius: 8px !important;
    padding: 13px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: background .15s, border-color .15s;
    margin-top: 4px;
}

.alpedash-btn-primary:hover,
.alpedash-btn-primary:focus,
.alpedash-btn-primary:active {
    background: #e07a10 !important;
    border-color: #e07a10 !important;
    color: #fff !important;
}

/* ── Alerts ── */
.alpedash-alert {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.alpedash-alert-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #c0392b;
}

/* ── Dashboard ── */
.alpedash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.alpedash-header-left { display: flex; align-items: center; gap: 14px; }
.alpedash-header-logo { flex-shrink: 0; }

.alpedash-header-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.alpedash-header-sub { font-size: 13px; color: #999; }

.alpedash-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.alpedash-user-name { font-size: 14px; color: #666; }

.alpedash-logout-btn {
    font-size: 13px;
    color: #F79420;
    text-decoration: none;
    border: 1px solid #F79420;
    border-radius: 6px;
    padding: 5px 14px;
    transition: all .15s;
}

.alpedash-logout-btn:hover { background: #F79420; color: #fff; }

.alpedash-section-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #aaa;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.alpedash-section-orange {
    font-size: 15px !important;
    color: #F79420 !important;
    letter-spacing: .1em;
}

/* ── Micro-learning table ───────────────────────────── */
.alpedash-ml-wrap {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    border: 1px solid #ebebeb;
    background: #fff;
    margin-bottom: 8px;
    position: relative;
}

/* Keep delivery table using old wrap class */
.alpedash-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    border: 1px solid #ebebeb;
    background: #fff;
    margin-bottom: 8px;
}

.alpedash-ml-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.alpedash-ml-month-col {
    min-width: 90px;
    width: 90px;
    text-align: center !important;
}

.alpedash-ml-sticky-first {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    min-width: 160px;
    border-right: 2px solid #f0f0f0;
}

.alpedash-ml-sticky-last {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 2;
    min-width: 110px;
    border-left: 2px solid #f0f0f0;
    text-align: center !important;
}

.alpedash-ml-table thead th {
    background: #F79420;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 10px 8px;
    text-align: center;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.alpedash-ml-table thead th.alpedash-ml-sticky-first {
    left: 0; z-index: 3; background: #F79420; text-align: left; padding: 10px 14px;
}

.alpedash-ml-table thead th.alpedash-ml-sticky-last {
    right: 0; z-index: 3; background: #F79420;
}

.alpedash-ml-current-month { background: #e07a10 !important; }

.alpedash-ml-table thead th:first-child { border-radius: 11px 0 0 0; }
.alpedash-ml-table thead th:last-child  { border-radius: 0 11px 0 0; }

.alpedash-ml-table tbody tr { border-bottom: 1px solid #f0f0f0; transition: background .1s; }
.alpedash-ml-table tbody tr:last-child { border-bottom: none; }
.alpedash-ml-table tbody tr:hover { background: #fffaf4; }
.alpedash-ml-table tbody tr:hover .alpedash-ml-sticky-first,
.alpedash-ml-table tbody tr:hover .alpedash-ml-sticky-last { background: #fffaf4; }

.alpedash-ml-product {
    padding: 11px 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    text-align: left;
}

.alpedash-ml-count {
    padding: 11px 8px;
    text-align: center;
    color: #555;
    font-variant-numeric: tabular-nums;
}

.alpedash-ml-product-total { font-weight: 700; color: #F79420 !important; }

.alpedash-ml-totals td { font-weight: 700; background: #f9f9f9; border-top: 2px solid #F79420; color: #1a1a1a; }
.alpedash-ml-totals .alpedash-ml-sticky-first,
.alpedash-ml-totals .alpedash-ml-sticky-last { background: #f9f9f9; }
.alpedash-ml-totals .alpedash-ml-product { color: #F79420; }

.alpedash-ml-running td { background: #fff8f0; border-top: 1px solid #f0e0c8; }
.alpedash-ml-running .alpedash-ml-sticky-first,
.alpedash-ml-running .alpedash-ml-sticky-last { background: #fff8f0; }
.alpedash-ml-running .alpedash-ml-product { color: #e07a10; }

.alpedash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.alpedash-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: box-shadow .15s;
}

.alpedash-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.alpedash-card-wide { grid-column: span 2; }

.alpedash-card-alert {
    border-color: #f5c6cb;
    background: #fdecea;
}

.alpedash-card-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f7f7f7;
}

.alpedash-card-body { flex: 1; min-width: 0; }

.alpedash-card-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.alpedash-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 4px;
}

.alpedash-card-sub { font-size: 12px; color: #aaa; }
.alpedash-muted { color: #bbb; font-size: 18px !important; }

/* Breakdown table inside hampers card */
.alpedash-breakdown { margin-top: 12px; }

.alpedash-breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.alpedash-breakdown-count {
    font-weight: 700;
    color: #F79420;
}

.alpedash-footer {
    margin-top: 40px;
    font-size: 12px;
    color: #bbb;
    text-align: center;
}

@media (max-width: 600px) {
    .alpedash-card-wide { grid-column: span 1; }
    .alpedash-card-value { font-size: 26px; }
    .alpedash-header-right { flex-direction: column; align-items: flex-end; gap: 8px; }
}

/* ── Uploaded card images ───────────────────────────── */
.alpedash-card-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* ── Delivery section ───────────────────────────────── */
.alpedash-delivery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
    padding: 12px 0 4px;
}
.alpedash-delivery-count {
    font-size: 13px;
    color: #888;
}
.alpedash-delivery-email-btn {
    background: #F79420 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap;
}
.alpedash-delivery-email-btn:hover { background: #e07a10 !important; }
.alpedash-delivery-email-msg { font-size: 12px; }
.alpedash-empty { color: #aaa; font-size: 14px; padding: 20px 0; }
.alpedash-delivery-table td { padding: 10px 14px; vertical-align: top; }
.alpedash-row-fulfilled { opacity: .55; }
.alpedash-row-fulfilled td { text-decoration: none; }

/* Toggle switch */
.alpedash-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}
.alpedash-toggle input { opacity: 0; width: 0; height: 0; }
.alpedash-toggle-slider {
    position: absolute;
    inset: 0;
    background: #ddd;
    border-radius: 22px;
    transition: background .2s;
}
.alpedash-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.alpedash-toggle input:checked + .alpedash-toggle-slider { background: #F79420; }
.alpedash-toggle input:checked + .alpedash-toggle-slider::before { transform: translateX(18px); }

/* ── Fulfilled filter pills ─────────────────────────── */
.alpedash-filter-pills {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 6px;
    flex-wrap: wrap;
}
.alpedash-filter-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid #F79420;
    color: #F79420;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.alpedash-filter-pill:hover { background: #fff4e6; }
.alpedash-filter-pill.active { background: #F79420; border-color: #F79420; color: #fff; }

/* ── Micro-learnings totals row ─────────────────────── */
.alpedash-ml-totals td {
    font-weight: 700;
    background: #f9f9f9;
    border-top: 2px solid #F79420;
    color: #1a1a1a;
}
.alpedash-ml-totals .alpedash-ml-product { color: #F79420; }

/* ── Order number input ─────────────────────────────── */
.alpedash-order-input:focus {
    outline: none;
    border-color: #F79420 !important;
    box-shadow: 0 0 0 2px rgba(247,148,32,.12);
}
