/* =============================================
   styles.css — minimal custom CSS not covered by Tailwind
   Tailwind CDN handles all utility classes.
   ============================================= */

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

/* Brand typography — matches marketing site (Inter body, Outfit headings) */
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
h1, h2, h3, h4, h5 { font-family: 'Outfit', 'Inter', system-ui, sans-serif; letter-spacing: -0.02em; }

/* Product logo — "LifeSaver." */
.app-logo {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
    user-select: none;
}
.app-logo-dot {
    color: #10b981;
}
/* Header context: always on brand-green header */
#topbar .app-logo {
    color: #fff;
}
/* Login page: larger, dark text on light bg */
.app-logo--login {
    font-size: 2.5rem;
    color: #0f172a;
}
/* Store name shown inline with user name in the header */
.nav-store-label {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #d1d5db; transition: 0.2s; border-radius: 24px;
}
.toggle-slider:before {
    position: absolute; content: ""; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background-color: white;
    transition: 0.2s; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background-color: #059669; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ---- Shared button styles (used on all pages) ---- */
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff;
    border-radius: 8px; font-size: 0.8125rem; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.15s;
    white-space: nowrap; text-decoration: none;
    box-shadow: 0 4px 12px -4px rgba(16,185,129,.5);
}
.btn-primary:hover  { background: linear-gradient(135deg, #059669 0%, #047857 100%); box-shadow: 0 6px 16px -4px rgba(16,185,129,.7); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; background: #fff; color: #374151;
    border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 0.8125rem; font-weight: 500; cursor: pointer;
    transition: all 0.15s; white-space: nowrap; text-decoration: none;
}
.btn-secondary:hover { background: #f9fafb; border-color: #d1d5db; }

/* ---- Blue header ---- */
#topbar {
    background: #0f172a;
    border-bottom-color: #1e293b;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Nav role button — white on dark blue */
.nav-role-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500;
    color: rgba(255,255,255,0.72); text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav-role-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-role-btn.active { background: rgba(255,255,255,0.16); color: #fff; }
.badge-stack { display: inline-flex; gap: 3px; align-items: center; }

/* Icon action button */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid;
    cursor: pointer; transition: all .15s; flex-shrink: 0;
}

/* Filter pills */
.filter-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 500;
    color: #6b7280; background: #f9fafb; border: 1px solid #e5e7eb;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.filter-pill:hover { background: #f3f4f6; border-color: #d1d5db; }
.filter-pill.active { background: #d1fae5; border-color: #6ee7b7; color: #047857; }

/* Toast slide-in */
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* Status badges */
.status-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; margin-right: 6px;
}

/* Prereq checklist */
.prereq-item         { display: flex; align-items: center; gap: 8px; padding: 5px 8px; font-size: 0.875rem; border-radius: 6px; margin: 2px 0; }
.prereq-item.prereq-ok  { background-color: #f0fdf4; }
.prereq-item.prereq-nok { background-color: #fef2f2; }
.prereq-item .ok   { color: #16a34a; font-weight: 600; }
.prereq-item .fail { color: #ef4444; font-weight: 600; }

/* Print styles */
@media print {
    #topbar, .no-print { display: none !important; }
    body { background: white !important; }
    .print-page-break { page-break-after: always; }
}

/* Notification badge */
.notif-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: #ef4444; color: white;
    border-radius: 10px; font-size: 11px; font-weight: 700;
}

/* Order row unread bold */
.order-row-unread .order-number-text { font-weight: 700; }

/* Bulk toolbar slide-in */
.bulk-toolbar-enter {
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Document upload zone */
.upload-zone {
    border: 2px dashed #d1d5db; border-radius: 8px;
    padding: 12px 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
    display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: #6b7280;
}
.upload-zone:hover { border-color: #10b981; background: #ecfdf5; color: #059669; }

/* Substatus row */
.substatus-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid #f3f4f6;
}
.substatus-row:last-child { border-bottom: none; }

/* History timeline */
.history-line { display: flex; gap: 12px; padding: 8px 0; font-size: 0.8rem; }
.history-line + .history-line { border-top: 1px solid #f3f4f6; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; margin-top: 5px; flex-shrink: 0; }

/* Comment bubble */
.comment-bubble {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 12px 12px 12px 4px; padding: 10px 14px;
    font-size: 0.875rem; line-height: 1.5;
}
.comment-bubble.own { background: #d1fae5; border-color: #6ee7b7; border-radius: 12px 12px 4px 12px; }
.comment-bubble.system { background: #fefce8; border-color: #fde68a; font-style: italic; }
.comment-bold .comment-bubble { font-weight: 600; }

/* Packaging checklist */
.pack-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.pack-item:last-child { border-bottom: none; }
.pack-item input[type=checkbox] { width: 18px; height: 18px; accent-color: #059669; cursor: pointer; }
.pack-item.packed { opacity: 0.5; }
.pack-item.packed .pack-name { text-decoration: line-through; }
.pack-item.missing { background: #fef2f2; margin: 0 -4px; padding-left: 4px; padding-right: 4px; border-radius: 6px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---- App footer: legend of badges & statuses (same dark bg as #topbar) ---- */
.app-footer { background: #0f172a; border-top: 1px solid #1e293b; color: #cbd5e1; margin-top: 2.5rem; }
.app-footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.app-footer-toggle {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em;
}
.app-footer-toggle:hover { color: #fff; }
.app-footer-toggle svg { width: 15px; height: 15px; }
.app-footer-toggle .chev { transition: transform 0.2s; }
.app-footer.open .app-footer-toggle .chev { transform: rotate(180deg); }
.app-footer-body { display: none; padding: 0.25rem 0 1.75rem; }
.app-footer.open .app-footer-body { display: block; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 1.25rem 2rem; }
.legend-col h4 {
    color: #fff; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 0.6rem; padding-bottom: 0.35rem; border-bottom: 1px solid #1e293b;
}
.legend-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 0.5rem; font-size: 0.75rem; line-height: 1.35; }
.legend-ic { flex-shrink: 0; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.legend-ic svg { width: 15px; height: 15px; }
.legend-dot { flex-shrink: 0; width: 12px; height: 12px; border-radius: 9999px; margin-top: 3px; }
.legend-txt { color: #94a3b8; }
.legend-txt b { color: #f1f5f9; font-weight: 600; }
