/*
 * Restaurant Enrollment Command Center — design system.
 * Layered on top of Bootstrap 5.3 (no build step in this environment - see README
 * Autoloading/Environment notes). Overrides target Bootstrap's compiled classes
 * directly rather than its --bs-* root variables, since the CDN build resolves
 * those to literal values per-component rather than cascading from :root.
 */

:root {
    /* Ink / neutrals */
    --ink-900: #1a1f26;
    --ink-800: #232a33;
    --ink-700: #2c3542;
    --ink-600: #3a4553;
    --slate-500: #626c7a;
    --slate-400: #8992a0;
    --slate-200: #e1e4e9;
    --slate-100: #edeef1;
    --paper: #f6f6f4;
    --surface: #ffffff;

    /* Brand accent - spiced brick-red, used sparingly for actions/active state */
    --brand-700: #9c3a19;
    --brand-600: #c1481f;
    --brand-500: #d5602f;
    --brand-100: #fbe9e1;
    --brand-50: #fdf4f0;

    /* Semantic (kept close to Bootstrap's hues so existing badge/alert meanings
       - enrollment statuses, appointment states - stay recognizable) */
    --good-600: #1f7a5c;
    --good-100: #e1f3ec;
    --warn-600: #b3760a;
    --warn-100: #fbf0dc;
    --bad-600: #c0392f;
    --bad-100: #fbe6e3;
    --info-600: #2a6cb0;
    --info-100: #e3eefb;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(26, 31, 38, 0.06);
    --shadow: 0 1px 3px rgba(26, 31, 38, 0.07), 0 6px 16px -8px rgba(26, 31, 38, 0.12);
    --shadow-lg: 0 12px 32px -12px rgba(26, 31, 38, 0.28);

    --font-display: "Lexend", "Inter", system-ui, -apple-system, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

/* ---------- Base ---------- */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--paper);
    color: var(--ink-800);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

a {
    color: var(--brand-600);
    text-decoration: none;
}

a:hover {
    color: var(--brand-700);
}

.text-muted {
    color: var(--slate-500) !important;
}

::selection {
    background: var(--brand-100);
    color: var(--brand-700);
}

/* Consistent, visible keyboard focus everywhere - buttons/links/inputs all
   fall back to outline since Bootstrap's own focus rings vary by component. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* Slim, quiet scrollbars for the inner scroll panels (activity feeds, sidebar) */
.scroll-thin::-webkit-scrollbar {
    width: 8px;
}
.scroll-thin::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: 8px;
}
.scroll-thin::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- Cards ---------- */

.card {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--slate-200);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink-900);
    padding: 0.9rem 1.1rem;
}

.card-body {
    padding: 1.1rem;
}

.shadow-sm {
    box-shadow: var(--shadow) !important;
}

/* ---------- Buttons ---------- */

.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.btn-primary {
    --bs-btn-bg: var(--brand-600);
    --bs-btn-border-color: var(--brand-600);
    --bs-btn-hover-bg: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand-600);
    --bs-btn-disabled-border-color: var(--brand-600);
    --bs-btn-focus-shadow-rgb: 193, 72, 31;
}

.btn-primary:hover {
    box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-600);
    --bs-btn-border-color: var(--brand-600);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-600);
    --bs-btn-active-border-color: var(--brand-600);
}

.btn-outline-secondary {
    --bs-btn-color: var(--slate-500);
    --bs-btn-border-color: var(--slate-200);
    --bs-btn-hover-bg: var(--ink-900);
    --bs-btn-hover-border-color: var(--ink-900);
}

.btn-link {
    color: var(--brand-600);
}

/* ---------- Tables ---------- */

.table {
    --bs-table-color: var(--ink-800);
    font-variant-numeric: tabular-nums;
}

.table > thead {
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--slate-500);
}

.table > thead > tr > th {
    border-bottom-width: 1px;
    border-bottom-color: var(--slate-200);
    font-weight: 600;
    background-color: transparent !important;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--slate-100);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--brand-50);
}

.table-light, .table > thead.table-light {
    --bs-table-bg: transparent;
}

/* ---------- Forms ---------- */

.form-label {
    font-weight: 500;
    color: var(--ink-800);
    font-size: 0.875rem;
}

.form-control, .form-select {
    border-color: var(--slate-200);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 0.2rem var(--brand-100);
}

.form-text {
    color: var(--slate-500);
}

/* ---------- Badges / pills ---------- */

.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 0.4em 0.65em;
    border-radius: 999px;
}

