/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL — REDESIGNED
   ═══════════════════════════════════════════════════════════ */

/* ─── RESET & BASE ──────────────────────────────────────────── */
.admin-body {
    margin: 0;
    background: #F0F2F7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1D3557;
}

/* ─── APP SHELL ─────────────────────────────────────────────── */
.admin-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── SIDEBAR ───────────────────────────────────────────────── */
.adm-sidebar {
    width: 248px;
    flex-shrink: 0;
    background: #1D3557;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.adm-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.adm-sidebar-logo-img {
    width: 100%;
    max-width: 180px;
    background: #fff;
    padding: 9px 14px;
    border-radius: 12px;
    display: block;
}

.adm-logo-icon { font-size: 2rem; }
.adm-logo-name { font-size: 1.05rem; font-weight: 900; color: #fff; letter-spacing: -0.3px; }
.adm-logo-sub  { font-size: 0.72rem; color: rgba(255,255,255,0.45); font-weight: 500; margin-top: 1px; }

/* Nav */
.adm-nav { padding: 16px 12px; flex: 1; }

.adm-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.35);
    padding: 4px 8px 8px;
    text-transform: uppercase;
}

.adm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    font-family: inherit;
}

.adm-nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

.adm-nav-item.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-weight: 700;
}

.adm-nav-icon  { font-size: 1rem; flex-shrink: 0; }
.adm-nav-text  { flex: 1; }

.adm-nav-count {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    border-radius: 50px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

.adm-nav-count.urgent {
    background: #E63946;
    color: #fff;
    animation: urgentPulse 2s ease infinite;
}

@keyframes urgentPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* Status color accents in sidebar */
.adm-nav-item.nav-new.active     { background: rgba(230,57,70,0.25); }
.adm-nav-item.nav-preparing.active{ background: rgba(230,101,0,0.2); }
.adm-nav-item.nav-ready.active   { background: rgba(21,101,192,0.2); }
.adm-nav-item.nav-delivered.active{ background: rgba(45,106,79,0.2); }

.adm-sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.adm-back-link {
    display: block;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.adm-back-link:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.07); }

/* ─── MAIN ──────────────────────────────────────────────────── */
.adm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ─── TOP BAR ───────────────────────────────────────────────── */
.adm-topbar {
    background: #fff;
    border-bottom: 1px solid #E8EAF0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    z-index: 10;
}

.adm-topbar-left { display: flex; align-items: center; gap: 14px; }

.adm-topbar-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1D3557;
    margin: 0;
}

.adm-live-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(45,106,79,0.1);
    color: #2D6A4F;
    border-radius: 50px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.adm-live-dot {
    width: 7px;
    height: 7px;
    background: #40916C;
    border-radius: 50%;
    animation: liveDot 2s ease infinite;
}

@keyframes liveDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.6; }
}

.adm-topbar-right { display: flex; align-items: center; gap: 10px; }

