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

:root {
    --bg: #f4f6fb;
    --bg-soft: #eef2f8;
    --surface: #ffffff;
    --surface-muted: #f8faff;
    --surface-strong: #f1f4fb;
    --text: #16213d;
    --text-soft: #66748f;
    --line: #dde4f0;
    --line-strong: #ced8e8;
    --primary: #5f74ff;
    --primary-2: #8a6eff;
    --primary-soft: rgba(95, 116, 255, 0.12);
    --warning: #f3b646;
    --success: #33b78f;
    --danger: #ec5f7a;
    --navy: #33557f;
    --teal: #2f8195;
    --olive: #5b8a48;
    --shadow-sm: 0 8px 22px rgba(22, 33, 61, 0.06);
    --shadow-md: 0 18px 38px rgba(22, 33, 61, 0.08);
    --shadow-lg: 0 28px 65px rgba(22, 33, 61, 0.12);
    --radius-sm: 14px;
    --radius: 18px;
    --radius-lg: 22px;
    --sidebar-width: 88px;
    --sidebar-expanded-width: 248px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(138, 110, 255, 0.08), transparent 22%),
        radial-gradient(circle at top right, rgba(95, 116, 255, 0.08), transparent 24%),
        var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: currentColor; }

.guest-shell, .guest-main { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.guest-main { width: 100%; }

.auth-card, .page-card, .hero, .hero-panel, .stat-card, .scheduler-card, .modal-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(221, 228, 240, 0.9);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

.auth-card { width: min(720px, 100%); padding: 32px; }
.auth-card.wide { width: min(920px, 100%); }

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    flex: 0 0 88px;
    width: 88px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 18px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.96));
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 28px rgba(22, 33, 61, 0.04);
    transition: width 0.22s ease, padding 0.22s ease, box-shadow 0.22s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.brand-compact {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.brand-copy {
    display: none;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-weight: 800;
    font-size: 0.92rem;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 12px 24px rgba(95, 116, 255, 0.26);
}

.brand-copy strong { display: block; font-size: 0.95rem; }
.brand-copy small { color: var(--text-soft); font-size: 0.72rem; }

.nav-list {
    width: 100%;
    display: grid;
    gap: 8px;
}

.nav-icons a {
    position: relative;
    width: 100%;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    color: var(--text-soft);
    border-radius: 16px;
    transition: 0.2s ease;
}

.nav-icons a span {
    display: none;
}

.nav-icons a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(22, 33, 61, 0.94);
    color: white;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(22, 33, 61, 0.18);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-icons a:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.nav-icons a:hover,
.nav-icons a.active {
    background: linear-gradient(180deg, rgba(95, 116, 255, 0.12), rgba(138, 110, 255, 0.08));
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(95, 116, 255, 0.12);
}

.nav-icons a svg {
    width: 20px;
    height: 20px;
}

.logout-form {
    margin-top: auto;
    width: 100%;
}

.sidebar-logout {
    width: 100%;
    display: inline-grid;
    place-items: center;
    min-height: 48px;
    padding: 0;
}

.sidebar-logout span { display: none; }

.main-content {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    width: calc(100vw - 88px);
    margin-left: 88px;
    padding: 24px;
    transition: margin-left 0.22s ease, width 0.22s ease;
}

.content-shell {
    min-width: 0;
}

body.sidebar-expanded .sidebar,
html.sidebar-expanded body .sidebar {
    width: var(--sidebar-expanded-width);
    padding: 18px 16px;
    align-items: stretch;
}

body.sidebar-expanded .brand-compact,
html.sidebar-expanded body .brand-compact {
    flex-direction: row;
    text-align: left;
}

body.sidebar-expanded .brand-copy,
html.sidebar-expanded body .brand-copy {
    display: block;
}

body.sidebar-expanded .nav-icons a,
html.sidebar-expanded body .nav-icons a {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding-inline: 14px;
}

body.sidebar-expanded .nav-icons a span,
html.sidebar-expanded body .nav-icons a span {
    display: inline;
    font-size: 0.82rem;
}

body.sidebar-expanded .nav-icons a::after,
html.sidebar-expanded body .nav-icons a::after {
    display: none;
}

body.sidebar-expanded .sidebar-logout,
html.sidebar-expanded body .sidebar-logout {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: auto;
    padding: 10px 14px;
}

body.sidebar-expanded .sidebar-logout span,
html.sidebar-expanded body .sidebar-logout span {
    display: inline;
}

body.sidebar-expanded .main-content,
html.sidebar-expanded body .main-content {
    width: calc(100vw - var(--sidebar-expanded-width));
    margin-left: var(--sidebar-expanded-width);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 0 0 14px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-heading h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.search-shell {
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text-soft);
}

.search-shell input {
    border: none;
    outline: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.topbar-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px 9px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.topbar-card strong {
    display: block;
    font-size: 0.9rem;
}

.topbar-card span:last-child,
.topbar-card div span {
    display: block;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.avatar-pill,
.avatar-circle,
.tiny-avatar {
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.avatar-pill {
    width: 36px;
    height: 36px;
    font-size: 0.82rem;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    font-size: 0.76rem;
    box-shadow: 0 8px 16px rgba(95, 116, 255, 0.18);
}

.tiny-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
    border: 2px solid white;
    margin-left: -6px;
}

.tiny-avatar:first-child { margin-left: 0; }

.hero {
    width: min(1200px, 100%);
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 24px;
    padding: 48px;
}

.hero-copy h1 { font-size: clamp(2.5rem, 5vw, 4.8rem); line-height: 0.97; margin: 8px 0 16px; }
.hero-copy p { font-size: 1.06rem; color: var(--text-soft); max-width: 60ch; }
.hero-panel { display: grid; gap: 16px; padding: 18px; }
.eyebrow { color: var(--primary); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.stat-card strong { font-size: 1.95rem; }
.stat-card span { color: var(--text-soft); }

.page-card { padding: 24px; margin-bottom: 20px; }
.page-card.narrow { max-width: 760px; }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.hero-card,
.metric-card,
.insight-card,
.action-card,
.onboarding-panel,
.quick-action-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(221, 228, 240, 0.9);
    box-shadow: var(--shadow-md);
    border-radius: 24px;
}

.hero-card,
.metric-card,
.insight-card,
.action-card,
.onboarding-panel,
.activity-item,
.quick-action-card,
.schedule-row,
.action-item {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 24px;
    padding: 28px;
    margin-bottom: 20px;
    background:
        radial-gradient(circle at top right, rgba(0, 194, 255, 0.12), transparent 34%),
        linear-gradient(135deg, rgba(108, 92, 231, 0.14), rgba(255, 255, 255, 0.96) 46%);
}

.hero-card:hover,
.metric-card:hover,
.insight-card:hover,
.action-card:hover,
.onboarding-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-card-copy h2 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.05em;
}

.hero-card-copy p {
    margin: 0 0 18px;
    color: var(--text-soft);
    font-size: 1rem;
    max-width: 56ch;
}

.hero-card-meta,
.hero-card-actions,
.hero-pill-stack {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-meta-pill,
.hero-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(95, 116, 255, 0.1);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-soft);
    box-shadow: var(--shadow-sm);
}

.hero-meta-pill {
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.hero-card-side {
    display: grid;
    gap: 16px;
    align-content: start;
}

.hero-location-form {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(221, 228, 240, 0.8);
    box-shadow: var(--shadow-sm);
}

.hero-location-form label span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.hero-stat-pill {
    display: grid;
    gap: 4px;
    min-width: 140px;
    padding: 14px 16px;
}

.hero-stat-pill strong {
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
}

.hero-stat-pill span {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 600;
}

.onboarding-panel {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
    margin-bottom: 22px;
}

.onboarding-panel-copy strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.onboarding-panel-copy p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.onboarding-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.checklist-item {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #f8faff);
}

.checklist-item:hover {
    transform: translateY(-1px);
    border-color: rgba(95, 116, 255, 0.25);
}

.checklist-item.is-complete {
    border-color: rgba(51, 183, 143, 0.2);
    background: linear-gradient(180deg, rgba(51, 183, 143, 0.1), #ffffff);
}

.checklist-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checklist-item.is-complete .checklist-mark {
    background: rgba(51, 183, 143, 0.12);
    color: var(--success);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.dashboard-section,
.dashboard-span-12,
.dashboard-span-8,
.dashboard-span-7,
.dashboard-span-5,
.dashboard-span-4 {
    min-width: 0;
}

.dashboard-span-12 { grid-column: span 12; }
.dashboard-span-8 { grid-column: span 8; }
.dashboard-span-7 { grid-column: span 7; }
.dashboard-span-5 { grid-column: span 5; }
.dashboard-span-4 { grid-column: span 4; }

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 14px;
    padding: 18px;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: rgba(95, 116, 255, 0.16);
}

.metric-card-primary::before { background: linear-gradient(135deg, #6C5CE7, #8a6eff); }
.metric-card-blue::before { background: linear-gradient(135deg, #00C2FF, #5f74ff); }
.metric-card-warning::before { background: linear-gradient(135deg, #F5A524, #ffcb66); }
.metric-card-danger::before { background: linear-gradient(135deg, #EF4444, #ec5f7a); }
.metric-card-teal::before { background: linear-gradient(135deg, #2f8195, #00C2FF); }

.metric-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--primary-soft);
    color: var(--primary);
}

.metric-card-blue .metric-icon {
    background: rgba(0, 194, 255, 0.12);
    color: var(--accent);
}

.metric-card-warning .metric-icon {
    background: rgba(245, 165, 36, 0.12);
    color: var(--warning);
}

.metric-card-danger .metric-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.metric-card-teal .metric-icon {
    background: rgba(47, 129, 149, 0.12);
    color: var(--teal);
}

.metric-card-copy span,
.metric-card-copy small {
    display: block;
    color: var(--text-soft);
}

.metric-card-copy span {
    font-size: 0.84rem;
    font-weight: 700;
}

.metric-card-copy strong {
    display: block;
    margin: 8px 0 6px;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.metric-card-copy small {
    font-size: 0.8rem;
    line-height: 1.5;
}

.insight-card,
.action-card {
    padding: 22px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.12rem;
    letter-spacing: -0.03em;
}

.card-header p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.87rem;
}

.schedule-table {
    display: grid;
}

.schedule-table-head,
.schedule-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: center;
}

.schedule-table-head {
    padding: 0 12px 10px;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
}

.schedule-row {
    padding: 14px 12px;
    border-top: 1px solid var(--line);
}

.schedule-row:hover {
    background: rgba(95, 116, 255, 0.03);
}

.schedule-employee {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.schedule-employee strong,
.activity-copy strong,
.announcement-card strong {
    display: block;
    letter-spacing: -0.02em;
}

.schedule-employee small {
    color: var(--text-soft);
    font-size: 0.76rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.status-primary { background: rgba(95, 116, 255, 0.12); color: var(--primary); }
.status-success { background: rgba(51, 183, 143, 0.12); color: var(--success); }
.status-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.status-warning { background: rgba(245, 165, 36, 0.14); color: #b9770e; }
.status-neutral { background: rgba(102, 116, 143, 0.1); color: var(--text-soft); }

.action-list,
.activity-feed,
.quick-actions-grid {
    display: grid;
    gap: 12px;
}

.action-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #fafcff);
}

.action-item:hover,
.activity-item:hover,
.quick-action-card:hover {
    transform: translateY(-1px);
    border-color: rgba(95, 116, 255, 0.22);
}

.action-item-copy p {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.5;
}

.action-item-meta {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.action-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    background: var(--surface-muted);
    font-size: 1rem;
    font-weight: 800;
}

.action-item-primary .action-count { background: rgba(108, 92, 231, 0.12); color: var(--primary-2); }
.action-item-teal .action-count { background: rgba(0, 194, 255, 0.12); color: var(--teal); }
.action-item-warning .action-count { background: rgba(245, 165, 36, 0.14); color: #b9770e; }
.action-item-danger .action-count { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.action-item-blue .action-count { background: rgba(95, 116, 255, 0.1); color: var(--primary); }

.labour-summary,
.availability-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.labour-summary div,
.availability-stats div {
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8faff);
    border: 1px solid var(--line);
}

.labour-summary span,
.availability-stats span,
.labour-progress small,
.announcement-meta span,
.activity-copy span,
.availability-day small,
.labour-bar-col small {
    color: var(--text-soft);
}

.labour-summary strong,
.availability-stats strong {
    display: block;
    margin-top: 8px;
    font-size: 1.3rem;
}

.labour-progress {
    margin-top: 16px;
}

.labour-progress-bar {
    height: 12px;
    border-radius: 999px;
    background: var(--surface-strong);
    overflow: hidden;
    margin-bottom: 10px;
}

.labour-progress-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.labour-bars,
.availability-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.labour-bar-col,
.availability-day {
    display: grid;
    justify-items: center;
    gap: 8px;
}

.labour-bar-track,
.availability-bar {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: flex-end;
    padding: 8px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8faff, #eef3fb);
    border: 1px solid var(--line);
}

.labour-bar-track span,
.availability-bar span {
    width: 100%;
    border-radius: 12px;
}

.labour-bar-track span {
    background: linear-gradient(180deg, var(--accent), var(--primary));
}

.availability-bar span {
    background: linear-gradient(180deg, #58d2ff, #18B978);
}

.announcement-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(255, 255, 255, 0.96));
}

.announcement-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.announcement-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-2);
    font-size: 0.76rem;
    font-weight: 800;
}

.announcement-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #fafcff);
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    flex: 0 0 40px;
}

.activity-copy span {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
}

.quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #f8faff);
}

.quick-action-card span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.quick-action-primary { border-color: rgba(108, 92, 231, 0.16); }
.quick-action-blue { border-color: rgba(0, 194, 255, 0.18); }
.quick-action-warning { border-color: rgba(245, 165, 36, 0.18); }
.quick-action-teal { border-color: rgba(47, 129, 149, 0.18); }

.dashboard-empty {
    padding: 26px;
}

.primary-btn,
.ghost-btn,
.soft-btn,
.chip-btn {
    border: none;
    border-radius: 999px;
    transition: 0.2s ease;
}

.primary-btn {
    padding: 11px 18px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 22px rgba(95, 116, 255, 0.22);
}

.ghost-btn,
.soft-btn {
    padding: 11px 16px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
}

.soft-btn {
    background: var(--surface-muted);
}

.chip-btn {
    padding: 9px 14px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.soft-btn:hover,
.chip-btn:hover,
.icon-btn:hover,
.template-card:hover,
.scheduler-cell:hover {
    transform: translateY(-1px);
}

.icon-btn {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    box-shadow: var(--shadow-sm);
}

.toolbar,
.toolbar-actions,
.stack-form,
.grid-form {
    display: flex;
    gap: 12px;
}

.stack-form,
.grid-form {
    display: grid;
    gap: 14px;
}

.grid-form.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label {
    display: grid;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--surface);
    color: var(--text);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(95, 116, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(95, 116, 255, 0.1);
}

textarea { resize: vertical; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.flash.success {
    background: rgba(51, 183, 143, 0.12);
    color: #0f766e;
    border-color: rgba(51, 183, 143, 0.18);
}

.flash.error {
    background: rgba(236, 95, 122, 0.1);
    color: #b42340;
    border-color: rgba(236, 95, 122, 0.16);
}

.hidden { display: none !important; }

.empty-state {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--text-soft);
    background: var(--surface-muted);
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.list-row:last-child { border-bottom: 0; }
.list-row span { color: var(--text-soft); display: block; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); }
.table th { color: var(--text-soft); font-weight: 600; }

.auth-links { display: flex; justify-content: space-between; gap: 14px; margin-top: 16px; }
.modal { border: none; background: transparent; padding: 0; }
.modal::backdrop { background: rgba(12, 19, 35, 0.5); }
.modal-card { width: min(560px, calc(100vw - 32px)); padding: 24px; }

.rota-page {
    width: 100%;
    max-width: none;
}

.scheduler-card {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
    padding: 18px;
}

.scheduler-left {
    min-width: 0;
    display: grid;
    gap: 14px;
    overflow-x: auto;
}

.template-panel {
    width: 320px;
    position: sticky;
    top: 24px;
    align-self: start;
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfcff, #f7f9fd);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), var(--shadow-sm);
}

.scheduler-titlebar,
.scheduler-controls,
.scheduler-subcontrols {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.scheduler-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scheduler-heading-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--primary);
    background: var(--primary-soft);
}

.scheduler-heading h2 {
    margin: 0;
    font-size: 1.22rem;
    letter-spacing: -0.02em;
}

.scheduler-heading p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.scheduler-meta,
.permission-stack,
.scheduler-actions,
.scheduler-pills,
.scheduler-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.permission-stack span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

.pill-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 600;
}

.pill-link.active {
    color: var(--primary);
    border-color: rgba(95, 116, 255, 0.2);
    background: rgba(95, 116, 255, 0.08);
}

.date-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}

.scheduler-grid-shell {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #f9fbff);
    overflow: hidden;
    min-width: 0;
    width: 100%;
}

.scheduler-tools {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 255, 0.9);
}

.scheduler-inline-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text-soft);
}

.scheduler-inline-search input {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.scheduler-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.subtle-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 600;
}

.scheduler-grid {
    overflow: auto;
    padding: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 255, 0.92));
    min-width: 0;
}

.scheduler-grid-inner {
    min-width: 980px;
    display: grid;
    grid-template-columns: 228px repeat(7, minmax(120px, 1fr));
    gap: 6px;
}

.rota-grid {
    min-width: 1100px;
}

.scheduler-grid-top,
.employee-summary,
.scheduler-cell {
    border-radius: 16px;
    border: 1px solid var(--line);
    background: white;
}

.scheduler-grid-top {
    min-height: 78px;
    padding: 12px;
    display: grid;
    align-content: center;
    gap: 5px;
    box-shadow: inset 0 -1px 0 rgba(221, 228, 240, 0.4);
}

.scheduler-grid-top strong { font-size: 0.94rem; }
.scheduler-grid-top span { color: var(--text-soft); font-size: 0.78rem; }

.employee-summary {
    position: sticky;
    left: 0;
    z-index: 2;
    min-height: 104px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff, #fafcff);
    box-shadow: 8px 0 18px rgba(22, 33, 61, 0.03);
}

.employee-meta {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.employee-meta strong {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-meta span,
.employee-meta small {
    color: var(--text-soft);
    font-size: 0.76rem;
}

.scheduler-cell {
    min-height: 104px;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 253, 0.95));
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.scheduler-cell:hover {
    border-color: rgba(95, 116, 255, 0.24);
    background: linear-gradient(180deg, rgba(95, 116, 255, 0.03), rgba(138, 110, 255, 0.02));
}

.scheduler-cell.drag-over,
.template-panel.drag-over {
    border-color: rgba(95, 116, 255, 0.45);
    box-shadow: inset 0 0 0 2px rgba(95, 116, 255, 0.14);
}

.empty-cell-action {
    align-self: center;
    justify-self: center;
    color: #9aa7bf;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(245, 247, 252, 0.9);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.scheduler-cell:hover .empty-cell-action { opacity: 1; }

.employee-summary.is-muted,
.scheduler-cell.is-muted {
    opacity: 0.28;
}

.shift-card {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border-radius: 14px;
    background: white;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.shift-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.shift-card:hover { box-shadow: 0 12px 24px rgba(22, 33, 61, 0.1); }
.shift-card strong { font-size: 0.82rem; line-height: 1.15; }
.shift-card span,
.shift-card small { color: var(--text-soft); font-size: 0.72rem; line-height: 1.2; }

.shift-card[data-color="blue"] { border-left-color: var(--primary); }
.shift-card[data-color="teal"] { border-left-color: var(--teal); }
.shift-card[data-color="gold"] { border-left-color: var(--warning); }
.shift-card[data-color="rose"] { border-left-color: var(--danger); }
.shift-card[data-color="green"] { border-left-color: var(--olive); }

.scheduler-daily {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
}

.day-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.day-tab {
    border: 1px solid var(--line);
    background: white;
    border-radius: 999px;
    padding: 9px 14px;
    color: var(--text-soft);
}

.day-tab.active {
    background: linear-gradient(135deg, rgba(95, 116, 255, 0.12), rgba(138, 110, 255, 0.08));
    border-color: rgba(95, 116, 255, 0.2);
    color: var(--primary);
}

.daily-list { display: grid; gap: 12px; }
.daily-item {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
}

.template-panel-header,
.template-panel-footer,
.template-tabs,
.template-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.template-panel-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.template-panel-header h3 {
    margin: 0;
    font-size: 1rem;
}

.template-panel-header p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.template-tabs {
    padding: 4px;
    border-radius: 999px;
    background: var(--surface-strong);
}

.template-tab {
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-weight: 600;
}

.template-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.template-panel-content {
    display: grid;
    gap: 10px;
}

.template-toolbar {
    flex-direction: column;
    align-items: stretch;
}

.template-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text-soft);
}

.template-search input {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.template-stack {
    display: grid;
    gap: 10px;
}

.template-card {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    border-left: 4px solid var(--primary);
    background: white;
    box-shadow: var(--shadow-sm);
    cursor: grab;
}

.template-card strong { font-size: 0.87rem; }
.template-card span { color: var(--text-soft); font-size: 0.77rem; }

.template-card[data-template-color="gold"] { border-left-color: var(--warning); }
.template-card[data-template-color="teal"] { border-left-color: var(--teal); }
.template-card[data-template-color="blue"] { border-left-color: var(--primary); }
.template-card[data-template-color="rose"] { border-left-color: var(--danger); }
.template-card[data-template-color="green"] { border-left-color: var(--olive); }

.template-panel-footer {
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.template-panel-footer .primary-btn {
    width: 100%;
    justify-content: center;
}

.scheduler-drawer-toggle {
    display: none;
}

@media (max-width: 1024px) {
    .scheduler-card {
        grid-template-columns: 1fr;
    }

    .template-panel {
        position: static;
        width: auto;
        margin-top: 18px;
    }
}

@media (max-width: 1080px) {
    :root { --sidebar-width: 88px; }
    .stats-grid, .two-up, .hero, .scheduler-daily { grid-template-columns: 1fr; }
    .search-shell { min-width: 220px; }
    .scheduler-card { grid-template-columns: 1fr; }
    .template-panel { position: static; margin-top: 18px; }
    .hero-card,
    .onboarding-panel,
    .dashboard-metrics,
    .labour-summary,
    .availability-stats,
    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-span-12,
    .dashboard-span-8,
    .dashboard-span-7,
    .dashboard-span-5,
    .dashboard-span-4 {
        grid-column: span 2;
    }
    .schedule-table-head,
    .schedule-row {
        grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
    }

    body.sidebar-open .sidebar,
    html.sidebar-open body .sidebar { transform: translateX(0); }
    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 16px;
    }
    .topbar { flex-direction: column; align-items: stretch; }
    .topbar-left, .topbar-right { width: 100%; justify-content: space-between; }
    .search-shell { min-width: 0; flex: 1; }
    .nav-icons a { flex-direction: row; justify-content: flex-start; padding-inline: 14px; }
    .nav-icons a span {
        display: inline;
        font-size: 0.78rem;
    }
    .nav-icons a::after {
        display: none;
    }
    .sidebar { width: 280px; align-items: stretch; padding: 20px; }
    .brand-compact { flex-direction: row; text-align: left; }
    .brand-copy { display: block; }
    .sidebar-logout {
        display: flex;
        justify-content: center;
        gap: 8px;
        min-height: auto;
        padding: 10px 14px;
    }
    .sidebar-logout span { display: inline; }
    .template-panel {
        position: fixed;
        right: 12px;
        bottom: 12px;
        top: auto;
        width: min(360px, calc(100vw - 24px));
        max-height: calc(100vh - 24px);
        z-index: 30;
        overflow: auto;
        transform: translateY(calc(100% + 20px));
        transition: transform 0.22s ease;
    }
    body.template-panel-open .template-panel,
    html.template-panel-open body .template-panel { transform: translateY(0); }
    .scheduler-drawer-toggle {
        display: inline-flex;
    }
    .hero-card,
    .onboarding-panel,
    .dashboard-metrics,
    .labour-summary,
    .availability-stats,
    .quick-actions-grid,
    .dashboard-grid,
    .onboarding-list {
        grid-template-columns: 1fr;
    }
    .dashboard-span-12,
    .dashboard-span-8,
    .dashboard-span-7,
    .dashboard-span-5,
    .dashboard-span-4 {
        grid-column: span 1;
    }
}

@media (max-width: 720px) {
    .auth-card, .page-card, .hero, .modal-card, .scheduler-card { padding: 20px; }
    .grid-form.two-col, .split, .scheduler-tools { grid-template-columns: 1fr; }
    .scheduler-grid-inner { grid-template-columns: 220px repeat(7, minmax(130px, 1fr)); }
    .scheduler-titlebar, .scheduler-controls, .scheduler-subcontrols { align-items: stretch; }
    .scheduler-actions, .scheduler-meta, .scheduler-range { width: 100%; }
    .topbar-right { flex-wrap: wrap; justify-content: flex-start; }
    .hero-card,
    .insight-card,
    .action-card,
    .onboarding-panel {
        padding: 20px;
    }
    .schedule-table-head {
        display: none;
    }
    .schedule-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .action-item {
        grid-template-columns: 1fr;
    }
    .action-item-meta {
        justify-items: start;
    }
    .labour-bars,
    .availability-bars {
        gap: 8px;
    }
}
