/* =====================================================================
   ArgiHR theme — clean, light admin layout.
   Brand tokens live in :root so a rebrand is a one-place change.
   ===================================================================== */
:root {
    --brand: #4f5bd5;
    --brand-hover: #4350c4;
    --brand-soft: #eef0fc;
    --ink: #2b3245;
    --body: #545a6d;
    --muted: #8a90a2;
    --page-bg: #f5f6f8;
    --card-bg: #ffffff;
    --border: #e9eaef;
    --sidebar-w: 250px;
    --sidebar-w-collapsed: 72px;
    --topbar-h: 70px;
    --radius: 8px;

    --ok: #2ab57d;       --ok-soft: #e3f6ee;
    --warn: #e8a33b;     --warn-soft: #fdf3e2;
    --danger: #fd625e;   --danger-soft: #ffeceb;
    --info: #4ba6ef;     --info-soft: #e6f2fd;
    --off: #8a90a2;      --off-soft: #eff0f3;

    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-color: var(--body);
    --bs-body-font-size: .875rem;
    --bs-link-color-rgb: 79, 91, 213;
    --bs-link-hover-color-rgb: 67, 80, 196;
    --bs-border-color: var(--border);
}

body { background: var(--page-bg); }
h1, h2, h3, h4, h5, h6, .fw-semibold { color: var(--ink); }