.adm-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.adm-search-icon {
    position: absolute;
    left: 10px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.adm-search-input {
    border: 1.5px solid #E0E3EC;
    border-radius: 10px;
    padding: 8px 14px 8px 32px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 220px;
    color: #1D3557;
    background: #F5F6FA;
    transition: all 0.2s;
}

.adm-search-input:focus {
    outline: none;
    border-color: #E63946;
    background: #fff;
    width: 260px;
}

.adm-sort-select {
    border: 1.5px solid #E0E3EC;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1D3557;
    background: #F5F6FA;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.adm-sort-select:focus { outline: none; border-color: #E63946; }

.adm-refresh-btn {
    background: #F5F6FA;
    border: 1.5px solid #E0E3EC;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.adm-refresh-btn:hover { background: #E0E3EC; transform: rotate(30deg); }

/* ─── WORKSPACE ─────────────────────────────────────────────── */
.adm-workspace {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── STATS ROW ─────────────────────────────────────────────── */
.adm-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.adm-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 130px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: all 0.2s;
}

.adm-stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.adm-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.adm-stat-val {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1D3557;
    line-height: 1;
}

.adm-stat-lbl {
    font-size: 0.72rem;
    color: #9AA5B4;
    font-weight: 500;
    margin-top: 3px;
}

/* ─── ORDERS VIEW LAYOUT ────────────────────────────────────── */
.adm-orders-view {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
    align-items: start;
}

/* ─── ORDERS COLUMN (LEFT) ──────────────────────────────────── */
.adm-orders-col {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.adm-orders-head {
    padding: 12px 16px;
    border-bottom: 1px solid #F0F2F7;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.adm-orders-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #9AA5B4;
}

.adm-orders-list {
    overflow-y: auto;
    flex: 1;
}

/* ─── ORDER CARD ─────────────────────────────────────────────── */
.adm-order-card {
    border-left: 4px solid transparent;
    border-bottom: 1px solid #F5F6FA;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.adm-order-card:hover { background: #FAFBFF; }
.adm-order-card.selected { background: #FAFBFF; }

/* Status border colors */
.adm-order-card[data-status="new"]       { border-left-color: #E63946; }
.adm-order-card[data-status="preparing"] { border-left-color: #E65100; }
.adm-order-card[data-status="ready"]     { border-left-color: #1565C0; }
.adm-order-card[data-status="delivered"] { border-left-color: #2D6A4F; }

/* New order pulse */
.adm-order-card[data-status="new"].new-pulse {
    animation: newPulse 1.2s ease;
}
@keyframes newPulse {
    0%   { background: rgba(230,57,70,0.12); }
    100% { background: transparent; }
}

.oc-body {
    padding: 12px 14px 10px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.oc-info { flex: 1; min-width: 0; }

.oc-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.oc-name {
    font-size: 0.93rem;
    font-weight: 700;
    color: #1D3557;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oc-meta {
    font-size: 0.74rem;
    color: #9AA5B4;
    margin-bottom: 3px;
    display: flex;
    gap: 8px;
}

.oc-phone {
    font-size: 0.78rem;
    color: #5A6A7A;
    margin-bottom: 4px;
}

.oc-items-preview {
    font-size: 0.76rem;
    color: #9AA5B4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oc-right { text-align: right; flex-shrink: 0; }

.oc-total {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1D3557;
    margin-bottom: 5px;
}

/* ─── ACTION BUTTON (per card) ──────────────────────────────── */
.oc-action-btn {
    width: 100%;
    padding: 11px 16px;
    border: none;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.18s ease;
    font-family: inherit;
    letter-spacing: 0.1px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.oc-action-btn:hover { filter: brightness(0.92); }
.oc-action-btn:active { transform: scale(0.99); }

/* Confirm (new → preparing) — GREEN */
.oc-action-btn.btn-confirm {
    background: #2D6A4F;
    color: #fff;
}

/* Ready (preparing → ready) — ORANGE */
.oc-action-btn.btn-ready {
    background: #E65100;
    color: #fff;
}

/* Deliver (ready → delivered) — BLUE */
.oc-action-btn.btn-deliver {
    background: #1565C0;
    color: #fff;
}

/* Done label */
.oc-done-label {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #2D6A4F;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid #F0F2F7;
    background: rgba(45,106,79,0.04);
}

/* ─── EMPTY ORDERS ──────────────────────────────────────────── */
.adm-orders-empty {
    padding: 60px 20px;
    text-align: center;
    color: #C0C8D8;
}

.adm-orders-empty-icon { font-size: 2.8rem; margin-bottom: 12px; }
.adm-orders-empty p    { font-size: 0.88rem; line-height: 1.5; }

/* ─── DETAIL COLUMN (RIGHT) ─────────────────────────────────── */
.adm-detail-col {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    overflow: hidden;
    position: sticky;
    top: 0;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

/* Empty state */
.adm-detail-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    text-align: center;
}

.ade-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.35; }
.ade-text { font-size: 1rem; font-weight: 700; color: #9AA5B4; margin-bottom: 8px; }
.ade-sub  { font-size: 0.83rem; color: #C0C8D8; line-height: 1.5; max-width: 220px; }

/* Detail filled state */
.detail-status-banner {
    padding: 20px 22px 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.detail-status-banner[data-status="new"]       { background: linear-gradient(135deg, #E63946, #9B0A14); }
.detail-status-banner[data-status="preparing"] { background: linear-gradient(135deg, #E65100, #8C3400); }
.detail-status-banner[data-status="ready"]     { background: linear-gradient(135deg, #1565C0, #0A3D7A); }
.detail-status-banner[data-status="delivered"] { background: linear-gradient(135deg, #2D6A4F, #1A4D1C); }

.dsb-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dsb-order-id {
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0.8;
}

.dsb-actions { display: flex; gap: 6px; }

.dsb-icon-btn {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.18s;
    color: #fff;
}

.dsb-icon-btn:hover { background: rgba(255,255,255,0.3); }

.dsb-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dsb-name {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

.dsb-phone { font-size: 0.85rem; opacity: 0.85; }

/* Scrollable body */
.detail-scroll-body {
    flex: 1;
    overflow-y: auto;
}

/* Section */
.det-section {
    padding: 16px 20px;
    border-bottom: 1px solid #F5F6FA;
}

.det-section:last-child { border-bottom: none; }

.det-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #9AA5B4;
    margin-bottom: 12px;
}

/* Info rows */
.det-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    font-size: 0.88rem;
    border-bottom: 1px solid #F5F6FA;
}

.det-row:last-child { border-bottom: none; }

.det-row-icon  { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; margin-top: 1px; }
.det-row-label { color: #9AA5B4; min-width: 80px; font-size: 0.82rem; }
.det-row-val   { font-weight: 600; color: #1D3557; flex: 1; }

.det-note-val {
    font-style: italic;
    background: #FFFDE7;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.84rem;
    color: #5A4A00;
    line-height: 1.4;
}

.det-phone-link {
    color: #1D3557;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1.5px dashed #E63946;
}

.det-phone-link:hover { color: #E63946; }

/* Items list */
.det-items-list { list-style: none; }

.det-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #F5F6FA;
    font-size: 0.88rem;
}

.det-item:last-child { border-bottom: none; }
.det-item-emoji { font-size: 1.2rem; }
.det-item-name  { flex: 1; font-weight: 600; color: #1D3557; }
.det-item-qty   { font-size: 0.78rem; color: #9AA5B4; display: block; }
.det-item-price { font-weight: 700; color: #1D3557; font-size: 0.88rem; }

.det-total-row {
    background: #F5F6FA;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.det-total-row span:first-child { font-size: 0.85rem; color: #9AA5B4; font-weight: 600; }
.det-total-row span:last-child  { font-size: 1.25rem; font-weight: 900; color: #1D3557; }

/* ─── PRIMARY ACTION BUTTON (in detail) ─────────────────────── */
.det-primary-action {
    padding: 16px 20px;
    background: #F5F6FA;
    border-top: 1px solid #EAECF3;
}

.det-action-btn {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.det-action-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.det-action-btn:active { transform: scale(0.98); }

.det-btn-confirm { background: #2D6A4F; color: #fff; }
.det-btn-ready   { background: #E65100; color: #fff; }
.det-btn-deliver { background: #1565C0; color: #fff; }

.det-done-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #2D6A4F;
    background: rgba(45,106,79,0.08);
    border-radius: 12px;
}

/* ─── TIMELINE ───────────────────────────────────────────────── */
.det-timeline { display: flex; flex-direction: column; }

.det-tl-item {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 14px;
}

.det-tl-item:last-child { padding-bottom: 0; }

.det-tl-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 26px;
    width: 2px;
    height: calc(100% - 14px);
    background: #E8EAF0;
}

.det-tl-item.tl-done::before { background: #40916C; }
.det-tl-item:last-child::before { display: none; }

.det-tl-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid #E0E3EC;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 1;
    transition: all 0.2s;
}

.det-tl-item.tl-done .det-tl-dot    { border-color: #40916C; background: #40916C; color: #fff; }
.det-tl-item.tl-current .det-tl-dot { border-color: #E63946; background: #E63946; color: #fff; font-size: 0.8rem; }

.det-tl-content { padding-top: 2px; }
.det-tl-label   { font-size: 0.86rem; font-weight: 600; color: #9AA5B4; }
.det-tl-item.tl-done .det-tl-label    { color: #1D3557; }
.det-tl-item.tl-current .det-tl-label { color: #E63946; font-weight: 700; }
.det-tl-time { font-size: 0.75rem; color: #C0C8D8; margin-top: 1px; }
.det-tl-item.tl-done .det-tl-time { color: #9AA5B4; }

/* ─── ADMIN NOTES ────────────────────────────────────────────── */
.det-notes-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.det-notes-area {
    width: 100%;
    border: 1.5px solid #E0E3EC;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    color: #1D3557;
    resize: vertical;
    min-height: 72px;
    background: #F8F9FC;
    transition: all 0.2s;
    line-height: 1.5;
}

.det-notes-area:focus { outline: none; border-color: #1D3557; background: #fff; }

.det-notes-row {
    display: flex;
    gap: 8px;
}

.det-notes-save {
    flex: 1;
    background: #1D3557;
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.det-notes-save:hover { background: #2C4A6B; }

/* ─── SECONDARY BUTTONS ─────────────────────────────────────── */
.det-secondary-row {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #F5F6FA;
}

.det-sec-btn {
    flex: 1;
    background: #F5F6FA;
    border: 1.5px solid #E0E3EC;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: #1D3557;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.det-sec-btn:hover { background: #E8EAF0; }
.det-sec-btn.danger { color: #E63946; }
.det-sec-btn.danger:hover { background: rgba(230,57,70,0.08); border-color: rgba(230,57,70,0.3); }

/* ─── STATS VIEW ─────────────────────────────────────────────── */
.adm-stats-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.adm-stats-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.adm-stats-card-head h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1D3557;
    margin: 0;
}

.adm-danger-btn {
    background: rgba(230,57,70,0.08);
    border: 1.5px solid rgba(230,57,70,0.25);
    color: #E63946;
    border-radius: 9px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.adm-danger-btn:hover { background: rgba(230,57,70,0.15); }

/* Stats detail grid */
.stats-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.stats-col-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.9px; color: #9AA5B4; margin-bottom: 14px;
}
.stats-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid #F5F6FA;
}
.stats-row:last-of-type { border-bottom: none; }
.stats-row-label { font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stats-summary-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stats-mini-card {
    background: #F5F6FA; border-radius: 10px; padding: 14px;
    border: 1.5px solid #E8EAF0;
}
.stats-mini-card.highlight { background: #1D3557; border-color: #1D3557; }
.stats-mini-card.highlight .stats-mini-value { color: #fff; }
.stats-mini-card.highlight .stats-mini-label { color: rgba(255,255,255,0.55); }
.stats-mini-value { font-size: 1.35rem; font-weight: 900; color: #1D3557; line-height: 1.1; }
.stats-mini-label { font-size: 0.72rem; color: #9AA5B4; margin-top: 4px; font-weight: 500; }
.stats-bar-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid #F5F6FA;
}
.stats-bar-row:last-child { border-bottom: none; }
.stats-bar-label { font-size: 0.83rem; font-weight: 600; color: #1D3557; min-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-bar-track { flex: 1; height: 8px; background: #F0F2F7; border-radius: 50px; overflow: hidden; }
.stats-bar-fill  { height: 100%; background: linear-gradient(90deg, #E63946, #F4A261); border-radius: 50px; transition: width 0.6s ease; }
.stats-bar-qty   { font-size: 0.8rem; font-weight: 700; color: #E63946; min-width: 26px; text-align: right; }

/* ─── ТОП КЛИЕНТИ ────────────────────────────────────────────── */
.stats-cust-block { margin-top: 28px; border-top: 1px solid #F0F2F7; padding-top: 20px; }
.stats-cust-list { display: flex; flex-direction: column; gap: 8px; }
.stats-cust-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: #F8F9FC;
    border: 1px solid #ECEEF4;
    border-radius: 11px;
    cursor: pointer;
    text-align: left;
    transition: background .15s, transform .15s;
}
.stats-cust-row:hover { background: #EEF0F6; transform: translateX(2px); }
.stats-cust-rank {
    width: 24px; height: 24px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #1D3557; color: #fff; border-radius: 50%;
    font-size: 0.74rem; font-weight: 700;
}
.stats-cust-row:nth-child(1) .stats-cust-rank { background: #F4A261; }
.stats-cust-row:nth-child(2) .stats-cust-rank { background: #9AA5B4; }
.stats-cust-row:nth-child(3) .stats-cust-rank { background: #C77B43; }
.stats-cust-name { display: flex; flex-direction: column; min-width: 120px; flex: 0 0 auto; }
.stats-cust-name strong { font-size: 0.9rem; color: #1D3557; }
.stats-cust-phone { font-size: 0.76rem; color: #9AA5B4; }
.stats-cust-bar-track { flex: 1; height: 8px; background: #E6E9F0; border-radius: 50px; overflow: hidden; min-width: 40px; }
.stats-cust-bar-fill  { display: block; height: 100%; background: linear-gradient(90deg, #2D6A4F, #52B788); border-radius: 50px; }
.stats-cust-orders { font-size: 0.82rem; font-weight: 700; color: #2D6A4F; min-width: 56px; text-align: right; }
.stats-cust-spent  { font-size: 0.82rem; font-weight: 700; color: #1D3557; min-width: 80px; text-align: right; }

@media (max-width: 700px) {
    .stats-cust-bar-track { display: none; }
    .stats-cust-name { min-width: 0; flex: 1; }
}

/* ─── ГРАФИКОНИ НИЗ ВРЕМЕ ─────────────────────────────────────── */
.stats-charts-block { margin-top: 28px; border-top: 1px solid #F0F2F7; padding-top: 20px; }
.chart-cols {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding-top: 18px;
    overflow-x: auto;
}
.chart-cols.hours { gap: 3px; }
.chart-col {
    flex: 1 1 0;
    min-width: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}
.chart-col-val {
    font-size: 0.62rem;
    font-weight: 700;
    color: #9AA5B4;
    margin-bottom: 3px;
    white-space: nowrap;
}
.chart-col-bar {
    width: 70%;
    max-width: 26px;
    background: linear-gradient(180deg, #E63946, #F4A261);
    border-radius: 5px 5px 0 0;
    transition: height 0.5s ease, filter 0.15s;
    cursor: default;
}
.chart-col:hover .chart-col-bar { filter: brightness(1.1); }
.chart-col-bar.hour { background: linear-gradient(180deg, #1D3557, #457B9D); }
.chart-col-bar.hour.peak { background: linear-gradient(180deg, #2D6A4F, #52B788); }
.chart-col-label {
    font-size: 0.6rem;
    color: #9AA5B4;
    margin-top: 5px;
    white-space: nowrap;
}
.chart-cols.hours .chart-col-label { font-size: 0.56rem; }

/* Status badges (used in detail header) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-new       { background: rgba(230,57,70,0.12); color: #E63946; }
.badge-preparing { background: rgba(230,101,0,0.12); color: #C05000; }
.badge-ready     { background: rgba(21,101,192,0.12); color: #1565C0; }
.badge-delivered { background: rgba(45,106,79,0.12); color: #2D6A4F; }

/* Avatar */
.avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

/* ─── TIME PICKER PANEL ──────────────────────────────────────── */
.time-picker-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1D3557;
    text-align: center;
    padding-bottom: 4px;
}

.tp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.tp-btn {
    background: #F5F6FA;
    border: 2px solid #E0E3EC;
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1D3557;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
    text-align: center;
}

.tp-btn:hover { border-color: #2D6A4F; background: rgba(45,106,79,0.07); }

.tp-btn.selected {
    background: #2D6A4F;
    border-color: #2D6A4F;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(45,106,79,0.3);
}

.tp-custom-row {
    display: flex;
    gap: 8px;
}

.tp-custom-input {
    flex: 1;
    border: 2px solid #E0E3EC;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    color: #1D3557;
    background: #F5F6FA;
    transition: all 0.18s;
    outline: none;
}

.tp-custom-input:focus { border-color: #2D6A4F; background: #fff; }
.tp-custom-input::placeholder { color: #C0C8D8; }

.tp-confirm-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── LOGIN GATE ─────────────────────────────────────────────── */
.adm-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1D3557 0%, #14233D 100%);
}

.adm-login-card {
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    text-align: center;
    animation: loginIn 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}

@keyframes loginIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.adm-login-logo { margin-bottom: 14px; }
.adm-login-logo img { width: 160px; max-width: 70%; height: auto; }
.adm-login-title { font-size: 1.25rem; font-weight: 900; color: #1D3557; margin: 0 0 6px; }
.adm-login-sub { font-size: 0.86rem; color: #9AA5B4; margin: 0 0 24px; }

.adm-login-group { text-align: left; margin-bottom: 16px; }

.adm-login-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1D3557;
    margin-bottom: 6px;
}

.adm-login-input {
    width: 100%;
    border: 1.5px solid #E0E3EC;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1D3557;
    background: #F8F9FC;
    transition: all 0.2s;
}

.adm-login-input:focus {
    outline: none;
    border-color: #E63946;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(230,57,70,0.1);
}

.adm-login-error {
    color: #E63946;
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 18px;
    margin: 0 0 12px;
    text-align: left;
}

.adm-login-btn {
    width: 100%;
    background: #E63946;
    color: #fff;
    border: none;
    border-radius: 11px;
    padding: 13px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.adm-login-btn:hover:not(:disabled) { background: #C1121F; transform: translateY(-1px); }
.adm-login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.adm-login-back {
    display: inline-block;
    margin-top: 16px;
    color: #9AA5B4;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.adm-login-back:hover { color: #1D3557; }

/* User row + logout in sidebar */
.adm-user-row {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    padding: 4px 8px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-logout-btn {
    width: 100%;
    margin-top: 8px;
    background: rgba(230,57,70,0.18);
    color: #FF8A93;
    border: 1px solid rgba(230,57,70,0.3);
    border-radius: 9px;
    padding: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.adm-logout-btn:hover { background: rgba(230,57,70,0.3); color: #fff; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .adm-orders-view { grid-template-columns: 360px 1fr; }
}

@media (max-width: 900px) {
    .adm-orders-view { grid-template-columns: 1fr; }
    .adm-detail-col  { position: static; max-height: none; }
    .adm-stats-row   { flex-wrap: wrap; }
    .stats-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .admin-app { flex-direction: column; height: auto; min-height: 100vh; }

    /* Sidebar → горна лента со хоризонтално скролање */
    .adm-sidebar {
        width: 100%; height: auto; flex-direction: column;
        position: sticky; top: 0; z-index: 60;
    }
    .adm-sidebar-logo { padding: 10px 14px; justify-content: center; }
    .adm-sidebar-logo-img { max-width: 150px; padding: 7px 12px; }

    .adm-nav {
        display: flex; flex-direction: row; flex-wrap: nowrap;
        overflow-x: auto; gap: 6px; padding: 8px 12px;
        -webkit-overflow-scrolling: touch;
    }
    .adm-nav::-webkit-scrollbar { height: 0; }
    .adm-nav-label { display: none; }
    .adm-nav-item {
        width: auto; flex-shrink: 0; white-space: nowrap;
        padding: 8px 12px; margin-bottom: 0;
    }
    .adm-nav-text { flex: none; }

    .adm-sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
    .adm-user-row { flex: 1; padding: 0; }
    .adm-back-link { display: none; }
    .adm-logout-btn { width: auto; margin: 0; padding: 8px 14px; white-space: nowrap; }

    /* Topbar */
    .adm-topbar { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
    .adm-topbar-left { width: 100%; }
    .adm-search-wrap { flex: 1; min-width: 140px; }
    .adm-search-input, .adm-search-input:focus { width: 100%; }
    .adm-workspace { padding: 12px; }

    /* Статистички картички */
    .adm-stats-row { display: grid; grid-template-columns: 1fr 1fr; }

    /* Модали со простор од рабовите */
    .adm-modal-overlay { padding: 12px; }
    .adm-modal { max-height: 92vh; }
}

@media (max-width: 460px) {
    .adm-stats-row { grid-template-columns: 1fr; }
    .stats-summary-cards { grid-template-columns: 1fr 1fr; }
    .adm-pm-row { flex-direction: column; gap: 0; }
}

/* ─── CANCELLED STATUS ───────────────────────────────────────── */
.badge-cancelled { background: rgba(108,117,125,0.14); color: #5A6573; }
.adm-order-card[data-status="cancelled"] { border-left-color: #9AA5B4; opacity: 0.85; }
.detail-status-banner[data-status="cancelled"] { background: linear-gradient(135deg, #6B7280, #374151); }
.adm-nav-item.nav-cancelled.active { background: rgba(108,117,125,0.25); }
.oc-done-label.cancelled { color: #5A6573; background: rgba(108,117,125,0.06); }
.det-cancelled-badge { color: #5A6573 !important; background: rgba(108,117,125,0.1) !important; }

/* ─── STORE OPEN/CLOSED TOGGLE ───────────────────────────────── */
.adm-store-toggle {
    background: rgba(45,106,79,0.1);
    color: #2D6A4F;
    border: 1.5px solid rgba(45,106,79,0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.2s;
}

.adm-store-toggle:hover { filter: brightness(0.95); }

.adm-store-toggle.closed {
    background: rgba(230,57,70,0.1);
    color: #E63946;
    border-color: rgba(230,57,70,0.3);
}

/* ─── MENU MANAGER ───────────────────────────────────────────── */
.adm-add-btn {
    background: #2D6A4F;
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.adm-add-btn:hover { background: #245A41; }

.adm-menu-list { display: flex; flex-direction: column; gap: 8px; }

.adm-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1.5px solid #EAECF3;
    border-radius: 12px;
    background: #fff;
    transition: all 0.15s;
}

.adm-menu-item:hover { border-color: #D5DAE6; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.adm-menu-item.unavailable { opacity: 0.55; background: #F8F9FC; }

.adm-menu-emoji {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F6FA;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
}
.adm-menu-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* ─── ALERT TOGGLES (аларм / авто-печати) ───────────────────── */
.adm-alert-toggle {
    background: #F0F1F5;
    color: #9AA5B4;
    border: 1.5px solid #E0E3EC;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all .15s;
}
.adm-alert-toggle:hover { filter: brightness(0.97); }
.adm-alert-toggle.active {
    background: rgba(230,57,70,0.12);
    color: #E63946;
    border-color: rgba(230,57,70,0.35);
}

/* ─── СЛИКА ВО PRODUCT MODAL ─────────────────────────────────── */
.adm-pm-img-row { display: flex; gap: 14px; align-items: center; }
.adm-pm-img-preview {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    background: #F5F6FA;
    border: 1.5px solid #E0E3EC;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    overflow: hidden;
    flex-shrink: 0;
}
.adm-pm-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.adm-pm-img-actions { display: flex; flex-direction: column; gap: 8px; }

/* ─── ДОДАТОЦИ ВО PRODUCT MODAL ──────────────────────────────── */
.adm-addon-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.adm-addon-row { display: flex; gap: 8px; align-items: center; }
.adm-addon-row .adm-addon-name { flex: 1; }
.adm-addon-row .adm-addon-price { width: 90px; flex-shrink: 0; }
.adm-addon-del {
    width: 34px; height: 38px; flex-shrink: 0;
    border: 1.5px solid #F0C9CE; background: #FDF0F1; color: #E63946;
    border-radius: 9px; cursor: pointer; font-size: 0.85rem;
}
.adm-addon-del:hover { background: #FBE0E2; }
.adm-addon-hint { font-size: 0.76rem; color: #9AA5B4; margin: 6px 0 0; }
.det-item-addons { display: block; font-size: 0.78rem; color: #2D6A4F; margin: 2px 0; }

/* ─── ИСТОРИЈА НА КЛИЕНТ ─────────────────────────────────────── */
.det-cust-summary {
    font-size: 0.9rem;
    color: #1D3557;
    margin-bottom: 10px;
}
.det-cust-history { display: flex; flex-direction: column; gap: 6px; }
.det-cust-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #F8F9FC;
    border: 1px solid #E8EAF0;
    border-radius: 9px;
    font-size: 0.84rem;
    color: #1D3557;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.det-cust-row:hover { background: #EEF0F6; }
.det-cust-row .dch-id   { font-weight: 700; }
.det-cust-row .dch-date { color: #9AA5B4; }
.det-cust-row .dch-total { margin-left: auto; font-weight: 700; }

/* ─── ОЦЕНА ВО ДЕТАЛИ ────────────────────────────────────────── */
.det-rating { display: flex; align-items: center; gap: 10px; }
.det-rating-stars { font-size: 1.3rem; color: #F4A261; letter-spacing: 2px; }
.det-rating-num { font-weight: 700; color: #1D3557; }
.det-rating-fb {
    margin-top: 8px;
    font-style: italic;
    color: #52607A;
    font-size: 0.9rem;
    background: #F8F9FC;
    border-radius: 9px;
    padding: 8px 12px;
}

.adm-menu-info { flex: 1; min-width: 0; }
.adm-menu-name { font-size: 0.95rem; font-weight: 700; color: #1D3557; }
.adm-menu-meta {
    font-size: 0.78rem; color: #9AA5B4; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adm-menu-price { font-size: 1rem; font-weight: 800; color: #1D3557; flex-shrink: 0; }

.adm-menu-actions { display: flex; gap: 6px; flex-shrink: 0; }

.adm-menu-btn {
    width: 34px;
    height: 34px;
    border: 1.5px solid #E0E3EC;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.adm-menu-btn:hover { background: #F0F2F7; }
.adm-menu-btn.danger:hover { background: rgba(230,57,70,0.08); border-color: rgba(230,57,70,0.3); }

/* ─── PRODUCT MODAL ──────────────────────────────────────────── */
.adm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    backdrop-filter: blur(3px);
}

.adm-modal-overlay.active { opacity: 1; pointer-events: all; }

.adm-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.94);
    transition: transform 0.25s;
}

.adm-modal-overlay.active .adm-modal { transform: scale(1); }

.adm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 14px;
    border-bottom: 1px solid #F0F2F7;
}

.adm-modal-head h3 { font-size: 1.1rem; font-weight: 800; color: #1D3557; margin: 0; }
.adm-modal-body { padding: 18px 22px; }
.adm-modal-foot {
    display: flex;
    gap: 10px;
    padding: 14px 22px 20px;
}

.adm-pm-group { margin-bottom: 14px; }
.adm-pm-row { display: flex; gap: 12px; }
.adm-pm-row .adm-pm-group { flex: 1; }

.adm-pm-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1D3557;
    margin-bottom: 6px;
}

.adm-pm-input {
    width: 100%;
    border: 1.5px solid #E0E3EC;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #1D3557;
    background: #F8F9FC;
    transition: all 0.2s;
}

.adm-pm-input:focus { outline: none; border-color: #E63946; background: #fff; }

.adm-pm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1D3557;
    cursor: pointer;
}

.adm-pm-cancel, .adm-pm-save {
    flex: 1;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.2s;
}

.adm-pm-cancel { background: #F0F2F7; color: #1D3557; }
.adm-pm-cancel:hover { background: #E4E8F0; }
.adm-pm-save { background: #2D6A4F; color: #fff; }
.adm-pm-save:hover { background: #245A41; }
