/* ═══════════════════════════════════════════════════════════════
   Frozen Foods Admin Dashboard — Design System
   Modern Static Admin Panel for Firebase Hosting
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    /* Core Palette — Light Mode */
    --bg:       #F7FAFC;
    --bg2:      #EEF6FB;
    --bg3:      #E4ECF3;
    --surface:  #FFFFFF;
    --surf2:    #F1F5F9;
    --border:   #E2E8F0;
    --bord2:    #BDD3E4;
    --accent:   #0E4B8A;
    --acdim:    rgba(14, 75, 138, 0.08);
    --accent2:  #48C2F9;
    --ac2dim:   rgba(72, 194, 249, 0.15);
    --danger:   #EF4444;
    --dngdim:   rgba(239, 68, 68, 0.1);
    --info:     #48C2F9;
    --success:  #10B981;
    --warn:     #B8860B;
    --txt1:     #1E293B;
    --txt2:     #64748B;
    --txt3:     #94A3B8;
    --font:     'Cairo','Segoe UI',sans-serif;
    --r-sm:     6px;
    --r-md:     10px;
    --r-lg:     16px;
    --r-xl:     24px;
    --r-full:   9999px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
    --shadow-md: 0 4px 20px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
    --sidebar-w: 260px;
    --topbar-h:  60px;
    --tr:        .2s ease;
}

/* ─── Reset ─── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
.hidden { display:none!important; }
html { font-size:16px; scroll-behavior:smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--txt1);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color:inherit; text-decoration:none; }
ul { list-style:none; }
img { max-width:100%; display:block; }
button,input,select,textarea { font-family:var(--font); }
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--bord2); border-radius:var(--r-full); }

/* ═══════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--bg);
    position: relative;
}
.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% -10%, rgba(14, 75, 138, .06), transparent);
    pointer-events: none;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: scalein .4s ease;
}
.logo { text-align:center; margin-bottom:36px; }
.logo-icon {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(14, 75, 138, .25);
    transition: transform .3s ease;
}
.logo-icon:hover { transform: scale(1.05) rotate(-5deg); }
.logo h1 { font-size:1.4rem; font-weight:800; }
.logo p { font-size:.85rem; color:var(--txt2); margin-top:4px; }

.form-group { margin-bottom:18px; }
.form-label { display:block; font-size:.8rem; font-weight:600; color:var(--txt2); margin-bottom:7px; }
.input-wrap { position:relative; }
.input-icon { position:absolute; right:14px; top:50%; transform:translateY(-50%); color:var(--txt2); pointer-events:none; font-size:.9rem; }
.form-ctrl {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px 42px 11px 14px;
    color: var(--txt1);
    font-size: .95rem;
    font-family: var(--font);
    outline: none;
    transition: border-color var(--tr), box-shadow var(--tr);
}
.form-ctrl:focus { border-color:var(--accent); box-shadow: 0 0 0 3px rgba(14, 75, 138, .08); }
.pwd-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--txt2);
    font-size: .95rem;
    transition: color .15s;
}
.pwd-toggle:hover { color:var(--accent); }

.alert {
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideup .2s ease;
}
.alert-error { background:rgba(248,81,73,.12); border:1px solid var(--danger); color:var(--danger); }

.btn-submit {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    padding: 13px;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--tr);
    margin-top: 6px;
    position: relative;
}
.btn-submit:hover { background:#0A3A6C; transform:translateY(-1px); box-shadow: 0 4px 12px rgba(14, 75, 138, .2); }
.btn-submit:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.btn-submit.loading { color:transparent!important; }
.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

.security-note {
    text-align: center;
    margin-top: 22px;
    font-size: .78rem;
    color: var(--txt2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.security-note i { color:var(--accent); }

/* ═══════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════ */
.app-layout { display:flex; min-height:100vh; }

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg2);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    overflow-y: auto;
    transition: transform var(--tr);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.sidebar .logo-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.logo-name { font-size:1rem; font-weight:800; color:var(--txt1); }