/* ---------- Buttons & form controls ---------- */
.btn { font-size: .875rem; border-radius: 6px; padding: .45rem .9rem; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover);
    --bs-btn-active-bg: var(--brand-hover); --bs-btn-active-border-color: var(--brand-hover);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 2px 6px -1px rgba(79, 91, 213, .45);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-hover);
}
.btn-soft { background: var(--brand-soft); color: var(--brand); border: 0; }
.btn-soft:hover, .btn-soft.active { background: var(--brand); color: #fff; }
.btn-light { background: #f3f4f7; border-color: #f3f4f7; color: var(--ink); }
.btn-outline-secondary { --bs-btn-color: var(--body); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: #f3f4f7; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--border); --bs-btn-active-bg: var(--brand-soft); --bs-btn-active-color: var(--brand); --bs-btn-active-border-color: var(--brand-soft); }

.form-control, .form-select { font-size: .875rem; border-color: var(--border); border-radius: 6px; padding: .5rem .8rem; }
.form-select { padding-right: 2.25rem; }
.btn-link { text-decoration: none; }
.data-table a { text-decoration: none; }
.data-table a:hover { color: var(--brand) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #b9bff0; box-shadow: none; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; color: var(--ink); margin-bottom: .35rem; }

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

.app-sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--card-bg); border-right: 1px solid var(--border);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column;
    transition: width .2s ease;
}
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; min-width: 0; }
.brand-mark {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .9rem;
    background: var(--brand);
    box-shadow: 4px 4px 0 -1px #c9cdf5;
}
.brand-name { color: var(--ink); font-weight: 600; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-toggle { border: 0; background: none; color: var(--body); font-size: 1.35rem; padding: 0; line-height: 1; }

.side-nav { flex: 1; padding: .5rem 0 1.5rem; }
.side-group { font-size: .8rem; font-weight: 500; color: var(--ink); padding: 1.1rem 1.5rem .5rem; }
.side-link {
    display: flex; align-items: center; gap: .85rem;
    padding: .62rem 1.5rem; color: var(--body); text-decoration: none; font-size: .9rem; font-weight: 500;
    position: relative;
}
.side-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; color: #7b8190; }
.side-link:hover, .side-link:hover i { color: var(--brand); }
.side-link.active, .side-link.active i { color: var(--brand); }
.soon-dot { margin-left: auto; font-size: .65rem; font-weight: 600; color: var(--muted); background: #f1f2f5; border-radius: 4px; padding: .05rem .35rem; }
.side-footer { font-size: .72rem; color: var(--muted); padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

/* Collapsed sidebar (desktop) */
@media (min-width: 992px) {
    .sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
    .sidebar-collapsed .brand-name, .sidebar-collapsed .side-link span,
    .sidebar-collapsed .side-group, .sidebar-collapsed .side-footer, .sidebar-collapsed .soon-dot { display: none; }
    .sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
    .sidebar-collapsed .sidebar-brand .brand { display: none; }
    .sidebar-collapsed .side-link { justify-content: center; padding: .75rem 0; }
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
    height: var(--topbar-h); display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem; background: var(--card-bg); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.topbar-search { display: flex; width: 280px; max-width: 45vw; }
.topbar-search input { background: #f3f4f7; border: 0; border-radius: 6px 0 0 6px; }
.topbar-search input:focus { background: #f3f4f7; }
.topbar-search button { border-radius: 0 6px 6px 0; padding: .4rem .75rem; box-shadow: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .35rem; height: 100%; }
.topbar-context { font-size: .8rem; color: var(--muted); }
.icon-btn { border: 0; background: none; font-size: 1.2rem; color: var(--body); width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; }
.icon-btn:hover { background: #f3f4f7; color: var(--ink); }
.user-menu {
    display: flex; align-items: center; gap: .6rem; height: 100%;
    padding: 0 1rem; margin-right: -1.5rem; background: #f9f9fb; border: 0; border-left: 1px solid var(--border);
}
.user-menu .avatar { width: 36px; height: 36px; }
.user-menu-name { font-weight: 500; color: var(--ink); }

.app-content { padding: 1.5rem; width: 100%; max-width: 1480px; }

.title-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.title-bar h1 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.breadcrumb-lite { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--ink); margin: 0; padding: 0; list-style: none; }
.breadcrumb-lite a { color: var(--ink); text-decoration: none; }
.breadcrumb-lite .current { color: var(--muted); }
.breadcrumb-lite i { font-size: .7rem; color: var(--muted); }

@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; left: 0; top: 0; z-index: 1040; transform: translateX(-100%); transition: transform .2s; box-shadow: none; }
    .sidebar-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.15); }
    .app-content { padding: 1rem; }
    .app-topbar { padding: 0 1rem; }
    .user-menu { margin-right: -1rem; }
    .user-menu-name { display: none; }
}

/* ---------- Cards ---------- */
.panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: .95rem; font-weight: 600; margin: 0; }
.panel-body { padding: 1.25rem; }
.panel-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; }
.panel-pad { padding: 1.25rem; }

/* Section header inside a page (e.g. "Employees (10)" + Add) */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-title { font-size: 1rem; font-weight: 600; margin: 0; }
.page-title .count { color: var(--muted); font-weight: 400; margin-left: .25rem; }
.page-subtitle { color: var(--muted); margin: .2rem 0 0; font-size: .85rem; }
.page-actions { display: flex; align-items: center; gap: .5rem; }

.crumbs { display: none; } /* breadcrumb now lives in the title bar */

/* Stat cards */
.stat { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; height: 100%; display: flex; flex-direction: column; gap: .2rem; }
.stat-head { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-label { color: var(--body); font-size: .9rem; }
.stat-icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 1.15rem; background: var(--brand-soft); color: var(--brand); }
.stat-value { font-size: 1.6rem; font-weight: 600; color: var(--ink); line-height: 1.25; margin: .35rem 0 .6rem; }
.stat-foot { display: flex; align-items: center; gap: .5rem; font-size: .825rem; color: var(--muted); margin-top: auto; }
.stat-foot a { text-decoration: none; font-weight: 500; }

.soft-badge { display: inline-block; font-size: .72rem; font-weight: 600; border-radius: 4px; padding: .15rem .4rem; }
.soft-ok { background: var(--ok-soft); color: var(--ok); }
.soft-warn { background: var(--warn-soft); color: #c27c13; }
.soft-danger { background: var(--danger-soft); color: var(--danger); }
.soft-info { background: var(--info-soft); color: #2b86cf; }
.soft-brand { background: var(--brand-soft); color: var(--brand); }
.soft-off { background: var(--off-soft); color: var(--off); }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 1.75rem 0 1rem; }
.section-title h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.link-strong { font-weight: 500; text-decoration: none; font-size: .875rem; }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.welcome h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.welcome p { margin: .15rem 0 0; color: var(--muted); }

/* Status badges */
.status-badge { display: inline-block; font-size: .75rem; font-weight: 500; border-radius: 4px; padding: .2rem .5rem; white-space: nowrap; }
.status-active { background: var(--ok-soft); color: var(--ok); }
.status-active-solid { background: var(--brand-soft); color: var(--brand); }
.status-leave { background: var(--warn-soft); color: #c27c13; }
.status-off { background: var(--off-soft); color: var(--off); }

/* Avatars */
.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: .75rem; font-weight: 600; }
.avatar-md { width: 44px; height: 44px; font-size: .85rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-xl { width: 84px; height: 84px; font-size: 1.5rem; border: 4px solid #f3f4f7; }
.avatar-dark { background: var(--brand-soft); color: var(--brand); }
.avatar.tone-1 { background: #e3f6ee; color: #1f9567; }
.avatar.tone-2 { background: #fdf3e2; color: #b7740f; }
.avatar.tone-3 { background: #e6f2fd; color: #2b86cf; }
.avatar.tone-4 { background: #ffeceb; color: #d9443f; }
.avatar.tone-5 { background: #f1ebfd; color: #7a4fd6; }

/* Tabs */
.tabs-underline { border-bottom: 1px solid var(--border); gap: .25rem; }
.tabs-underline .nav-link { color: var(--body); border-bottom: 2px solid transparent; border-radius: 0; padding: .6rem 1rem; margin-bottom: -1px; font-weight: 500; }
.tabs-underline .nav-link:hover { color: var(--ink); }
.tabs-underline .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Filter pills */
.pill-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { font-size: .8rem; font-weight: 500; text-decoration: none; padding: .3rem .7rem; border-radius: 999px; background: #f1f2f5; color: var(--body); }
.pill .n { color: var(--muted); margin-left: .25rem; }
.pill:hover { color: var(--ink); }
.pill.active { background: var(--brand-soft); color: var(--brand); }
.pill.active .n { color: var(--brand); }

/* Search with icon */
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .form-control { padding-left: 2.2rem; }

/* View toggle (grid / list) */
.view-toggle { display: inline-flex; gap: .25rem; }
.view-toggle a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; color: var(--body); text-decoration: none; }
.view-toggle a:hover { background: #f1f2f5; }
.view-toggle a.active { background: var(--brand); color: #fff; }

/* People grid */
.person-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); height: 100%; display: flex; flex-direction: column; }
.person-card-body { padding: 1.75rem 1rem 1.25rem; text-align: center; position: relative; flex: 1; }
.person-card-body .status-badge { position: absolute; top: .9rem; right: .9rem; }
.person-card h3 { font-size: .975rem; font-weight: 600; margin: .9rem 0 .2rem; }
.person-card .role { color: var(--muted); font-size: .85rem; }
.person-card .dept { margin-top: .5rem; }
.person-card-actions { display: flex; border-top: 1px solid var(--border); }
.person-card-actions a { flex: 1; text-align: center; padding: .7rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.person-card-actions a + a { border-left: 1px solid var(--border); }
.person-card-actions a:hover { background: #f9f9fb; color: var(--brand); }
.chip { background: #f1f2f5; color: var(--body); border-radius: 4px; padding: .1rem .5rem; font-size: .75rem; font-weight: 500; }

/* Tables */
.data-table { --bs-table-bg: transparent; margin: 0; }
.data-table thead th { background: #f8f9fa; color: var(--ink); font-weight: 600; font-size: .825rem; border-bottom: 1px solid var(--border); padding: .75rem 1rem; white-space: nowrap; }
.data-table td { padding: .75rem 1rem; border-color: var(--border); }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table-plain thead th { background: #f8f9fa; }
.table-card { overflow: hidden; }

.person { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.person:hover .fw-medium, .person:hover .person-name { color: var(--brand); }
.person-name { font-weight: 600; color: var(--ink); }

.icon-action { border: 0; background: none; color: var(--body); font-size: 1rem; padding: .3rem .45rem; border-radius: 6px; text-decoration: none; display: inline-block; }
.icon-action:hover { background: #f1f2f5; color: var(--brand); }
.row-archived td { opacity: .55; }
.assigned-cell { font-size: .825rem; color: var(--body); max-width: 420px; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.toolbar-title { font-size: .95rem; font-weight: 600; margin: 0 auto 0 0; }
.toolbar-search { width: 260px; min-width: 0; }
.toolbar-search-sm { width: 200px; min-width: 0; }
@media (max-width: 767.98px) { .toolbar-search, .toolbar-search-sm { width: 100%; } }

/* Lists */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li + li { border-top: 1px solid var(--border); }
.list-plain .person { padding: .7rem 1.25rem; }

/* Details */
.profile-header { display: flex; align-items: center; gap: 1.1rem; padding: 1.25rem; flex-wrap: wrap; }
.detail-list dt { color: var(--muted); font-weight: 400; }
.form-narrow { max-width: 900px; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

.empty-state { text-align: center; padding: 3rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.empty-state > i { font-size: 2.2rem; color: #c3c7d2; }

/* Modals */
.modal-lg-narrow { max-width: 620px; }
.modal-content { border: 0; border-radius: var(--radius); }
.modal-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); }

/* Org chart */
.org-wrap { overflow-x: auto; padding: 2rem 1rem; }
.org-tree, .org-tree ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; }
.org-tree ul { padding-top: 1.5rem; position: relative; }
.org-tree li { position: relative; padding: 1.5rem .5rem 0; display: flex; flex-direction: column; align-items: center; }
.org-tree > li { padding-top: 0; }
.org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 1.5rem; border-top: 1px solid #d5d8e0; }
.org-tree li::before { right: 50%; }
.org-tree li::after { left: 50%; border-left: 1px solid #d5d8e0; }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0; }
.org-tree li:last-child::before { border-right: 1px solid #d5d8e0; border-radius: 0 6px 0 0; }
.org-tree li:first-child::after { border-radius: 6px 0 0 0; }
.org-tree > li::before, .org-tree > li::after { display: none; }
.org-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 1.5rem; border-left: 1px solid #d5d8e0; }
.org-card { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .9rem; min-width: 200px; }
.org-card:hover { border-color: var(--brand); }
.org-count { color: var(--brand); font-size: .72rem; }

/* Assign list */
.assign-row { display: flex; align-items: center; gap: .8rem; padding: .65rem 1.25rem; cursor: pointer; margin: 0; }
.assign-row:hover { background: #fafbfc; }
.assign-list { max-height: 60vh; overflow-y: auto; }

/* ---------- Auth (split screen) ---------- */
.auth-body { background: var(--card-bg); }
.auth-wrap { display: flex; min-height: 100vh; }
.auth-panel { width: 100%; max-width: 500px; display: flex; flex-direction: column; padding: 2.5rem 3.5rem; }
.auth-panel .brand { justify-content: center; margin-bottom: auto; }
.auth-form { margin: 3rem 0; }
.auth-form h1 { font-size: 1.2rem; font-weight: 600; text-align: center; margin-bottom: .35rem; }
.auth-form .lead-muted { text-align: center; color: var(--body); margin-bottom: 2rem; }
.auth-form .form-control { background: #f8f9fa; padding: .65rem .9rem; }
.auth-form .btn-primary { padding: .65rem; }
.pw-toggle { border: 1px solid var(--border); border-left: 0; background: #f3f4f7; color: var(--body); border-radius: 0 6px 6px 0; padding: 0 .9rem; }
.auth-footer { text-align: center; color: var(--body); margin-top: auto; font-size: .825rem; }
.auth-aside {
    flex: 1; position: relative; overflow: hidden;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center; padding: 4rem;
}
.auth-aside .shape { position: absolute; border-radius: 28%; background: rgba(255,255,255,.08); transform: rotate(25deg); }
.auth-aside .s1 { width: 320px; height: 320px; top: -80px; right: -60px; }
.auth-aside .s2 { width: 180px; height: 180px; bottom: 60px; left: 8%; }
.auth-aside .s3 { width: 90px; height: 90px; top: 30%; left: 18%; border-radius: 50%; }
.auth-aside .s4 { width: 140px; height: 140px; bottom: -40px; right: 20%; }
.auth-pitch { position: relative; max-width: 560px; }
.auth-pitch h2 { color: #fff; font-size: 1.75rem; font-weight: 600; line-height: 1.35; }
.auth-pitch p { color: rgba(255,255,255,.8); font-size: 1rem; margin: 1rem 0 1.75rem; }
.auth-pitch li { display: flex; align-items: center; gap: .65rem; padding: .4rem 0; color: rgba(255,255,255,.92); }
.auth-pitch li i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.15); }
.demo-logins { background: #f8f9fa; border: 1px dashed var(--border); border-radius: var(--radius); padding: .75rem .9rem; }
.demo-logins .table { --bs-table-bg: transparent; margin: 0; }
.demo-logins td { padding: .15rem .25rem; }
.demo-logins button { border: 0; background: none; padding: 0; color: var(--brand); font-size: inherit; }
@media (max-width: 991.98px) { .auth-panel { max-width: none; padding: 2rem 1.5rem; } }

/* ---------- Leave calendar ---------- */
.cal-legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--body); margin-right: .5rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.dot-approved { background: var(--ok); }
.dot-pending { background: var(--warn); }
.dot-holiday { background: var(--info); }
.dot-shutdown { background: #9b87e8; }
.dot-draft { background: #c3c7d2; }
.dot-cancelled { background: var(--danger); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: .6rem .75rem; font-size: .8rem; font-weight: 600; color: var(--ink); background: #f8f9fa; border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 112px; padding: .5rem .55rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.weekend { background: #fbfbfc; }
.cal-cell.out .cal-date span:first-child { color: #c3c7d2; }
.cal-cell.today { background: var(--brand-soft); }
.cal-date { display: flex; justify-content: space-between; align-items: center; font-weight: 500; color: var(--ink); font-size: .85rem; }
.cal-event { font-size: .72rem; font-weight: 500; border-radius: 4px; padding: .15rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; }
.ev-approved { background: var(--ok-soft); color: #1f8a5f; border-color: var(--ok); }
.ev-pending { background: var(--warn-soft); color: #a8690c; border-color: var(--warn); }
.ev-holiday { background: var(--info-soft); color: #236fae; border-color: var(--info); }
.ev-shutdown { background: #f1edfc; color: #6a55c7; border-color: #9b87e8; }
.cal-more { font-size: .72rem; color: var(--muted); padding-left: .2rem; }

/* ---------- Leave settings ---------- */
.toggle-pill { border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: .75rem; font-weight: 600; border-radius: 999px; padding: .15rem .65rem; }
.toggle-pill.on { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); }
.toggle-pill:hover { border-color: var(--brand); }
.add-row { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: #fbfbfc; border-radius: 0 0 var(--radius) var(--radius); }
.add-row .form-check { margin-bottom: .55rem; }
.stat-highlight { border-color: var(--brand); background: var(--brand-soft); }
.stat-highlight .stat-value { color: var(--brand); }
.stat-sm { padding: .9rem 1rem; }
.stat-sm .stat-value { font-size: 1.3rem; margin: .15rem 0 0; }

/* ---------- Rota ---------- */
.rota-wrap { overflow-x: auto; }
.rota-table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.rota-table th, .rota-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); vertical-align: top; padding: .55rem; }
.rota-table th:last-child, .rota-table td:last-child { border-right: 0; }
.rota-table thead th { background: #f8f9fa; text-align: center; font-weight: 600; color: var(--ink); font-size: .85rem; }
.rota-table thead th small { font-weight: 400; color: var(--muted); }
.rota-table th.today, .rota-table td.today { background: var(--brand-soft); }
.rota-table tbody tr:last-child td { border-bottom: 0; }
.rota-emp { width: 220px; text-align: left !important; background: #fff; position: sticky; left: 0; z-index: 1; }
thead .rota-emp { background: #f8f9fa; }
.shift-chip { display: block; width: 100%; text-align: left; border-radius: 6px; padding: .35rem .5rem; margin-bottom: .35rem; font-size: .78rem; border: 1px solid transparent; line-height: 1.3; }
.shift-chip .shift-time { display: block; font-weight: 600; }
.shift-chip .shift-meta { display: block; font-size: .72rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-published { background: var(--brand-soft); color: var(--brand); border-color: #dfe2fa; }
.shift-draft { background: #fff; color: var(--body); border: 1px dashed #b9bdc9; }
.shift-cancelled { background: #f6f6f8; color: var(--muted); text-decoration: line-through; }
.shift-chip:hover { border-color: var(--brand); }
.shift-add { display: block; width: 100%; border: 1px dashed transparent; background: none; color: transparent; border-radius: 6px; padding: .2rem; font-size: 1rem; line-height: 1; }
.rota-table td:hover .shift-add { border-color: #c9cdf5; color: var(--brand); }
.my-shift-day { display: flex; gap: 1.25rem; padding: .85rem 1.25rem; align-items: flex-start; }
.my-shift-day.today { background: var(--brand-soft); }
.my-shift-date { width: 70px; display: flex; flex-direction: column; color: var(--muted); font-size: .85rem; }
.my-shift-date strong { color: var(--ink); }

/* ---------- Settings: logo ---------- */
.logo-box { width: 96px; height: 96px; border: 1px dashed #c9ccd6; border-radius: var(--radius); display: grid; place-items: center; background: #fbfbfc; overflow: hidden; }
.logo-box i { font-size: 1.8rem; color: #b5b9c6; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; flex-shrink: 0; }

/* ---------- Templates ---------- */
.template-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; flex-wrap: wrap; }
.template-editor { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; line-height: 1.6; }
.placeholder-list { max-height: 560px; overflow-y: auto; }
.placeholder-btn { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; padding: .55rem 1.25rem; text-align: left; }
.placeholder-btn:hover { background: var(--brand-soft); }
.placeholder-btn code { color: var(--brand); font-size: .8rem; }
.placeholder-btn small { color: var(--muted); }
.doc-sheet { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); max-width: 820px; margin: 0 auto; padding: 3.5rem 4rem; color: #1f2430; font-size: .95rem; line-height: 1.7; }
.doc-sheet p { margin-bottom: 1rem; }
.doc-sheet mark { background: #fff1c2; padding: 0 .15rem; }
.doc-head { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; margin-bottom: 2rem; border-bottom: 2px solid var(--ink); font-weight: 600; font-size: 1.05rem; }
.doc-head img { height: 40px; }
@media print {
    .app-sidebar, .app-topbar, .title-bar, .no-print, .alert { display: none !important; }
    body, .app-content { background: #fff !important; padding: 0 !important; }
    .doc-sheet { border: 0; padding: 0; max-width: none; }
}

/* ---------- Onboarding ---------- */
.checklist-card { display: block; padding: 1.25rem; color: inherit; text-decoration: none; height: 100%; }
.checklist-card:hover { border-color: var(--brand); }
.progress-thin { height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden; }
.progress-thin > div { height: 100%; background: var(--brand); border-radius: 3px; }
.task-row { display: flex; align-items: center; gap: .9rem; padding: .75rem 1.25rem; }
.task-row form { margin: 0; }
.task-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #c3c7d2; background: #fff; display: grid; place-items: center; color: #fff; font-size: .8rem; padding: 0; flex-shrink: 0; }
.task-check:hover { border-color: var(--brand); }
.task-check.checked { background: var(--ok); border-color: var(--ok); }
.task-check.disabled { opacity: .6; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { font-weight: 500; color: var(--ink); }

/* ---------- Timesheets ---------- */
.ts-table td { vertical-align: top; }
.ts-table tr:not(.day-end) td:not(.ts-day) { border-bottom-color: transparent; }
.ts-table tr.today td { background: #f7f8fe; }
.ts-day { border-right: 1px solid var(--border); }
.ts-planned { display: inline-block; margin-top: .3rem; font-size: .75rem; background: #f1f2f5; border-radius: 4px; padding: .1rem .45rem; color: var(--body); }
.ts-table tfoot th { background: #f8f9fa; border-top: 1px solid var(--border); }
.stat-link { text-decoration: none; color: inherit; }
.stat-link:hover { border-color: var(--brand); }
.ex-count { padding: .75rem 1.25rem; border-right: 1px solid var(--border); }
.ex-count:last-child { border-right: 0; }

/* ---------- Compliance ---------- */
.dot-brand { background: var(--brand); }
.soft-missing { background: #fff; color: var(--danger); border: 1px dashed #f6b3b1; }
.stat-sm.stat-link { color: inherit; text-decoration: none; transition: border-color .15s; }
.stat-sm.stat-link:hover { border-color: var(--brand); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mini-stats > div { border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .85rem; background: #fbfbfc; }
.mini-stats span { display: block; font-size: .75rem; color: var(--muted); }
.mini-stats strong { display: block; font-size: 1rem; font-weight: 600; color: var(--ink); margin-top: .1rem; }
.check-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.check-chip { border: 1px solid var(--border); background: #fff; color: var(--body); font-size: .8rem; font-weight: 500; border-radius: 999px; padding: .3rem .8rem; cursor: pointer; user-select: none; }
.check-chip:hover { border-color: var(--brand); }
.btn-check:checked + .check-chip { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.btn-check:focus-visible + .check-chip { outline: 2px solid var(--brand); outline-offset: 2px; }
.secure-note { display: flex; gap: .6rem; align-items: flex-start; background: var(--ok-soft); color: #1d7f58; border-radius: var(--radius); padding: .65rem .85rem; font-size: .8rem; }
.secure-note i { font-size: 1rem; line-height: 1.2; }
.data-table .soft-badge, .data-table .status-badge { white-space: nowrap; }

/* ---------- Platform admin ---------- */
.support-banner, .plan-banner { display: flex; align-items: center; gap: .65rem; padding: .6rem 1.5rem; font-size: .85rem; }
.support-banner { background: #2b3245; color: #fff; }
.support-banner i { color: #ffc35a; font-size: 1.05rem; }
.plan-banner { background: var(--brand-soft); color: var(--ink); border-bottom: 1px solid var(--border); }
.plan-banner i { color: var(--brand); }
.plan-banner-warn { background: var(--warn-soft); }
.plan-banner-warn i { color: #c27c13; }
.plan-banner a { font-weight: 600; white-space: nowrap; text-decoration: none; }
.auth-single { justify-content: center; background: var(--page-bg); }
.auth-single .auth-panel { background: #fff; max-width: 460px; min-height: 100vh; box-shadow: 0 0 0 1px var(--border); }
.onhold-icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: #c27c13; font-size: 1.8rem; }
.status-trial { background: var(--info-soft); color: #2b86cf; }
.status-pastdue { background: var(--warn-soft); color: #c27c13; }
.status-suspended { background: var(--danger-soft); color: var(--danger); }
.status-cancelled { background: var(--off-soft); color: var(--off); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .45rem 1rem; margin: 0; font-size: .875rem; }
.kv dt { color: var(--muted); font-weight: 400; }
.kv dd { margin: 0; color: var(--ink); }
.lifecycle-actions { display: grid; gap: .6rem; }
.lifecycle-actions form { display: flex; gap: .5rem; align-items: center; }

/* ---------- Audit log, plans, modules ---------- */
.audit-summary { min-width: 260px; }
.audit-details > td { background: #fafbfc; padding: .75rem 1.25rem 1rem; }
.audit-changes { max-width: 760px; font-size: .82rem; background: transparent; }
.audit-changes th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.audit-changes td { word-break: break-word; }
.audit-filters .form-control[type=date] { max-width: 150px; }
.plan-matrix td:not(:first-child), .plan-matrix th:not(:first-child) { min-width: 170px; }
.plan-matrix .form-check-input[type=checkbox]:not([role=switch]) { width: 1.15rem; height: 1.15rem; }
.module-table select { min-width: 150px; }
.module-table input[type=date] { min-width: 140px; }

/* ---------- Demo access ---------- */
.demo-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.demo-panel { max-width: 560px; }
.demo-panel .auth-form { margin: 1.5rem 0; }
.demo-sent-icon { font-size: 2.5rem; color: var(--brand); margin-bottom: .5rem; }
.demo-cta { background: var(--brand-soft); border-radius: var(--radius); padding: .9rem 1rem; text-align: center; }

/* Demo leads: history timeline */
.lead-history { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.lead-history li { display: flex; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border, #eef0f3); }
.lead-history li:last-child { border-bottom: 0; }
.lead-history li > i { flex: 0 0 auto; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-size: .85rem; }
.lead-history li.is-system > i { background: var(--off-soft); color: var(--off); }
.lead-history li.is-system .lead-note { color: var(--bs-secondary-color); }
.lead-note { white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- two-factor sign-in ---------- */
.otp-input { letter-spacing: .25em; font-variant-numeric: tabular-nums; }
.qr-box { width: 180px; height: 180px; padding: 6px; background: #fff; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 8px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1rem; }
.recovery-codes code { font-size: .95rem; color: inherit; }

/* ---------- Settings → Subscription: module switches ---------- */
.module-switch { min-width: 7rem; text-align: right; }

/* ---------- Help centre ---------- */
.help-search { padding: 1.25rem; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.help-list .help-row { padding: .75rem 1.25rem; border-top: 1px solid var(--border); }
.help-list .help-row:first-child { border-top: 0; }
.help-list .help-row.active { background: var(--bs-tertiary-bg, #f6f7f9); }
.help-article-wrap { max-width: 860px; }
.help-body { line-height: 1.65; overflow-wrap: anywhere; }
.help-body h2 { font-size: 1.3rem; margin: 1.5rem 0 .6rem; }
.help-body h3 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.help-body img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; margin: .5rem 0; }
.help-body blockquote { border-left: 3px solid var(--bs-primary, #4f46e5); background: var(--bs-tertiary-bg, #f6f7f9); padding: .6rem 1rem; border-radius: 0 6px 6px 0; margin: 1rem 0; }
.help-body table { border-collapse: collapse; margin: 1rem 0; }
.help-body th, .help-body td { border: 1px solid var(--border); padding: .35rem .6rem; }
.rte { border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 8px; overflow: hidden; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: .35rem; border-bottom: 1px solid var(--bs-border-color, #dee2e6); background: var(--bs-tertiary-bg, #f6f7f9); }
.rte-toolbar button { border: 0; background: transparent; min-width: 2rem; height: 2rem; border-radius: 6px; font-weight: 600; font-size: .85rem; }
.rte-toolbar button:hover { background: rgba(0,0,0,.06); }
.rte-sep { width: 1px; margin: .25rem .3rem; background: var(--bs-border-color, #dee2e6); }
.rte-area { min-height: 360px; padding: 1rem; outline: none; background: #fff; }
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(79, 70, 229, .25); }

/* ---------- Tickets ---------- */
.ticket-thread { display: grid; gap: .75rem; }
.ticket-msg { background: var(--bs-body-bg, #fff); border: 1px solid var(--border); border-radius: 10px; padding: .85rem 1rem; }
.ticket-msg.is-platform { border-left: 3px solid var(--bs-primary, #4f46e5); }
.ticket-msg.is-note { background: #fffbeb; border-color: #fde68a; }
.ticket-msg-head { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; margin-bottom: .4rem; }
.ticket-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.ticket-files { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.ticket-file { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; }
.ticket-event { font-size: .82rem; color: var(--bs-secondary-color, #6c757d); text-align: center; padding: .25rem 0; white-space: pre-wrap; }
.help-suggest { margin-top: .5rem; padding: .6rem .8rem; border: 1px dashed var(--border); border-radius: 8px; background: var(--bs-tertiary-bg, #f6f7f9); }
