/* ============================================================
   ApplyMate — Global Stylesheet v2 (Mobile-First)
   Brand: Navy #121b49 | Yellow #ffd200 | Lavender #d6d7fa
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:          #121b49;
    --navy-dark:     #0b1133;
    --navy-mid:      #1e2d6b;
    --yellow:        #ffd200;
    --yellow-dark:   #e6bc00;
    --lavender:      #d6d7fa;
    --lavender-dark: #b8baed;
    --white:         #eeeeef;
    --white-pure:    #ffffff;
    --gray-50:       #fafafa;
    --gray-100:      #f5f5f6;
    --gray-200:      #e8e8ea;
    --gray-300:      #d1d1d5;
    --gray-400:      #a0a0a8;
    --gray-500:      #6b6b75;
    --gray-600:      #4a4a52;
    --danger:        #dc3545;
    --danger-bg:     #fff5f5;
    --success:       #198754;
    --success-bg:    #f0faf4;
    --warning:       #b45309;
    --warning-bg:    #fffbf0;
    --info:          #1d6efd;
    --info-bg:       #f0f6ff;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(18,27,73,0.08);
    --shadow-md: 0 4px 16px rgba(18,27,73,0.10);
    --shadow-lg: 0 8px 32px rgba(18,27,73,0.14);
    --transition: 0.18s ease;
    --sidebar-w: 260px;
    --topbar-h:  60px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); background: #f5f5f6; color: var(--navy); line-height: 1.6; min-height: 100vh; }
a { color: var(--navy-mid); text-decoration: none; }
a:hover { color: var(--navy); }
img { max-width: 100%; display: block; }

/* ── Typography ─────────────────────────────────────────── */
h1 { font-size: clamp(1.5rem, 4vw, 2rem);   font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.2rem;  font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }
h5 { font-size: 0.9rem;  font-weight: 600; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.text-muted   { color: var(--gray-500); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }

/* ── Layout ─────────────────────────────────────────────── */
.container    { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container--sm{ max-width: 800px;  margin: 0 auto; padding: 0 1rem; }

/* App shell */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.app-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--navy);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
    -webkit-overflow-scrolling: touch;
}

.app-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    background: var(--white-pure);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 1.25rem;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.app-content { padding: 1.25rem; flex: 1; }

/* Sidebar internals */
.sidebar__logo {
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.sidebar__logo-text {
    font-size: 1.35rem; font-weight: 800;
    color: var(--yellow); letter-spacing: -0.5px;
}
.sidebar__logo-text span { color: #fff; }
.sidebar__logo-sub {
    font-size: 0.65rem; color: rgba(255,255,255,0.35);
    margin-top: 2px; letter-spacing: 0.05em; text-transform: uppercase;
}

.sidebar__nav { padding: 0.5rem 0; flex: 1; }

.sidebar__section-label {
    font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 0.875rem 1rem 0.2rem;
}

.sidebar__link {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.575rem 1rem;
    color: rgba(255,255,255,0.72); font-size: 0.875rem; font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap; overflow: hidden;
}
.sidebar__link:hover  { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar__link.active { background: rgba(255,210,0,0.1); color: var(--yellow); border-left-color: var(--yellow); }
.sidebar__link .nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }
.sidebar__link.active .nav-icon { opacity: 1; }

.sidebar__user {
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 0.65rem;
    flex-shrink: 0;
}
.sidebar__avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--yellow); color: var(--navy);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem; flex-shrink: 0;
}
.sidebar__user-name { font-size: 0.8rem; font-weight: 600; color: #fff; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 0.68rem; color: rgba(255,255,255,0.4); text-transform: capitalize; }
.sidebar__signout {
    display: block; padding: 0.65rem 1rem;
    color: rgba(255,255,255,0.35); font-size: 0.78rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
    transition: color var(--transition);
    flex-shrink: 0;
}
.sidebar__signout:hover { color: rgba(255,255,255,0.65); }

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 190;
}

/* Hamburger */
.menu-toggle {
    display: none;
    background: none; border: none;
    width: 38px; height: 38px;
    cursor: pointer; padding: 0;
    flex-shrink: 0;
    align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--navy);
}
.menu-toggle:hover { background: var(--gray-100); }
.menu-toggle svg { width: 22px; height: 22px; }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
    display: flex; align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 0.75rem; flex-wrap: wrap;
}
.page-header__title    { font-size: clamp(1.15rem, 3vw, 1.5rem); font-weight: 700; }
.page-header__subtitle { color: var(--gray-500); font-size: 0.875rem; margin-top: 0.15rem; }
.page-header__actions  { display: flex; gap: 0.5rem; flex-wrap: wrap; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--white-pure);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center;
    justify-content: space-between; gap: 0.75rem;
    flex-wrap: wrap;
}
.card__title  { font-size: 0.95rem; font-weight: 600; }
.card__body   { padding: 1.25rem; }
.card__footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.stat-card {
    background: var(--white-pure);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}