.text-bg-success, .badge.bg-success { background-color: var(--good-600) !important; }
.text-bg-danger, .badge.bg-danger { background-color: var(--bad-600) !important; }
.text-bg-warning, .badge.bg-warning { background-color: var(--warn-600) !important; color: #fff !important; }
.text-bg-secondary, .badge.bg-secondary { background-color: var(--slate-400) !important; }
.text-bg-primary, .badge.bg-primary { background-color: var(--brand-600) !important; }
.text-bg-info, .badge.bg-info { background-color: var(--info-600) !important; color: #fff !important; }

/* ---------- Alerts ---------- */

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.alert-success { background-color: var(--good-100); color: #155843; border-color: #c9e9dc; }
.alert-danger { background-color: var(--bad-100); color: #8f2c24; border-color: #f2cdc8; }
.alert-warning { background-color: var(--warn-100); color: #7a520a; border-color: #f0dfb2; }
.alert-info { background-color: var(--info-100); color: #1e4f80; border-color: #c6dcf3; }

/* ---------- Progress ---------- */

.progress {
    background-color: var(--slate-100);
    border-radius: 999px;
}

.progress-bar.bg-primary {
    background-color: var(--brand-600) !important;
}

/* ---------- Dropdowns ---------- */

.dropdown-menu {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--brand-50);
    color: var(--brand-700);
}

.dropdown-item-text {
    padding: 0.35rem 0.75rem;
}

/* ---------- Pagination ---------- */

.page-link {
    color: var(--ink-800);
    border-color: var(--slate-200);
}

.page-item.active .page-link {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}

.page-link:hover {
    color: var(--brand-700);
    background-color: var(--brand-50);
}

/* ---------- Admin shell: topbar + sidebar ---------- */

.app-topbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--slate-200);
    height: 60px;
    padding: 0 1.25rem;
}

.app-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

.app-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(155deg, var(--brand-500), var(--brand-700));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 0.95rem;
}

.sidebar-toggle {
    border: 1px solid var(--slate-200);
    background: var(--surface);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--ink-800);
}

.avatar-chip {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--ink-900);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    font-family: var(--font-display);
    flex-shrink: 0;
}

.user-menu-btn {
    border: 1px solid var(--slate-200);
    background: var(--surface);
    border-radius: 999px;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--ink-800);
}

.user-menu-btn:hover {
    border-color: var(--slate-400);
}

.user-menu-btn .fullname {
    font-size: 0.85rem;
    font-weight: 500;
}

.app-sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--ink-900);
    color: #cfd4dc;
    min-height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    align-self: flex-start;
    padding: 1.1rem 0.85rem;
}

.sidebar-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7481;
    font-weight: 600;
    padding: 1rem 0.65rem 0.35rem;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #c3c9d1;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    margin-bottom: 0.1rem;
}

.app-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 1.1rem;
    text-align: center;
    color: #9aa2ad;
}

.app-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.app-sidebar .nav-link.active {
    background-color: rgba(213, 96, 47, 0.16);
    border-left-color: var(--brand-500);
    color: #fff;
}

.app-sidebar .nav-link.active i {
    color: var(--brand-500);
}

.app-sidebar .nav-link.disabled {
    color: #5c6470;
    cursor: not-allowed;
}

.app-sidebar .nav-link.disabled i {
    color: #4a505a;
}

.app-main {
    flex-grow: 1;
    min-width: 0;
    padding: 1.75rem;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar-toggle {
        display: inline-flex;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 200ms ease;
        box-shadow: var(--shadow-lg);
        padding-top: 1.25rem;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(17, 20, 25, 0.45);
        z-index: 1040;
    }

    .app-main {
        padding: 1.1rem;
    }
}

/* ---------- Dashboard stat tiles ---------- */

.stat-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: var(--brand-50);
    color: var(--brand-600);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink-900);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    font-weight: 600;
}

/* ---------- Guest (auth) layout ---------- */

.guest-shell {
    background:
        radial-gradient(circle at 15% 12%, rgba(213, 96, 47, 0.16), transparent 45%),
        var(--ink-900);
    min-height: 100vh;
}

.guest-brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(155deg, var(--brand-500), var(--brand-700));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 1.4rem;
    box-shadow: var(--shadow-lg);
}

.guest-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ---------- Employee Hub layout ---------- */

.hub-shell {
    background: var(--paper);
}

.hub-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--slate-200);
}

.hub-bottom-nav {
    background: var(--surface);
    border-top: 1px solid var(--slate-200);
    box-shadow: 0 -8px 24px -16px rgba(26, 31, 38, 0.25);
}

.hub-bottom-nav .nav-link {
    color: var(--slate-500);
    font-weight: 500;
    font-size: 0.72rem;
}

.hub-bottom-nav .nav-link i {
    font-size: 1.3rem;
}

.hub-bottom-nav .nav-link.active {
    color: var(--brand-600);
    font-weight: 600;
}

/* ---------- Empty states ---------- */

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--slate-500);
}

.empty-state i {
    font-size: 1.75rem;
    color: var(--slate-400);
    margin-bottom: 0.5rem;
    display: inline-block;
}
