/* School HR theme on top of Bootstrap 5.3, styled after Keplar: teal brand, slate sidebar, widget dashboard. */

/* ---------- Tokens ---------- */
:root,
[data-bs-theme="light"] {
    --hr-primary: #0f8570;          /* teal for buttons and links (AA with white text) */
    --hr-primary-rgb: 15, 133, 112;
    --hr-primary-hover: #0b6f5d;
    --hr-primary-soft: #e3f5f0;
    --hr-teal: #1fb393;             /* decorative teal for cards and charts */
    --hr-teal-2: #26c6a6;
    --hr-blue: #1f7fd6;
    --hr-orange: #f39c32;
    --hr-bg: #f2f5f7;
    --hr-surface: #ffffff;
    --hr-surface-2: #f6f8fa;
    --hr-line: #e3e8ee;
    --hr-muted: #66707f;
    --hr-ink: #2f3b4c;
    --hr-sidebar: #2b3a48;
    --hr-sidebar-2: #23303c;
    --hr-sidebar-text: #c3ccd6;
    --hr-radius: 10px;
    --hr-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 6px rgba(16, 24, 40, .04);
    --hr-shadow-lg: 0 10px 28px rgba(16, 24, 40, .10);
    --hr-sidebar-width: 260px;

    --bs-body-bg: var(--hr-bg);
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .9rem;
    --bs-body-color: var(--hr-ink);
    --bs-secondary-color: var(--hr-muted);
    --bs-border-color: var(--hr-line);
    --bs-primary: var(--hr-primary);
    --bs-primary-rgb: var(--hr-primary-rgb);
    --bs-link-color: var(--hr-primary);
    --bs-link-color-rgb: var(--hr-primary-rgb);
    --bs-link-hover-color: var(--hr-primary-hover);
    --bs-link-hover-color-rgb: 11, 111, 93;
    --bs-primary-bg-subtle: var(--hr-primary-soft);
    --bs-primary-text-emphasis: #0a5c4d;
    --bs-info-rgb: 23, 162, 184;
    --bs-border-radius: .45rem;
    --bs-border-radius-sm: .35rem;
    --bs-border-radius-lg: .65rem;
    --bs-focus-ring-color: rgba(var(--hr-primary-rgb), .25);
}

[data-bs-theme="dark"] {
    --hr-primary: #2cc9a6;
    --hr-primary-rgb: 44, 201, 166;
    --hr-primary-hover: #52d6b8;
    --hr-primary-soft: rgba(44, 201, 166, .14);
    --hr-teal: #149b80;
    --hr-teal-2: #19ad8f;
    --hr-bg: #0f151b;
    --hr-surface: #172029;
    --hr-surface-2: #1c2630;
    --hr-line: #2a3642;
    --hr-muted: #95a2b0;
    --hr-ink: #e2e8ee;
    --hr-sidebar: #121a22;
    --hr-sidebar-2: #0e151b;
    --hr-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --hr-shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);

    --bs-body-bg: var(--hr-bg);
    --bs-body-color: var(--hr-ink);
    --bs-secondary-color: var(--hr-muted);
    --bs-border-color: var(--hr-line);
    --bs-tertiary-bg: var(--hr-surface-2);
    --bs-primary: var(--hr-primary);
    --bs-primary-rgb: var(--hr-primary-rgb);
    --bs-link-color: var(--hr-primary);
    --bs-link-color-rgb: var(--hr-primary-rgb);
    --bs-link-hover-color: var(--hr-primary-hover);
    --bs-primary-bg-subtle: var(--hr-primary-soft);
    --bs-primary-text-emphasis: #9fe8d6;
}