.stat-card__label { font-size: 0.72rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem; }
.stat-card__value { font-size: clamp(1.4rem, 4vw, 1.75rem); font-weight: 700; color: var(--navy); line-height: 1; }
.stat-card__sub   { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.2rem; }
.stat-card--yellow  { border-top: 3px solid var(--yellow); }
.stat-card--navy    { border-top: 3px solid var(--navy); }
.stat-card--success { border-top: 3px solid var(--success); }
.stat-card--lavender{ border-top: 3px solid var(--lavender-dark); }
.stat-card--danger  { border-top: 3px solid var(--danger); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.4rem; padding: 0.45rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer; transition: var(--transition);
    text-decoration: none; white-space: nowrap; line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.btn--primary:hover:not(:disabled) { background: var(--yellow-dark); border-color: var(--yellow-dark); color: var(--navy); }
.btn--navy    { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn--navy:hover:not(:disabled) { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--gray-300); }
.btn--outline:hover:not(:disabled) { border-color: var(--navy); background: var(--gray-100); }
.btn--danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: #b02a37; border-color: #b02a37; }
.btn--success { background: var(--success); color: #fff; border-color: var(--success); }
.btn--success:hover:not(:disabled) { background: #146c43; }
.btn--ghost   { background: transparent; color: var(--gray-500); border-color: transparent; }
.btn--ghost:hover { background: var(--gray-100); color: var(--navy); }
.btn--sm  { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn--lg  { padding: 0.65rem 1.75rem; font-size: 0.975rem; }
.btn--xl  { padding: 0.85rem 2.25rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--icon  { padding: 0.4rem; width: 34px; height: 34px; border-radius: var(--radius-sm); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group   { margin-bottom: 1rem; }
.form-label   { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 0.3rem; }
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    display: block; width: 100%;
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem; line-height: 1.5;
    color: var(--navy); background: var(--white-pure);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font-sans);
    -webkit-appearance: none;
    min-height: 42px;
}
.form-control:focus { outline: none; border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(18,27,73,0.1); }
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-100); opacity: 0.7; cursor: not-allowed; }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-hint  { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.25rem; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 0.25rem; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
.form-row--3 { grid-template-columns: 1fr; }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--gray-300); border-radius: var(--radius-md);
    padding: 2rem 1rem; text-align: center; cursor: pointer;
    transition: var(--transition); background: var(--gray-50);
    min-height: 100px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--navy-mid); background: var(--lavender); }
.upload-zone input[type="file"] { display: none; }
.upload-zone__text { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.5rem; }

/* ── Tables → Card stacks on mobile ──────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); border: 1px solid var(--gray-200); }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 600px; }
.table th {
    background: var(--gray-50); padding: 0.65rem 1rem;
    text-align: left; font-weight: 600; color: var(--gray-600);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
.table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--gray-200); color: var(--navy); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-50); }
.table--compact td, .table--compact th { padding: 0.5rem 0.875rem; }

/* Mobile card list — replaces table rows on small screens */
.mobile-card-list { display: none; }
.mobile-card-item {
    background: var(--white-pure);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}
.mobile-card-item:last-child { margin-bottom: 0; }
.mobile-card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.mobile-card-row:last-child { margin-bottom: 0; }
.mobile-card-label { font-size: 0.72rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; }
.mobile-card-val   { font-size: 0.875rem; font-weight: 500; text-align: right; flex: 1; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.6rem; border-radius: 20px;
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.02em; white-space: nowrap;
}
.badge--secondary { background: var(--gray-200);   color: var(--gray-600); }
.badge--info      { background: var(--info-bg);    color: var(--info); }
.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--navy      { background: var(--navy);        color: var(--yellow); }
.badge--yellow    { background: var(--yellow);      color: var(--navy); }
.badge--lavender  { background: var(--lavender);    color: var(--navy-mid); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.875rem 1rem; border-radius: var(--radius-sm);
    margin-bottom: 1rem; font-size: 0.875rem;
}
.alert__icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert--info    { background: var(--info-bg);    color: var(--info);    border-left: 4px solid var(--info); }
.alert--success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.alert--error   { background: var(--danger-bg);  color: var(--danger);  border-left: 4px solid var(--danger); }
.alert--warning { background: var(--warning-bg); color: var(--warning); border-left: 4px solid var(--warning); }

