/* ═══════════════════════════════════════════════════════════
   DayReady — Design System
   Substitute Teacher Command Center for K-12 Districts
   ═══════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ─── CSS Custom Properties ────────────────────────────────── */
:root {
    /* Primary — Warm Indigo */
    --primary: #5B4FC7;
    --primary-hover: #4A3FB0;
    --primary-light: #7B6FE0;
    --primary-bg: #F0EEFA;
    --primary-rgb: 91, 79, 199;

    /* Accent — Sunrise Amber */
    --accent: #E8913A;
    --accent-hover: #D47E2A;
    --accent-bg: #FEF3E6;
    --accent-rgb: 232, 145, 58;

    /* Status Colors */
    --success: #2D9B5A;
    --success-bg: #EAFAF1;
    --warning: #D4940A;
    --warning-bg: #FDF8E8;
    --danger: #D94452;
    --danger-bg: #FDE8EB;
    --info: #3B82F6;
    --info-bg: #EFF6FF;

    /* Neutrals */
    --text-dark: #2D2B3D;
    --text-body: #3D3B50;
    --text-muted: #6B6980;
    --text-light: #9E9BB5;
    --text-white: #FFFFFF;

    /* Backgrounds */
    --bg-body: linear-gradient(135deg, #3D2E8C 0%, #4A3BB0 25%, #5B4FC7 50%, #7B6FE0 75%, #9B91F0 100%);
    --bg-card: #F8F6FF;
    --bg-card-alt: #EEEAFC;
    --bg-subtle: #F0EFF5;
    --bg-sidebar: linear-gradient(180deg, #f8f6ff 0%, #f1eefb 50%, #e8e4f8 100%);
    --bg-sidebar-hover: rgba(91, 79, 199, 0.06);
    --bg-sidebar-active: rgba(91, 79, 199, 0.12);

    /* Borders */
    --border: #E4E2F0;
    --border-light: #EDECF4;
    --border-focus: var(--primary);

    /* Container */
    --container-padding: 1.5rem;
    --container-max-width: 95vw;
    --radius-container: 2rem;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(45, 43, 61, 0.04);
    --shadow-sm: 0 1px 3px rgba(45, 43, 61, 0.06), 0 1px 2px rgba(45, 43, 61, 0.04);
    --shadow-md: 0 4px 12px rgba(45, 43, 61, 0.08);
    --shadow-lg: 0 10px 30px rgba(45, 43, 61, 0.10);
    --shadow-xl: 0 20px 50px rgba(45, 43, 61, 0.14);

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --container-max: 1400px;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 0.25s;
    --duration-fast: 0.15s;
    --duration-slow: 0.4s;
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    background: linear-gradient(135deg, #3D2E8C 0%, #4A3BB0 25%, #5B4FC7 50%, #7B6FE0 75%, #9B91F0 100%);
    background-attachment: fixed;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body.auth-body {
    padding: 0;
    background: none;
}

@media (max-width: 991px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
}

/* ─── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.875rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

p { margin-bottom: 0.75rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}
a:hover { color: var(--primary-hover); }

small { font-size: 0.8125rem; color: var(--text-muted); }

/* ─── Utility Classes ──────────────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-dark { color: var(--text-dark) !important; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.font-heading { font-family: var(--font-heading); }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-header h3,
.card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-card .stat-value.text-success { color: var(--success) !important; }
.stat-card .stat-value.text-danger { color: var(--danger) !important; }
.stat-card .stat-value.text-accent { color: var(--accent) !important; }

.stat-card .stat-change {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    line-height: 1.4;
}

.btn i { font-size: 1.125rem; }

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-white);
}
.btn-accent:hover {
    background: var(--accent-hover);
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    background-size: 200% 200%;
    color: var(--text-white);
    animation: gradientShift 4s ease infinite;
}
.btn-gradient:hover {
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-body);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--text-white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
}
.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text-dark);
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.4375rem 0.875rem;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.8125rem 1.75rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    line-height: 1.4;
    white-space: nowrap;
}

.badge-primary   { background: var(--primary-bg); color: var(--primary); }
.badge-accent    { background: var(--accent-bg);  color: var(--accent); }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-warning   { background: var(--warning-bg); color: var(--warning); }
.badge-danger    { background: var(--danger-bg);  color: var(--danger); }
.badge-info      { background: var(--info-bg);    color: var(--info); }
.badge-muted     { background: var(--bg-subtle);  color: var(--text-muted); }

/* Solid badges */
.badge-solid-success { background: var(--success); color: white; }
.badge-solid-danger  { background: var(--danger);  color: white; }
.badge-solid-primary { background: var(--primary); color: white; }
.badge-solid-accent  { background: var(--accent);  color: white; }

/* ─── Filter Pills (Evaluatd Pattern) ──────────────────────── */
.stats-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stats-filter-bar .filter-bar-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    white-space: nowrap;
}

.filter-pills {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #f8f6ff 0%, var(--border) 100%);
    color: var(--text-muted);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.filter-pill:hover {
    border-color: var(--text-muted);
    background: linear-gradient(135deg, #f8f6ff 0%, #d8d5e8 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.filter-pill:focus { outline: none; }

.filter-pill .pill-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.filter-pill.active .pill-icon { opacity: 1; }

.filter-pill .pill-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--border);
    color: var(--text-muted);
    min-width: 1.5rem;
    text-align: center;
}

.filter-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.75);
}

/* Active pill — primary indigo */
.filter-pill.active {
    color: var(--primary-hover);
    background: linear-gradient(135deg, var(--primary-bg) 0%, #c4bef0 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* Legacy .pill class (maps to filter-pill) */
.pill-group {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #f8f6ff 0%, var(--border) 100%);
    color: var(--text-muted);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.pill:hover {
    border-color: var(--text-muted);
    background: linear-gradient(135deg, #f8f6ff 0%, #d8d5e8 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.pill.active {
    color: var(--primary-hover);
    background: linear-gradient(135deg, var(--primary-bg) 0%, #c4bef0 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* ─── Breadcrumb Stepper (Evaluatd Pattern) ────────────────── */
.breadcrumb-stepper {
    display: inline-flex;
    align-items: stretch;
    background: var(--border);
    padding: 6px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.breadcrumb-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 8px 12px;
    position: relative;
    height: 38px;
    box-sizing: border-box;
}

.breadcrumb-step::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 19px solid transparent;
    border-bottom: 19px solid transparent;
    border-left: 10px solid white;
    z-index: 2;
}

.breadcrumb-step::before {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 19px solid transparent;
    border-bottom: 19px solid transparent;
    border-left: 10px solid var(--border);
    z-index: 1;
}

.breadcrumb-step:first-child {
    border-radius: 4px 0 0 4px;
    padding-left: 14px;
}

.breadcrumb-step:not(:first-child) {
    padding-left: 20px;
}

.breadcrumb-step:last-child {
    border-radius: 0 4px 4px 0;
    padding-right: 14px;
}

.breadcrumb-step:last-child::after,
.breadcrumb-step:last-child::before {
    display: none;
}

.breadcrumb-step:first-child:last-child {
    border-radius: 4px;
    padding-left: 14px;
}

.breadcrumb-step .step-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--text-light);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.breadcrumb-step .step-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

a.step-label:hover {
    color: var(--primary);
}

.breadcrumb-step.active {
    background: var(--primary);
}

.breadcrumb-step.active::after {
    border-left-color: var(--primary);
}

.breadcrumb-step.active .step-number {
    background: white;
    border-color: white;
    color: var(--primary);
}

.breadcrumb-step.active .step-label {
    color: white;
    font-weight: 600;
}

.breadcrumb-arrow {
    display: none;
}

@media (max-width: 576px) {
    .breadcrumb-stepper {
        flex-wrap: wrap;
    }
    .filter-pill {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* ─── Form Elements ────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
}

.form-control {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    width: 100%;
    padding: 0.6875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-body);
    transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B6980' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 0.9375rem;
    cursor: pointer;
}

/* ─── Tables ───────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    white-space: nowrap;
}

td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9375rem;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
    background: rgba(var(--primary-rgb), 0.02);
}

/* ─── Avatars ──────────────────────────────────────────────── */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-white);
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.125rem; }
.avatar-xl { width: 68px; height: 68px; font-size: 1.375rem; }

.avatar-primary   { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.avatar-accent    { background: linear-gradient(135deg, var(--accent), #F0A860); }
.avatar-success   { background: linear-gradient(135deg, var(--success), #45B978); }
.avatar-danger    { background: linear-gradient(135deg, var(--danger), #E86B76); }
.avatar-info      { background: linear-gradient(135deg, var(--info), #60A5FA); }

/* ─── Empty States ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h4 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ─── Tabs ─────────────────────────────────────────────────── */
.nav-tabs-custom {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.nav-tabs-custom .tab-item {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-tabs-custom .tab-item:hover {
    color: var(--text-dark);
}

.nav-tabs-custom .tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ─── Accordion ────────────────────────────────────────────── */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    background: var(--bg-card);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background var(--duration-fast) var(--ease);
}

.accordion-header:hover {
    background: var(--bg-subtle);
}

.accordion-header .accordion-icon {
    transition: transform var(--duration) var(--ease);
}

.accordion-header.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 0 1.25rem 1.25rem;
    display: none;
}

.accordion-body.open {
    display: block;
}

/* ─── Toasts ───────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-white);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-bounce);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { background: var(--success); }
.toast-danger  { background: var(--danger); }
.toast-info    { background: var(--primary); }

/* ─── Star Rating ──────────────────────────────────────────── */
.star-rating {
    display: inline-flex;
    gap: 0.25rem;
}

.star-rating .star {
    font-size: 1.375rem;
    color: var(--border);
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease-bounce);
}

.star-rating .star.active,
.star-rating .star.hovered {
    color: var(--accent);
}

.star-rating .star:hover {
    transform: scale(1.15);
}

/* Star rating display (non-interactive) */
.star-display {
    display: inline-flex;
    gap: 0.125rem;
}

.star-display .star {
    font-size: 0.875rem;
    color: var(--border);
}

.star-display .star.filled {
    color: var(--accent);
}

/* ─── Divider ──────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* ─── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.05); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.animate-fade-in { animation: fadeIn var(--duration-slow) var(--ease) both; }
.animate-slide-up { animation: slideUp var(--duration-slow) var(--ease) both; }

/* Staggered entrance delays */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ─── Selection ────────────────────────────────────────────── */
::selection {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-hover);
}

/* ─── Touch & Focus States ─────────────────────────────────── */
/* Ensure all interactive elements have focus/active states for touch */
.btn:focus-visible,
.filter-pill:focus-visible,
.pill:focus-visible,
.nav-tabs-custom .tab-item:focus-visible,
.accordion-header:focus-visible,
.quick-action:focus-visible,
.role-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar-nav .nav-item:active,
.sidebar-footer .nav-item:active {
    background: var(--bg-sidebar-active);
    color: var(--primary);
}

.quick-action:active {
    transform: scale(0.98);
    border-color: var(--primary);
    background: var(--primary-bg);
}

.filter-pill:active,
.pill:active {
    transform: scale(0.97);
}

.accordion-header:active {
    background: var(--bg-subtle);
}

/* ─── Responsive Utilities ─────────────────────────────────── */
.hide-mobile { display: block; }
.show-mobile { display: none; }

/* ─── Tablet (768px) ───────────────────────────────────────── */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .card-body { padding: 1rem; }
    .card-header { padding: 0.875rem 1rem; }

    /* Touch-friendly form controls */
    .form-check input[type="checkbox"],
    .form-check input[type="radio"] {
        width: 22px;
        height: 22px;
    }

    .form-control {
        font-size: 1rem; /* Prevent iOS zoom on focus */
        padding: 0.75rem 1rem;
    }

    select.form-control {
        font-size: 1rem;
    }

    textarea.form-control {
        font-size: 1rem;
    }

    /* Larger touch targets for nav */
    .sidebar-nav .nav-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }

    .sidebar-footer .nav-item {
        padding: 0.625rem 1rem;
        min-height: 44px;
    }

    /* Larger filter pills on touch */
    .filter-pill {
        padding: 0.5rem 0.875rem;
        min-height: 40px;
    }

    .pill {
        padding: 0.5rem 0.875rem;
        min-height: 40px;
    }

    /* Table responsive */
    th { padding: 0.625rem 0.75rem; font-size: 0.6875rem; }
    td { padding: 0.625rem 0.75rem; font-size: 0.875rem; }

    /* Breadcrumb wrap */
    .breadcrumb-stepper {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Tabs scroll horizontally on mobile */
    .nav-tabs-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs-custom::-webkit-scrollbar { display: none; }

    .nav-tabs-custom .tab-item {
        min-height: 44px;
    }
}

/* ─── Small Phone (480px) ──────────────────────────────────── */
@media (max-width: 480px) {
    body { font-size: 0.9375rem; }

    .breadcrumb-stepper {
        padding: 4px;
    }

    .breadcrumb-step {
        padding: 6px 10px;
        height: 34px;
    }

    .breadcrumb-step:not(:first-child) {
        padding-left: 16px;
    }

    .breadcrumb-step .step-label {
        font-size: 0.75rem;
    }

    .breadcrumb-step::after {
        right: -8px;
        border-top-width: 17px;
        border-bottom-width: 17px;
        border-left-width: 8px;
    }

    .breadcrumb-step::before {
        right: -10px;
        border-top-width: 17px;
        border-bottom-width: 17px;
        border-left-width: 8px;
    }

    .filter-pill .pill-count {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ─── Streamline colorful nav icons ──────────────────────── */
.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item:hover .nav-icon {
    transform: scale(1.1);
}
.nav-item.active .nav-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}