/* Module accents (tiles and menu icons). */
.accent-success { --accent: #12a150; --accent-soft: rgba(18, 161, 80, .12); }
.accent-info { --accent: #0b9bd6; --accent-soft: rgba(11, 155, 214, .12); }
.accent-warning { --accent: #e08a00; --accent-soft: rgba(224, 138, 0, .13); }
.accent-danger { --accent: #e5484d; --accent-soft: rgba(229, 72, 77, .12); }
.accent-violet { --accent: #7c4ddb; --accent-soft: rgba(124, 77, 219, .12); }
.accent-orange { --accent: #f2711c; --accent-soft: rgba(242, 113, 28, .12); }
.accent-primary { --accent: #1f7fd6; --accent-soft: rgba(31, 127, 214, .12); }
.accent-slate { --accent: #5b6b8c; --accent-soft: rgba(91, 107, 140, .14); }
.accent-secondary { --accent: #6c757d; --accent-soft: rgba(108, 117, 125, .14); }
.accent-dark { --accent: #343a40; --accent-soft: rgba(52, 58, 64, .12); }
.accent-teal { --accent: #14a38b; --accent-soft: rgba(20, 163, 139, .12); }
.accent-rose { --accent: #d6336c; --accent-soft: rgba(214, 51, 108, .12); }

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-weight: 700; letter-spacing: -.01em; color: var(--hr-ink); }
.min-w-0 { min-width: 0; }
.thaana { font-family: "Noto Sans Thaana", "MV Faseyha", sans-serif; unicode-bidi: isolate; }
.text-bg-orange { background-color: #fd7e14 !important; color: #fff !important; }
.text-bg-info { color: #fff !important; background-color: #138ea3 !important; }
.text-bg-warning { color: #3d2a00 !important; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.app-sidebar {
    --bs-offcanvas-width: var(--hr-sidebar-width);
    --bs-offcanvas-bg: var(--hr-sidebar);
    width: var(--hr-sidebar-width);
    flex: 0 0 var(--hr-sidebar-width);
    background: linear-gradient(180deg, var(--hr-sidebar) 0%, var(--hr-sidebar-2) 100%);
    color: var(--hr-sidebar-text);
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}
@media (min-width: 1200px) {
    .app-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
    body.sidebar-collapsed .app-sidebar { margin-left: calc(-1 * var(--hr-sidebar-width)); }
}
@media (max-width: 1199.98px) {
    .app-sidebar.offcanvas-xl { background: linear-gradient(180deg, var(--hr-sidebar) 0%, var(--hr-sidebar-2) 100%); }
    .app-sidebar .app-nav { overflow-y: auto; }
}

.sidebar-profile {
    position: relative; text-align: center; padding: 1.5rem 1rem 1.1rem;
    background: rgba(0, 0, 0, .14); border-bottom: 3px solid var(--hr-teal);
}
.sidebar-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 4.25rem; height: 4.25rem; border-radius: 50%; font-size: 1.35rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--hr-teal-2), var(--hr-blue)); border: 3px solid rgba(255, 255, 255, .85);
}
.sidebar-role { color: var(--hr-sidebar-text); }
.sidebar-foot { margin-top: auto; padding: .9rem 1.25rem; color: rgba(195, 204, 214, .6); border-top: 1px solid rgba(255, 255, 255, .06); }

.app-nav { padding: .75rem .6rem 1rem; display: flex; flex-direction: column; gap: 1px; }
.app-nav-link {
    display: flex; align-items: center; gap: .7rem; width: 100%;
    padding: .55rem .75rem; border: 0; border-radius: .4rem; background: transparent;
    color: var(--hr-sidebar-text); text-decoration: none; text-align: start; font-size: .875rem; font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.app-nav-link > i:first-child { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.app-nav-link:hover, .app-nav-link:focus-visible { background: rgba(255, 255, 255, .06); color: #fff; }
.app-nav-link.active { background: var(--hr-teal); color: #fff; font-weight: 600; }
.app-nav-link.current { color: #fff; background: rgba(255, 255, 255, .05); }
.app-nav-toggle .nav-icon { color: var(--accent); filter: brightness(1.25); }
.app-nav-toggle .caret { margin-inline-start: auto; font-size: .7rem; transition: transform .2s ease; opacity: .6; }
.app-nav-toggle:not(.collapsed) .caret { transform: rotate(180deg); }
.app-subnav { list-style: none; margin: .1rem 0 .4rem; padding: 0 0 0 2.15rem; position: relative; }
.app-subnav::before { content: ""; position: absolute; left: 1.35rem; top: .2rem; bottom: .2rem; width: 1px; background: rgba(255, 255, 255, .1); }
.app-subnav a {
    display: block; padding: .35rem .7rem; border-radius: .4rem; font-size: .83rem;
    color: rgba(195, 204, 214, .85); text-decoration: none; transition: background-color .15s ease, color .15s ease;
}
.app-subnav a:hover, .app-subnav a:focus-visible { color: #fff; background: rgba(255, 255, 255, .05); }
.app-subnav a.active { color: #fff; background: rgba(31, 179, 147, .28); font-weight: 600; box-shadow: inset 3px 0 0 var(--hr-teal); }

.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem 1.25rem; min-height: 60px;
    background: var(--hr-surface); border-bottom: 1px solid var(--hr-line);
}
.app-menu-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; padding: 0;
    font-size: 1.35rem; color: #fff; background: var(--hr-teal); border-radius: .4rem; border: 0;
}
.app-menu-btn:hover, .app-menu-btn:focus-visible { color: #fff; background: var(--hr-primary); }
.app-search { position: relative; flex: 0 1 26rem; min-width: 0; }
.app-search > .bi-search { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--hr-muted); pointer-events: none; }
.app-search .form-control { padding-left: 2.25rem; padding-right: 2rem; border-color: transparent; background: var(--hr-surface-2); }
.app-search .form-control:focus { background: var(--hr-surface); }
.app-search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: var(--hr-surface); color: var(--hr-muted); border: 1px solid var(--hr-line); font-size: .7rem; padding: .05rem .35rem; }
.app-search-results {
    position: absolute; top: calc(100% + .35rem); left: 0; right: 0; z-index: 1050; list-style: none; margin: 0; padding: .35rem;
    background: var(--hr-surface); border: 1px solid var(--hr-line); border-radius: .6rem; box-shadow: var(--hr-shadow-lg); max-height: 60vh; overflow-y: auto;
}
.app-search-results a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: .4rem; color: var(--bs-body-color); text-decoration: none; }
.app-search-results a small { color: var(--hr-muted); }
.app-search-results [aria-selected="true"] a, .app-search-results a:hover { background: var(--hr-primary-soft); color: var(--hr-primary-hover); }
.app-search-results .empty { padding: .5rem .6rem; color: var(--hr-muted); }
.topbar-date { color: var(--hr-muted); font-size: .85rem; padding-right: .5rem; border-right: 1px solid var(--hr-line); margin-right: .25rem; }
.app-icon-btn { font-size: 1.25rem; line-height: 1; padding: .4rem .55rem; border-radius: .45rem; color: var(--hr-muted); }
.app-icon-btn:hover { background: var(--hr-surface-2); color: var(--hr-ink); }
.notify-badge { position: absolute; top: 0; right: 0; min-width: 1.1rem; padding: 0 .3rem; border-radius: 999px; font-size: .65rem; font-weight: 700; line-height: 1.1rem; color: #fff; background: var(--hr-orange); }
.notify-menu { width: 20rem; padding: .6rem; }
.notify-item { padding: .55rem .4rem; border-bottom: 1px solid var(--hr-line); font-size: .85rem; }
.notify-item:last-child { border-bottom: 0; }
.app-user { display: flex; align-items: center; gap: .6rem; padding: .25rem .55rem .25rem .25rem; border-radius: 999px; border: 1px solid transparent; }
.app-user:hover, .app-user[aria-expanded="true"] { background: var(--hr-surface-2); border-color: var(--hr-line); }
.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 2.1rem; height: 2.1rem; border-radius: 50%; font-size: .78rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--hr-teal-2), var(--hr-blue));
}

.page-tabs { display: flex; align-items: flex-end; gap: 1rem; padding: .6rem 1.25rem 0; background: var(--hr-surface); border-bottom: 1px solid var(--hr-line); min-height: 3rem; }
.page-tab {
    display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; margin-bottom: -1px;
    font-size: .85rem; font-weight: 600; color: var(--hr-ink); white-space: nowrap;
    background: var(--hr-bg); border: 1px solid var(--hr-line); border-bottom-color: var(--hr-bg); border-radius: .45rem .45rem 0 0;
}
.page-tab .bi { color: var(--hr-teal); }
.page-tabs .breadcrumb { font-size: .82rem; padding-bottom: .6rem; --bs-breadcrumb-divider-color: var(--hr-muted); }
.page-tabs .breadcrumb-item { white-space: nowrap; color: var(--hr-muted); }
.page-tabs .breadcrumb-item a { color: var(--hr-muted); text-decoration: none; text-underline-offset: 3px; }
.page-tabs .breadcrumb-item a:hover { color: var(--hr-primary); text-decoration: underline; }
.page-tabs .breadcrumb-item.active, .page-tabs .breadcrumb-item.active a { color: var(--hr-ink); font-weight: 600; }

.app-content { flex: 1 1 auto; width: 100%; max-width: 1480px; padding: 1.5rem 1.25rem 3rem; margin: 0 auto; }
@media (max-width: 575.98px) {
    .app-topbar { padding: .5rem .75rem; gap: .5rem; }
    .page-tabs { padding: .5rem .75rem 0; }
    .page-tabs .breadcrumb { display: none; }
    .app-content { padding: 1rem .75rem 2.5rem; }
}

/* ---------- Page elements ---------- */
.app-content h1.h3 { font-size: 1.6rem; }

.card {
    --bs-card-border-color: var(--hr-line);
    --bs-card-border-radius: var(--hr-radius);
    --bs-card-inner-border-radius: calc(var(--hr-radius) - 1px);
    --bs-card-bg: var(--hr-surface);
    --bs-card-cap-bg: var(--hr-surface-2);
    box-shadow: var(--hr-shadow);
}
.card-header { font-weight: 600; }

/* Tables that sit straight on the page get a card frame. */
.app-content .table { --bs-table-bg: var(--hr-surface); --bs-table-hover-bg: var(--hr-surface-2); margin-bottom: 1.5rem; }
.app-content .table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--hr-line); }
.app-content .table-sm > :not(caption) > * > * { padding: .45rem .7rem; }
.app-content .table > thead > tr > th {
    background: var(--hr-surface-2); color: var(--hr-muted);
    font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.app-content .table:not(.card .table):not(.att-calendar) {
    border-collapse: separate; border-spacing: 0;
    border: 1px solid var(--hr-line); border-radius: var(--hr-radius); overflow: hidden; box-shadow: var(--hr-shadow);
}
.app-content .table:not(.card .table) > :last-child > tr:last-child > * { border-bottom: 0; }
.table-responsive { border-radius: var(--hr-radius); margin-bottom: 1.5rem; }
.table-responsive > .table { margin-bottom: 0 !important; }
.table td, .table th { vertical-align: middle; }
.app-content .table a:not(.btn) { text-decoration: none; font-weight: 500; }
.app-content .table a:not(.btn):hover { text-decoration: underline; }

/* Forms */
.form-control, .form-select { border-color: var(--hr-line); background-color: var(--hr-surface); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--hr-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--hr-primary-rgb), .15); }
.form-check-input:checked { background-color: var(--hr-primary); border-color: var(--hr-primary); }
.form-label { font-weight: 500; font-size: .875rem; }
.input-group-text { background: var(--hr-surface-2); border-color: var(--hr-line); color: var(--hr-muted); }
/* Inline filter bars: keep fields at their natural width instead of one per line. */
form.d-flex > .form-control, form.d-flex > .form-select { width: auto; flex: 1 1 10rem; min-width: 9rem; max-width: 18rem; }
form.d-flex > input[type="date"].form-control { flex-basis: 9.5rem; }

/* Buttons */
.btn { font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--hr-primary); --bs-btn-border-color: var(--hr-primary);
    --bs-btn-hover-bg: var(--hr-primary-hover); --bs-btn-hover-border-color: var(--hr-primary-hover);
    --bs-btn-active-bg: var(--hr-primary-hover); --bs-btn-active-border-color: var(--hr-primary-hover);
    --bs-btn-disabled-bg: var(--hr-primary); --bs-btn-disabled-border-color: var(--hr-primary);
    --bs-btn-focus-shadow-rgb: var(--hr-primary-rgb);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 4px 10px rgba(var(--hr-primary-rgb), .22);
}
.btn-outline-primary {
    --bs-btn-color: var(--hr-primary); --bs-btn-border-color: var(--hr-primary);
    --bs-btn-hover-bg: var(--hr-primary); --bs-btn-hover-border-color: var(--hr-primary);
    --bs-btn-active-bg: var(--hr-primary); --bs-btn-active-border-color: var(--hr-primary);
}
.btn-secondary {
    --bs-btn-color: var(--bs-body-color); --bs-btn-bg: var(--hr-surface); --bs-btn-border-color: var(--hr-line);
    --bs-btn-hover-color: var(--bs-body-color); --bs-btn-hover-bg: var(--hr-surface-2); --bs-btn-hover-border-color: #cfd6e4;
    --bs-btn-active-color: var(--bs-body-color); --bs-btn-active-bg: var(--hr-surface-2); --bs-btn-active-border-color: #cfd6e4;
}
.btn-outline-secondary {
    --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--hr-line); --bs-btn-bg: var(--hr-surface);
    --bs-btn-hover-color: var(--bs-body-color); --bs-btn-hover-bg: var(--hr-surface-2); --bs-btn-hover-border-color: #cfd6e4;
    --bs-btn-active-color: var(--bs-body-color); --bs-btn-active-bg: var(--hr-surface-2); --bs-btn-active-border-color: #cfd6e4;
}

/* Badges, alerts, dropdowns, misc */
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 999px; padding: .38em .7em; }
.alert { border-radius: var(--hr-radius); border-width: 0; border-left: 4px solid currentColor; box-shadow: var(--hr-shadow); }
.alert-success { border-left-color: #12a150; }
.alert-danger { border-left-color: #e5484d; }
.alert-warning { border-left-color: #e08a00; }
.alert-info { border-left-color: #0b9bd6; }
.dropdown-menu { --bs-dropdown-border-color: var(--hr-line); --bs-dropdown-border-radius: .75rem; --bs-dropdown-link-active-bg: var(--hr-primary); padding: .4rem; }
.dropdown-item { border-radius: .45rem; padding: .45rem .75rem; }
.nav-tabs { --bs-nav-tabs-border-color: var(--hr-line); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--hr-primary); }
.pagination { --bs-pagination-active-bg: var(--hr-primary); --bs-pagination-active-border-color: var(--hr-primary); --bs-pagination-border-color: var(--hr-line); }
.list-group { --bs-list-group-border-color: var(--hr-line); --bs-list-group-active-bg: var(--hr-primary); --bs-list-group-active-border-color: var(--hr-primary); }
.stat-card .display-6 { font-variant-numeric: tabular-nums; font-weight: 650; }
.modal-content { border: 0; border-radius: var(--hr-radius); box-shadow: var(--hr-shadow-lg); }

/* ---------- Dashboard: module tiles ---------- */
.module-tile {
    position: relative; overflow: hidden; display: flex; flex-direction: row; align-items: center; gap: .9rem;
    padding: 1rem 1.1rem; text-decoration: none; color: var(--bs-body-color);
    border: 1px solid var(--hr-line); border-left: 4px solid var(--accent);
    transition: transform .15s ease, box-shadow .15s ease;
}
.module-tile:hover, .module-tile:focus-visible { color: var(--bs-body-color); transform: translateY(-2px); box-shadow: var(--hr-shadow-lg); }
.module-tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.module-tile:hover .module-icon { background: var(--accent); color: #fff; }
.module-name { display: block; font-weight: 700; font-size: .95rem; line-height: 1.3; }
.module-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 2.75rem; height: 2.75rem; border-radius: .6rem; font-size: 1.3rem;
    color: var(--accent); background: var(--accent-soft); transition: background-color .15s ease, color .15s ease;
}

/* ---------- Dashboard widgets ---------- */
.widget { background: var(--hr-surface); border: 1px solid var(--hr-line); border-radius: var(--hr-radius); box-shadow: var(--hr-shadow); padding: 1rem 1.1rem; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: -1rem -1.1rem .75rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--hr-line); }
.widget-head h2 { font-size: .95rem; font-weight: 700; }
.widget-empty { color: var(--hr-muted); font-style: italic; margin: .5rem 0 0; font-size: .875rem; }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list > li { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--hr-line); }
.widget-list > li:nth-child(odd) { background: transparent; }
.widget-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.badge-count { background: var(--hr-orange); color: #2b1a00; min-width: 2rem; border-radius: .35rem; }
.badge-count.is-zero { background: var(--hr-surface-2); color: var(--hr-muted); border: 1px solid var(--hr-line); }
.badge-balance { background: var(--hr-teal); color: #fff; min-width: 2.4rem; border-radius: .35rem; font-size: .8rem; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; padding: 0; color: #fff; background: var(--hr-teal); border-radius: .35rem; }
.btn-icon:hover, .btn-icon:focus-visible { color: #fff; background: var(--hr-primary); }
.stat-chip { min-width: 6.5rem; text-align: left; border-radius: .35rem; padding: .35rem .55rem; }

.widget-profile {
    color: #fff; border: 0; padding: 1.25rem;
    background: linear-gradient(135deg, var(--hr-teal) 0%, #18a084 60%, #138f77 100%);
}
.widget-profile h2 { color: #fff; }
.profile-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 4.5rem; height: 4.5rem; border-radius: 50%; font-size: 1.4rem; font-weight: 700;
    color: var(--hr-teal); background: #fff; border: 3px solid rgba(255, 255, 255, .6);
}
.btn-light-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .6); padding: .15rem .45rem; }
.btn-light-ghost:hover, .btn-light-ghost:focus-visible { color: var(--hr-teal); background: #fff; }

.duty-card { flex: 1 1 0; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; color: #fff; border-radius: var(--hr-radius); box-shadow: var(--hr-shadow); min-height: 4.75rem; }
.duty-card.duty-0 { background: linear-gradient(135deg, #18a084, var(--hr-teal)); }
.duty-card.duty-1 { background: linear-gradient(135deg, #1aa8b0, #22c1c3); }
.duty-card.duty-2 { background: linear-gradient(135deg, #1a6fc4, var(--hr-blue)); }
.duty-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.1rem; height: 3.1rem; border: 2px solid rgba(255, 255, 255, .85); border-radius: .45rem; line-height: 1.05; flex: 0 0 auto; }
.duty-date span { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; }
.duty-date strong { font-size: 1.15rem; }

.stat-tile { position: relative; padding: .8rem .9rem; border-radius: .6rem; background: var(--hr-surface-2); border: 1px solid var(--hr-line); border-left: 4px solid var(--tone); }
.stat-tile > .bi { position: absolute; right: .75rem; top: .7rem; font-size: 1.1rem; color: var(--tone); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .78rem; color: var(--hr-muted); }
.tone-success { --tone: #18a058; } .tone-warning { --tone: #e08a00; } .tone-info { --tone: #138ea3; } .tone-danger { --tone: #e5484d; }

.mini-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: .78rem; font-weight: 700; color: #fff; }
.avatar-0 { background: #18a058; } .avatar-1 { background: #1aa8b0; } .avatar-2 { background: #f08a24; } .avatar-3 { background: #1f7fd6; } .avatar-4 { background: #8e5bd6; }
.log-dot { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--hr-teal); background: var(--hr-primary-soft); flex: 0 0 auto; }

/* Settings tabs */
.settings-tabs .nav-link { color: var(--hr-muted); font-weight: 500; }
.settings-tabs .nav-link.active { color: var(--hr-primary); background: var(--hr-surface); }
.perm-group .card-header { background: var(--hr-surface-2); }

/* ---------- Brand mark (sign-in page) ---------- */
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 2.5rem; height: 2.5rem; border-radius: .7rem; font-size: 1.25rem; color: #fff;
    background: linear-gradient(135deg, var(--hr-teal-2) 0%, var(--hr-teal) 55%, var(--hr-blue) 100%);
    box-shadow: 0 6px 16px rgba(31, 179, 147, .35);
}
.brand-mark-lg { width: 3.5rem; height: 3.5rem; font-size: 1.75rem; border-radius: 1rem; }

/* ---------- Sign in ---------- */
.guest-content { min-height: 100vh; padding: 1.5rem 1rem; display: flex; flex-direction: column; justify-content: center; max-width: 1100px; margin: 0 auto; }
.guest-content:has(.login-wrap) {
    max-width: none; background:
        radial-gradient(1200px 600px at 10% -10%, rgba(31, 179, 147, .20), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(31, 127, 214, .14), transparent 60%),
        var(--hr-bg);
}
.login-wrap { display: flex; justify-content: center; }
.login-panel {
    display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 920px;
    background: var(--hr-surface); border: 1px solid var(--hr-line); border-radius: 22px; overflow: hidden; box-shadow: var(--hr-shadow-lg);
}
.login-brand { display: none; }
.login-form { padding: 2.25rem 1.75rem; min-width: 0; }
@media (min-width: 992px) {
    .login-panel { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .login-panel:has(.demo-logins) { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
    .login-brand {
        display: block; position: relative; overflow: hidden; color: #fff; padding: 3rem 2.75rem;
        background: linear-gradient(150deg, #23303c 0%, #1d6f63 55%, #1fb393 100%);
    }
    .login-brand::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 280px; height: 280px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06); }
    .login-form { padding: 3.25rem 3rem; display: flex; flex-direction: column; justify-content: center; }
}
.login-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.login-features li { display: flex; align-items: center; gap: .75rem; font-size: .95rem; }
.login-features i { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: .6rem; background: rgba(255, 255, 255, .12); }

/* ---------- Attendance calendar ---------- */
.att-calendar { table-layout: fixed; }
.att-calendar td { height: 6.5rem; vertical-align: top; font-size: .85rem; }
.att-calendar .day-num { font-weight: 600; }
@media (max-width: 576px) { .att-calendar td { height: 4.5rem; font-size: .7rem; } }

/* ---------- Print ---------- */
@media print {
    .d-print-none, nav, .app-sidebar, .app-topbar { display: none !important; }
    body { background: #fff !important; }
    main, .app-content { padding: 0 !important; max-width: none; }
    .card, .table { box-shadow: none !important; }
    .module-tile:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .module-tile, .module-tile .module-icon { transition: none; }
    .module-tile:hover { transform: none; }
}

/* Dark mode: keep white text on filled primary surfaces readable. */
[data-bs-theme="dark"] .btn-primary {
    --bs-btn-bg: #10806b; --bs-btn-border-color: #10806b;
    --bs-btn-hover-bg: #139178; --bs-btn-hover-border-color: #139178;
    --bs-btn-active-bg: #139178; --bs-btn-active-border-color: #139178;
}

/* Sample logins on the sign-in page */
.demo-divider { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--hr-muted); }
.demo-divider::before, .demo-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--hr-line); }
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
@media (min-width: 576px) { .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.demo-login {
    display: flex; align-items: center; gap: .65rem; width: 100%; height: 100%; padding: .55rem .7rem;
    border: 1px solid var(--hr-line); border-radius: .7rem; background: var(--hr-surface); color: var(--bs-body-color);
    font-size: .85rem; line-height: 1.25; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.demo-login:hover, .demo-login:focus-visible { border-color: rgba(var(--hr-primary-rgb), .5); background: var(--hr-primary-soft); box-shadow: var(--hr-shadow); }
.demo-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: .55rem; background: var(--hr-primary-soft); color: var(--hr-primary); }
.login-panel:has(.demo-logins) { max-width: 1040px; }

/* Tile description */
.module-tile .module-summary { display: block; margin-top: .15rem; font-size: .78rem; font-weight: 400; line-height: 1.4; color: var(--hr-muted); }

/* Attendance reports */
.report-menu .list-group-item { border-radius: 0; padding: .65rem .9rem; }
.report-menu .list-group-item:first-child { border-top-left-radius: var(--hr-radius); border-top-right-radius: var(--hr-radius); }
.report-menu .list-group-item:last-child { border-bottom-left-radius: var(--hr-radius); border-bottom-right-radius: var(--hr-radius); }
.report-menu .list-group-item.active .small { color: rgba(255, 255, 255, .8); }
.report-table td, .report-table th { white-space: nowrap; }
.report-table tfoot td { background: var(--hr-surface-2); border-top: 2px solid var(--hr-line); }

/* Progress bars and tabular numbers in the theme colours */
.progress, .progress-stacked { --bs-progress-bar-bg: var(--hr-teal); --bs-progress-bg: var(--hr-surface-2); }
.num { font-variant-numeric: tabular-nums; }

.login-brand h2 { color: #fff; }

/* Section tabs inside a page */
.section-tabs { gap: .25rem; border-bottom-color: var(--hr-line); flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.section-tabs .nav-link { color: var(--hr-muted); font-weight: 600; font-size: .9rem; white-space: nowrap; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: .6rem .9rem; background: none; }
.section-tabs .nav-link:hover { color: var(--hr-ink); border-bottom-color: var(--hr-line); }
.section-tabs .nav-link.active { color: var(--hr-primary); background: none; border-bottom-color: var(--hr-primary); }
.section-tabs .nav-link:focus-visible { outline: 2px solid var(--hr-primary); outline-offset: -2px; }
.section-tabs .badge { font-weight: 600; }
.tab-content > .tab-pane:focus { outline: none; }

/* Module menu: heading for the open module; pages outside a module have no menu. */
.app-nav-heading { cursor: default; margin-top: .5rem; text-transform: none; }
.app-nav-heading:hover { background: rgba(255, 255, 255, .05); }
.app-nav-heading .nav-icon { color: var(--accent); filter: brightness(1.25); }
.app-brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--hr-ink); text-decoration: none; white-space: nowrap; padding: .35rem .5rem; border-radius: .5rem; }
.app-brand .bi { color: var(--hr-primary); font-size: 1.25rem; }
.app-brand:hover { background: var(--hr-primary-soft); color: var(--hr-ink); }
.app-shell.no-sidebar .app-content { max-width: 1320px; width: 100%; margin-inline: auto; }

/* Drag-and-drop file fields (shell.js wraps every input[type=file]). */
.dropzone {
    position: relative;
    border: 2px dashed var(--hr-line);
    border-radius: var(--hr-radius);
    background: var(--hr-surface-2);
    padding: 1rem;
    text-align: center;
    color: var(--hr-muted);
    transition: border-color .15s, background-color .15s;
}
.dropzone-sm { padding: .35rem .6rem; font-size: .875rem; border-width: 1px; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--hr-primary); background: var(--hr-primary-soft); color: var(--hr-ink); }
.dropzone:focus-within { border-color: var(--hr-primary); box-shadow: 0 0 0 .2rem rgba(var(--hr-primary-rgb), .25); }
.dropzone.is-invalid { border-color: var(--bs-danger); }
.dropzone.has-files { border-style: solid; border-color: var(--hr-primary); }
.dropzone-label .bi { font-size: 1.4rem; vertical-align: middle; color: var(--hr-primary); }
.dropzone-sm .dropzone-label .bi { font-size: 1rem; }
.dropzone-hint { display: block; font-size: .75rem; margin-top: .15rem; }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-files { margin-top: .4rem; font-size: .85rem; color: var(--hr-ink); text-align: left; position: relative; pointer-events: none; }
.dropzone-files li { overflow-wrap: anywhere; }
.dropzone.is-invalid + .invalid-feedback { display: block; }

/* "Sign in with Google" (Google's button guidelines: white, grey border, logo on the left). */
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 500; }
.btn-google:hover, .btn-google:focus { background: #f2f6fc; color: #1f1f1f; border-color: #747775; }

/* Meeting check-in desk in full screen. */
#checkin-card:fullscreen { overflow: auto; padding: 2rem; background: var(--hr-surface); }
#checkin-card:fullscreen #checkin-input { font-size: 2rem; }
#checkin-card:fullscreen #feedback { font-size: 1.5rem; }