/* ── Timeline ────────────────────────────────────────────── */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline__item   { display: flex; gap: 1rem; padding: 0 0 1.25rem 2.25rem; position: relative; }
.timeline__dot    { position: absolute; left: 5px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); border: 3px solid var(--white-pure); box-shadow: 0 0 0 2px var(--navy); flex-shrink: 0; }
.timeline__dot--yellow  { background: var(--yellow);  box-shadow: 0 0 0 2px var(--yellow); }
.timeline__dot--success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline__dot--danger  { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }
.timeline__time   { font-size: 0.75rem; color: var(--gray-400); white-space: nowrap; }
.timeline__event  { font-size: 0.875rem; font-weight: 600; }
.timeline__note   { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.15rem; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { border-bottom: 2px solid var(--gray-200); display: flex; gap: 0; margin-bottom: 1.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 0.6rem 1rem; font-size: 0.875rem; font-weight: 600; color: var(--gray-500); border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; transition: var(--transition); text-decoration: none; }
.tab:hover  { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--yellow); }

/* ── Status progress steps ───────────────────────────────── */
.progress-steps { display: flex; align-items: center; margin-bottom: 1.5rem; overflow-x: auto; padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; }
.progress-step { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex: 1; min-width: 70px; position: relative; }
.progress-step::before { content: ''; position: absolute; top: 13px; left: calc(-50% + 13px); right: calc(50% + 13px); height: 2px; background: var(--gray-300); }
.progress-step:first-child::before { display: none; }
.progress-step__circle { width: 26px; height: 26px; border-radius: 50%; background: var(--gray-200); color: var(--gray-500); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; z-index: 1; transition: var(--transition); }
.progress-step__label  { font-size: 0.65rem; color: var(--gray-400); text-align: center; font-weight: 600; }
.progress-step.done .progress-step__circle  { background: var(--navy);   color: var(--yellow); }
.progress-step.done .progress-step__label   { color: var(--navy); }
.progress-step.done::before                 { background: var(--navy); }
.progress-step.active .progress-step__circle{ background: var(--yellow); color: var(--navy); box-shadow: 0 0 0 4px rgba(255,210,0,0.22); }
.progress-step.active .progress-step__label { color: var(--navy); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 0.2rem; align-items: center; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 0.5rem; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200); font-size: 0.875rem; color: var(--navy); font-weight: 500; transition: var(--transition); text-decoration: none; }
.page-link:hover:not(.disabled) { border-color: var(--navy); background: var(--navy); color: #fff; }
.page-link.active   { background: var(--navy); border-color: var(--navy); color: var(--yellow); font-weight: 700; }
.page-link.disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page { min-height: 100vh; background: var(--navy); display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card { background: var(--white-pure); border-radius: var(--radius-lg); padding: 2rem 1.5rem; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.auth-card__title { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.2rem; }
.auth-card__sub   { color: var(--gray-500); font-size: 0.875rem; margin-bottom: 1.5rem; }
.auth-divider { text-align: center; position: relative; margin: 1.1rem 0; color: var(--gray-400); font-size: 0.78rem; }
.auth-divider::before { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: var(--gray-200); }
.auth-divider span { background: var(--white-pure); padding: 0 0.75rem; position: relative; }

/* ── Public nav ──────────────────────────────────────────── */
.public-nav { background: var(--navy); padding: 0.875rem 0; position: sticky; top: 0; z-index: 200; }
.public-nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.public-nav__logo  { font-size: 1.35rem; font-weight: 800; color: var(--yellow); letter-spacing: -0.5px; flex-shrink: 0; }
.public-nav__logo span { color: #fff; }
.public-nav__links { display: flex; gap: 0.25rem; align-items: center; }
.public-nav__link  { color: rgba(255,255,255,0.8); font-size: 0.875rem; font-weight: 500; padding: 0.35rem 0.65rem; border-radius: var(--radius-sm); transition: var(--transition); }
.public-nav__link:hover { color: var(--yellow); }

/* Hero */
.hero { background: var(--navy); color: #fff; padding: 3.5rem 0 3rem; text-align: center; }
.hero h1 { color: #fff; margin-bottom: 0.875rem; }
.hero h1 span { color: var(--yellow); }
.hero p { font-size: 1.05rem; color: rgba(255,255,255,0.7); max-width: 560px; margin: 0 auto 1.75rem; }

/* Status tracker */
.status-tracker { background: var(--navy); border-radius: var(--radius-lg); padding: 1.5rem; color: #fff; margin-bottom: 1.25rem; }
.status-tracker__ref  { font-size: 0.75rem; opacity: 0.55; margin-bottom: 0.2rem; }
.status-tracker__name { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.625rem; }

/* ── Utility ─────────────────────────────────────────────── */
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-0  { padding: 0 !important; }

/* Grid — mobile first (single col) */
.grid-2, .grid-3, .grid-4 { display: grid; grid-template-columns: 1fr; gap: 1rem; }

/* Empty state */
.empty-state { text-align: center; padding: 2.5rem 1.5rem; color: var(--gray-400); }
.empty-state__icon  { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state__title { font-size: 1rem; font-weight: 600; color: var(--gray-500); margin-bottom: 0.35rem; }
.empty-state__text  { font-size: 0.875rem; }

/* Spinner */
.spinner { width: 22px; height: 22px; border: 3px solid var(--gray-200); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search bar */
.search-bar { position: relative; }
.search-bar input { padding-left: 2.25rem; }
.search-bar::before { content: '⌕'; position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 1rem; pointer-events: none; }

/* Filter row */
.filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filter-row .form-group { margin-bottom: 0; }

/* Action menu */
.action-menu { position: relative; display: inline-block; }
.action-menu__dropdown { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: var(--white-pure); border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: var(--shadow-md); min-width: 180px; z-index: 50; overflow: hidden; }
.action-menu:hover .action-menu__dropdown, .action-menu.open .action-menu__dropdown { display: block; }
.action-menu__item { display: block; padding: 0.625rem 1rem; font-size: 0.875rem; color: var(--navy); font-weight: 500; transition: var(--transition); }
.action-menu__item:hover { background: var(--gray-50); }
.action-menu__item--danger { color: var(--danger); }

/* Section label in staff/admin detail views */
.detail-section { margin-bottom: 1.25rem; }
.detail-section__title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); margin-bottom: 0.625rem; padding-bottom: 0.375rem; border-bottom: 1px solid var(--gray-200); }

/* Key-value pair list */
.kv-list { display: flex; flex-direction: column; gap: 0; }
.kv-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.6rem 0; border-bottom: 1px solid var(--gray-200); gap: 1rem; font-size: 0.875rem; }
.kv-item:last-child { border-bottom: none; }
.kv-label { color: var(--gray-500); flex-shrink: 0; }
.kv-val   { font-weight: 500; text-align: right; word-break: break-word; }

/* ── Responsive breakpoints ──────────────────────────────── */

/* Tablet: 640px+ */
@media (min-width: 640px) {
    .app-content { padding: 1.5rem; }
    .auth-card { padding: 2.5rem; }
    .form-row   { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .form-row--3{ grid-template-columns: repeat(3, 1fr); gap: 1rem; }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .stat-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: 900px+ */
@media (min-width: 900px) {
    .app-content { padding: 2rem; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    .menu-toggle { display: none !important; }
    .sidebar-overlay { display: none !important; }
    .app-sidebar { transform: none !important; }
    .app-main { margin-left: var(--sidebar-w); }
    .mobile-card-list { display: none !important; }
    .table-desktop { display: table !important; }
}

/* Mobile only: < 900px */
@media (max-width: 899px) {
    :root { --sidebar-w: 260px; }
    .menu-toggle { display: inline-flex; }
    .app-main { margin-left: 0; }

    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-overlay.open { display: block; }

    /* Tables → card stacks */
    .table-wrap { border: none; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
    .table-desktop { display: none; }
    .mobile-card-list { display: block; }

    /* Stack page header on mobile */
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header__actions { justify-content: flex-start; }

    /* Full-width buttons in modals/forms */
    .mobile-btn-block { width: 100% !important; }
}

/* Small mobile: < 480px */
@media (max-width: 479px) {
    .hero { padding: 2.5rem 0 2rem; }
    .hero h1 { font-size: 1.6rem; }
    .auth-card { padding: 1.5rem 1.25rem; }
    .card__body { padding: 1rem; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
    .stat-card { padding: 0.875rem 1rem; }
    .public-nav__links .public-nav__link { display: none; }
    .public-nav__links .btn { display: inline-flex; }
}
