/* ================================================================
   LUNCHBOT ADMIN — Premium Custom Styles
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ================================================================
   ROOT & TYPOGRAPHY
   ================================================================ */

body, #content, .colMS {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ================================================================
   DATE / TIME PICKER FIXES
   ================================================================ */

.calendarbox, .clockbox {
    z-index: 9999 !important;
}

#calendarbox0, #calendarbox1, #calendarbox2,
#clockbox0, #clockbox1, #clockbox2 {
    z-index: 9999 !important;
    position: fixed !important;
}

.backdrop-blur-sm, .backdrop-blur, .backdrop-blur-md, .backdrop-blur-lg {
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
}

.module.clockbox, .module.calendarbox {
    background: var(--body-bg) !important;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
}

/* ================================================================
   STATUS BADGES — Order Status
   ================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-draft {
    background: rgba(156, 163, 175, 0.15);
    color: #6b7280;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.badge-confirmed {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-canceled {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-published {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-unpublished {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-delivered {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Dark mode badge adjustments */
.dark .badge-confirmed,
[data-theme="dark"] .badge-confirmed { color: #34d399; }
.dark .badge-canceled,
[data-theme="dark"] .badge-canceled { color: #f87171; }
.dark .badge-draft,
[data-theme="dark"] .badge-draft { color: #9ca3af; }
.dark .badge-published,
[data-theme="dark"] .badge-published { color: #34d399; }
.dark .badge-unpublished,
[data-theme="dark"] .badge-unpublished { color: #fbbf24; }

/* ================================================================
   ACTION BUTTONS — Publish/Import buttons in list
   ================================================================ */

.btn-publish {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white !important;
    border: none;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.4);
}
.btn-publish:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.5);
    transform: translateY(-1px);
}

.btn-import-csv {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
    background: rgba(107, 114, 128, 0.12);
    color: var(--body-fg) !important;
    border: 1px solid rgba(107, 114, 128, 0.25);
}
.btn-import-csv:hover {
    background: rgba(107, 114, 128, 0.2);
    transform: translateY(-1px);
}

/* ================================================================

/* =========================================
   LIST TABLE IMPROVEMENTS
   ================================================================ */

#changelist .results {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

#changelist .results table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
}

#changelist .results table td,
#changelist .results table th {
    padding: 13px 14px;
    height: 52px;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 13.5px;
}

#changelist .results table th {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* Row hover highlight */
#changelist .results table tbody tr {
    transition: background 0.12s ease;
}

#changelist .results table tbody tr:hover td {
    background: rgba(124, 58, 237, 0.04) !important;
}

/* ================================================================
   INLINE ADMIN FORMS
   ================================================================ */

.inline-group .tabular td,
.inline-group .tabular th {
    padding: 10px 12px;
    font-size: 13px;
}

/* ================================================================
   MOBILE OPTIMIZATION
   ================================================================ */

.results, .module, .model-group-module {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    #changelist .results table td,
    #changelist .results table th {
        padding: 10px 8px;
        font-size: 12px;
        white-space: normal;
    }

    .object-tools a {
        margin-bottom: 6px;
        display: block;
        text-align: center;
    }
}

/* ================================================================
   REPORT / EXPORT BUTTON
   ================================================================ */

.export-report-btn {
    margin-left: 10px;
}

@media (max-width: 768px) {
    .export-report-btn {
        margin-left: 0 !important;
        margin-top: 8px;
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* ================================================================
   CALENDAR ICON — Dark mode fix
   ================================================================ */

@media (prefers-color-scheme: dark) {
    input[type="date"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
    }
}

.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ================================================================
   DASHBOARD CARDS (for dashboard.html)
   ================================================================ */

.lb-stat-card {
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--hairline-color, rgba(0,0,0,0.08));
    background: var(--body-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.lb-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.lb-stat-card.purple::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.lb-stat-card.green::before  { background: linear-gradient(90deg, #059669, #10b981); }
.lb-stat-card.blue::before   { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.lb-stat-card.orange::before { background: linear-gradient(90deg, #d97706, #f59e0b); }

.lb-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.lb-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.lb-stat-icon.purple { background: rgba(124, 58, 237, 0.12); }
.lb-stat-icon.green  { background: rgba(5, 150, 105, 0.12); }
.lb-stat-icon.blue   { background: rgba(37, 99, 235, 0.12); }
.lb-stat-icon.orange { background: rgba(217, 119, 6, 0.12); }

.lb-stat-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}

.lb-stat-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.6;
    margin: 0;
}

.lb-action-card {
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.18s ease;
    color: white !important;
    border: none;
}

.lb-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: white !important;
}

.lb-action-card.purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); box-shadow: 0 2px 8px rgba(109,40,217,0.35); }
.lb-action-card.green  { background: linear-gradient(135deg, #059669, #047857); box-shadow: 0 2px 8px rgba(5,150,105,0.35); }
.lb-action-card.blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 2px 8px rgba(37,99,235,0.35); }
.lb-action-card.orange { background: linear-gradient(135deg, #d97706, #b45309); box-shadow: 0 2px 8px rgba(217,119,6,0.35); }
.lb-action-card.icon { font-size: 22px; }

.lb-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline-color, rgba(0,0,0,0.08));
    font-size: 14px;
}

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

.lb-section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
    opacity: 0.85;
}

/* ================================================================
   HIDE UNFOLD THEME TOGGLE 
   ================================================================ */
aside nav > div:last-child {
    display: none !important;
}