.logo-sub  { font-size:.7rem; color:var(--txt2); }
.sidebar-nav { padding:12px 10px; flex:1; }
.nav-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--txt3);
    padding: 12px 10px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    cursor: pointer;
    color: var(--txt2);
    font-size: .875rem;
    font-weight: 600;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    transition: all var(--tr);
    margin-bottom: 2px;
}
.nav-item:hover, .nav-item.active {
    background: var(--acdim);
    color: var(--accent);
}
.nav-item i { width:18px; text-align:center; flex-shrink:0; }
.nav-item .badge-count {
    margin-right: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--r-full);
    animation: pulse 2s infinite;
}
.sidebar-footer { padding:16px; border-top:1px solid var(--border); }
.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg3);
    border-radius: var(--r-md);
}
.admin-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    color: var(--bg);
    flex-shrink: 0;
}

/* ─── Main Content ─── */
.main {
    flex: 1;
    margin-right: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    height: var(--topbar-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}
.page-title { font-size:1.1rem; font-weight:800; }
.topbar-actions { display:flex; align-items:center; gap:12px; }
.topbar-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--txt2);
    font-size: 1rem;
    padding: 8px;
    border-radius: var(--r-md);
    transition: all var(--tr);
}
.topbar-btn:hover { background:var(--surf2); color:var(--txt1); }
.content { padding:24px; max-width:1400px; }

/* ─── Real-time indicator ─── */
.realtime-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
    animation: pulse 2s infinite;
}
.realtime-dot.connected { background: var(--success); }
.realtime-dot.disconnected { background: var(--danger); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: var(--r-md);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--tr);
    white-space: nowrap;
    font-family: var(--font);
    position: relative;
}
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary { background:var(--accent); color:#fff; font-weight:700; }
.btn-primary:hover:not(:disabled) { background:#0A3A6C; transform:translateY(-1px); box-shadow: 0 3px 10px rgba(14, 75, 138, .2); }
.btn-secondary { background:var(--surf2); color:var(--txt1); border:1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color:var(--accent); color:var(--accent); }
.btn-danger { background:var(--danger); color:#fff; }
.btn-danger:hover:not(:disabled) { background:#d93f37; }
.btn-ghost { background:transparent; color:var(--txt2); }
.btn-ghost:hover:not(:disabled) { background:var(--surf2); color:var(--txt1); }
.btn-sm { padding:5px 12px; font-size:.8rem; }
.btn-loading { color:transparent!important; }
.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
.btn-primary.btn-loading::after { border-top-color:#fff; }
.btn-danger.btn-loading::after { border-top-color:#fff; }

/* ─── Stats Cards ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform var(--tr), box-shadow var(--tr);
}
.stat-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); }
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.si-green  { background:var(--acdim); color:var(--accent); }
.si-blue   { background:rgba(56,139,253,.12); color:var(--info); }
.si-yellow { background:var(--ac2dim); color:var(--accent2); }
.si-red    { background:var(--dngdim); color:var(--danger); }
.si-purple { background:rgba(139,92,246,.12); color:#8B5CF6; }
.stat-val  { font-size:1.8rem; font-weight:800; line-height:1; }
.stat-lbl  { font-size:.8rem; color:var(--txt2); margin-top:3px; }

/* ─── Panels ─── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 24px;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    gap: 12px;
    flex-wrap: wrap;
}
.panel-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-title i { color:var(--accent); }
.panel-body { padding:20px; }
.panel-body.no-pad { padding:0; }

/* ─── Tables ─── */
.data-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.data-table th {
    background: var(--bg2);
    padding: 11px 14px;
    text-align: right;
    font-weight: 700;
    color: var(--txt2);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:hover td { background:var(--surf2); }
.data-table tr:last-child td { border-bottom:none; }

/* ─── Day Separator ─── */
.day-separator-row td { padding: 0 !important; border-bottom: none !important; background: transparent !important; }
.day-separator-row:hover td { background: transparent !important; }
.day-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 14px 8px;
    position: relative;
}
.day-separator::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: linear-gradient(to left, transparent, var(--border));
}
.day-separator-label {
    font-size: .78rem;
    font-weight: 800;
    color: var(--accent);
    background: var(--acdim);
    padding: 4px 14px;
    border-radius: var(--r-full);
    border: 1px solid rgba(14, 75, 138, .15);
    white-space: nowrap;
    letter-spacing: .3px;
}
.day-separator-count {
    font-size: .72rem;
    font-weight: 700;
    color: var(--txt3);
    background: var(--bg3);
    padding: 3px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* ─── Status Badges ─── */
.sbadge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: .75rem;
    font-weight: 700;
}
.sb-pending,.sb-received  { background:var(--ac2dim); color:var(--accent2); }
.sb-paid,.sb-confirmed    { background:rgba(56,139,253,.14); color:var(--info); }
.sb-out_for_delivery      { background:var(--acdim); color:var(--accent); }
.sb-delivered             { background:rgba(63,185,80,.14); color:var(--success); }
.sb-cancelled             { background:var(--dngdim); color:var(--danger); }

/* ─── Modals ─── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadein .15s ease;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    box-shadow: var(--shadow-lg);
    animation: scalein .2s ease;
    display: flex;
    flex-direction: column;
}
.modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    flex-shrink: 0;
}
.modal-ttl {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-ttl i { color:var(--accent); }
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--txt2);
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    transition: all var(--tr);
}
.modal-close:hover { background:var(--surf2); color:var(--txt1); }
.modal-body { padding:22px; overflow-y:auto; flex:1; -webkit-overflow-scrolling:touch; }

/* ─── Forms (Dashboard) ─── */
.form-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
textarea.form-ctrl { resize:vertical; min-height:80px; }
select.form-ctrl {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238b949e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 16px;
    padding-left: 36px;
}

/* ─── Schedule Grid ─── */
.schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.schedule-row:last-child { border-bottom:none; }
.day-name { width:80px; font-weight:700; font-size:.9rem; flex-shrink:0; }
.schedule-time { display:flex; align-items:center; gap:8px; flex:1; }
.time-input {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 6px 10px;
    color: var(--txt1);
    font-size: .85rem;
    width: 90px;
    outline: none;
}
.time-input:focus { border-color:var(--accent); }

/* Toggle Pills */
.toggle-pill { position:relative; display:inline-block; width:40px; height:22px; flex-shrink:0; }
.toggle-pill input { opacity:0; width:0; height:0; }
.toggle-pill .slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: background var(--tr);
}
.toggle-pill .slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--tr);
}
.toggle-pill input:checked + .slider { background:var(--accent); }
.toggle-pill input:checked + .slider::before { transform:translateX(-18px); }

/* ─── Image Preview ─── */
.img-preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--bg3);
    margin-top: 8px;
}

/* ─── Toast System ─── */
#toast-container {
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    min-width: 260px;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
    animation: slideup .3s ease;
    pointer-events: all;
    transition: all var(--tr);
}
.toast.success { border-right:4px solid var(--success); }
.toast.error   { border-right:4px solid var(--danger); }
.toast.info    { border-right:4px solid var(--info); }
.toast-icon { font-size:1.1rem; flex-shrink:0; }
.toast.success .toast-icon { color:var(--success); }
.toast.error   .toast-icon { color:var(--danger); }
.toast.info    .toast-icon { color:var(--info); }
.toast-body { flex:1; font-size:.85rem; }
.toast-close { background:none; border:none; cursor:pointer; color:var(--txt2); font-size:.95rem; }
.toast.removing { animation: slideout .25s ease forwards; }

/* ─── Loading Skeleton ─── */
.skeleton {
    background: linear-gradient(90deg, var(--bg3) 25%, var(--surf2) 50%, var(--bg3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--r-md);
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-card { height: 80px; }

/* ─── Sidebar Backdrop ─── */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 199;
    display: none;
    animation: fadein .2s ease;
}
.sidebar-backdrop.active { display:block; }

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes spin    { to { transform:rotate(360deg) } }
@keyframes fadein  { from { opacity:0 } to { opacity:1 } }
@keyframes scalein { from { opacity:0; transform:scale(.92) } to { opacity:1; transform:scale(1) } }
@keyframes slideup { from { opacity:0; transform:translateY(16px) } to { opacity:1; transform:translateY(0) } }
@keyframes slideout { from { opacity:1 } to { opacity:0; transform:translateX(-20px) } }
@keyframes pulse   { 0%,100%{opacity:1}50%{opacity:.5} }
@keyframes shimmer { 0%{background-position:200% 0}100%{background-position:-200% 0} }

/* ─── Day Filters ─── */
.date-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.date-filter-bar::-webkit-scrollbar {
    display: none;
}
.date-pill {
    padding: 6px 14px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--txt2);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--tr);
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.date-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}
.date-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(14, 75, 138, 0.15);
}
.date-pill .badge {
    background: var(--surf2);
    color: var(--txt2);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: var(--r-full);
    font-weight: 700;
    line-height: 1;
}
.date-pill.active .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.date-dropdown-btn {
    position: relative;
    display: inline-block;
}
.date-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    text-align: right;
    direction: rtl;
}
.date-dropdown-menu.show {
    display: block;
    animation: fadein .15s ease;
}
.date-dropdown-item {
    padding: 10px 16px;
    font-size: 0.82rem;
    color: var(--txt1);
    cursor: pointer;
    transition: background var(--tr);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.date-dropdown-item:hover {
    background: var(--bg2);
    color: var(--accent);
}
.date-dropdown-item.active {
    background: var(--acdim);
    color: var(--accent);
    font-weight: 700;
}
.date-dropdown-item .badge {
    background: var(--surf2);
    color: var(--txt2);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: var(--r-full);
    font-weight: 700;
}
.date-dropdown-item.active .badge {
    background: var(--accent);
    color: #fff;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media(max-width: 1024px) {
    :root { --sidebar-w: 240px; }
}

@media(max-width: 768px) {
    :root { --topbar-h: 56px; --sidebar-w: 220px; }
    .sidebar { transform: translateX(100%); box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: -10px 0 30px rgba(0,0,0,0.2); }

    .main { margin-right: 0; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { width: 40px; height: 40px; font-size: 1rem; }
    .stat-val { font-size: 1.4rem; }
    .stat-lbl { font-size: 0.75rem; }
    .form-grid-2 { grid-template-columns: 1fr; gap: 0; }

    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr:not(.day-separator-row), .data-table td { display: block; width: 100%; }
    .day-separator-row { display: table-row; }
    .day-separator-row td { display: table-cell !important; width: 100% !important; }
    .day-separator { padding: 14px 10px 6px; }
    .data-table tr {
        background: var(--surface);
        margin-bottom: 12px;
        border-radius: var(--r-md);
        border: 1px solid var(--border);
        padding: 10px;
    }
    .data-table td {
        text-align: right;
        padding: 8px 10px;
        border-bottom: 1px dashed var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .data-table td:last-child { border-bottom: none; justify-content: flex-end; }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--txt2);
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .overlay { padding: 0; }
    .modal { border-radius: 0; max-height: 100dvh; height: 100dvh; width: 100%; border: none; }
    .modal-hdr { border-radius: 0; padding: 16px 20px; position: sticky; top: 0; z-index: 10; }
    .modal-ttl { font-size: 1.1rem; }
    .modal-close { font-size: 1.4rem; padding: 8px 12px; }
    .modal-body { padding: 20px 16px 40px; }

    .btn { height: 46px; font-size: 0.95rem; }
    .btn-sm { height: 40px; font-size: 0.85rem; }

    .panel-header { padding: 14px 16px; flex-direction: column; align-items: stretch; gap: 12px; }
    .panel-header > div { flex-direction: column; align-items: stretch!important; gap: 10px; }
    .panel-title { font-size: 0.95rem; }
    #filter-search, #filter-status, #product-search { width: 100%!important; max-width: none!important; margin-bottom: 0; }
    #add-product-btn { width: 100%; padding: 10px; font-size: 0.9rem; }
}

@media(max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar-actions #store-status-indicator { display: none; }
    .page-title { font-size: 1rem; }
    #toast-container { left: 16px; right: 16px; bottom: 16px; width: auto; }
    .toast { min-width: 0; max-width: none; }
}
