/* ==========================================================================
   Data Tronex HR & Project Management
   Metis admin layout ("refined neutral") ported to plain CSS on Bootstrap 5.3
   1. Tokens  2. Base  3. Shell (header / sidebar / main)  4. Components
   5. HR  6. Project management  7. Board  8. Issue  9. Timeline  10. Calendar
   11. Big screen  12. Print / responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
  --sidebar-width: 248px;
  --sidebar-mini-width: 64px;
  --header-height: 56px;
  --border-radius: .5rem;
  --border-radius-sm: .375rem;
  --border-radius-lg: .625rem;
  --box-shadow-lg: 0 8px 24px rgba(9, 9, 11, .08), 0 2px 6px rgba(9, 9, 11, .04);
  --box-shadow-xl: 0 16px 40px rgba(9, 9, 11, .12), 0 4px 10px rgba(9, 9, 11, .05);

  --surface-app: #fafafa;
  --surface-panel: #ffffff;
  --surface-sunken: #f4f4f5;
  --surface-hover: #f4f4f5;
  --surface-column: #f4f4f5;
  --ink-primary: #18181b;
  --ink-secondary: #52525b;
  --ink-muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;

  --bs-body-bg: var(--surface-app);
  --bs-body-color: var(--ink-primary);
  --bs-body-font-size: .875rem;
  --bs-body-font-family: "Inter", "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-font-sans-serif: var(--bs-body-font-family);
  --bs-secondary-color: var(--ink-secondary);
  --bs-tertiary-color: var(--ink-muted);
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line-strong);
  --bs-emphasis-color: #09090b;
  --bs-secondary-bg: var(--surface-sunken);
  --bs-tertiary-bg: var(--surface-sunken);
  --bs-heading-color: var(--ink-primary);
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1d4ed8;
  --bs-link-hover-color-rgb: 29, 78, 216;
  --bs-secondary-rgb: 82, 82, 91;
  --bs-border-radius: .5rem;
  --bs-border-radius-sm: .375rem;
  --bs-border-radius-lg: .625rem;
  --bs-primary-text-emphasis: #1d4ed8;
  --bs-success-text-emphasis: #15803d;
  --bs-danger-text-emphasis: #b91c1c;
  --bs-warning-text-emphasis: #b45309;
  --bs-info-text-emphasis: #0e7490;

  --tone-success-bg: #dcfce7; --tone-success-fg: #166534;
  --tone-warning-bg: #fef3c7; --tone-warning-fg: #92400e;
  --tone-danger-bg: #fee2e2;  --tone-danger-fg: #991b1b;
  --tone-info-bg: #e0f2fe;    --tone-info-fg: #075985;
  --tone-primary-bg: #dbeafe; --tone-primary-fg: #1e40af;
  --tone-secondary-bg: #f4f4f5; --tone-secondary-fg: #3f3f46;
  --tone-dark-bg: #e4e4e7;    --tone-dark-fg: #18181b;
  --tone-purple-bg: #ede9fe;  --tone-purple-fg: #5b21b6;
}

[data-bs-theme="dark"] {
  --surface-app: #09090b;
  --surface-panel: #18181b;
  --surface-sunken: #111113;
  --surface-hover: #27272a;
  --surface-column: #111113;
  --ink-primary: #f4f4f5;
  --ink-secondary: #a1a1aa;
  --ink-muted: #71717a;
  --line: #27272a;
  --line-strong: #3f3f46;

  --bs-body-bg: var(--surface-app);
  --bs-body-color: var(--ink-primary);
  --bs-secondary-color: var(--ink-secondary);
  --bs-tertiary-color: var(--ink-muted);
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line-strong);
  --bs-emphasis-color: #fafafa;
  --bs-secondary-bg: var(--surface-sunken);
  --bs-tertiary-bg: var(--surface-sunken);
  --bs-heading-color: var(--ink-primary);
  --bs-link-color: #60a5fa;
  --bs-link-color-rgb: 96, 165, 250;
  --bs-link-hover-color: #93c5fd;
  --bs-link-hover-color-rgb: 147, 197, 253;
  --bs-primary-text-emphasis: #93c5fd;
  --bs-success-text-emphasis: #86efac;
  --bs-danger-text-emphasis: #fca5a5;
  --bs-warning-text-emphasis: #fcd34d;
  --bs-info-text-emphasis: #67e8f9;

  --tone-success-bg: rgba(22, 163, 74, .18); --tone-success-fg: #86efac;
  --tone-warning-bg: rgba(217, 119, 6, .2);  --tone-warning-fg: #fcd34d;
  --tone-danger-bg: rgba(220, 38, 38, .2);   --tone-danger-fg: #fca5a5;
  --tone-info-bg: rgba(8, 145, 178, .2);     --tone-info-fg: #67e8f9;
  --tone-primary-bg: rgba(37, 99, 235, .22); --tone-primary-fg: #93c5fd;
  --tone-secondary-bg: #27272a; --tone-secondary-fg: #d4d4d8;
  --tone-dark-bg: #3f3f46;      --tone-dark-fg: #f4f4f5;
  --tone-purple-bg: rgba(124, 58, 237, .25); --tone-purple-fg: #c4b5fd;
}

/* 2. Base ------------------------------------------------------------------ */
html { font-size: 16px; }
body { background: var(--surface-app); color: var(--ink-primary); font-size: .875rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, .h1 { font-size: 1.75rem; } h2, .h2 { font-size: 1.5rem; } h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.0625rem; } h5, .h5 { font-size: .9375rem; } h6, .h6 { font-size: .8125rem; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 600; line-height: 1.3; color: var(--ink-primary); letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .stretched-link:hover, .navbar-brand:hover, a.card:hover, .list-group-item:hover, .no-underline:hover { text-decoration: none; }
.text-muted { color: var(--ink-muted) !important; }
.text-body { color: var(--ink-primary) !important; }
.tabular-nums, .num { font-variant-numeric: tabular-nums; }
.tx-10 { font-size: 10px; } .tx-11 { font-size: 11px; } .tx-12 { font-size: 12px; } .tx-13 { font-size: 13px; } .tx-14 { font-size: 14px; }
.tx-18 { font-size: 18px; } .tx-22 { font-size: 22px; } .tx-24 { font-size: 24px; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; }
.mw-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
::selection { background: rgba(37, 99, 235, .18); }
code { color: #db2777; background: var(--surface-sunken); padding: .1em .35em; border-radius: 4px; font-size: .85em; }

/* buttons */
.btn { --bs-btn-font-size: .875rem; --bs-btn-padding-y: .4375rem; --bs-btn-padding-x: .875rem; --bs-btn-font-weight: 500; --bs-btn-border-radius: var(--border-radius-sm); text-shadow: none; }
.btn-sm { --bs-btn-font-size: .8125rem; --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .55rem; --bs-btn-border-radius: .3125rem; }
.btn-lg { --bs-btn-font-size: 1rem; --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1.1rem; }
.btn-secondary { --bs-btn-color: #fff; --bs-btn-bg: #52525b; --bs-btn-border-color: #52525b; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #3f3f46; --bs-btn-hover-border-color: #3f3f46; --bs-btn-active-bg: #27272a; --bs-btn-active-border-color: #27272a; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: #a1a1aa; --bs-btn-disabled-border-color: #a1a1aa; }
.btn-outline-secondary { --bs-btn-color: var(--ink-secondary); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-color: var(--ink-primary); --bs-btn-hover-bg: var(--surface-hover); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-active-color: var(--ink-primary); --bs-btn-active-bg: var(--surface-hover); --bs-btn-active-border-color: var(--line-strong); }
.btn-light { --bs-btn-color: var(--ink-primary); --bs-btn-bg: var(--surface-panel); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-color: var(--ink-primary); --bs-btn-hover-bg: var(--surface-hover); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-active-color: var(--ink-primary); --bs-btn-active-bg: var(--surface-hover); --bs-btn-active-border-color: var(--line-strong); }
.btn-ghost { --bs-btn-color: var(--ink-secondary); --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-hover-color: var(--ink-primary); --bs-btn-hover-bg: var(--surface-hover); --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: var(--surface-hover); --bs-btn-active-border-color: transparent; }
.btn-icon { width: 2rem; height: 2rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.btn-sm { width: 1.75rem; height: 1.75rem; }

/* forms */
.form-control, .form-select { font-size: .875rem; border-radius: var(--border-radius-sm); border-color: var(--line-strong); padding: .4375rem .75rem; background-color: var(--surface-panel); color: var(--ink-primary); }
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm { font-size: .8125rem; padding-top: .25rem; padding-bottom: .25rem; }
.form-control:focus, .form-select:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
.form-label { font-weight: 500; color: var(--ink-secondary); margin-bottom: .3rem; font-size: .8125rem; }
.form-label .req { color: #dc2626; }
.form-text { color: var(--ink-muted); font-size: .75rem; }
.form-check-input:checked { background-color: #2563eb; border-color: #2563eb; }
.form-section-title { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted); margin: .5rem 0 .75rem; padding-bottom: .4rem; border-bottom: 1px dashed var(--line); }
.input-group-text { background: var(--surface-sunken); border-color: var(--line-strong); color: var(--ink-secondary); font-size: .8125rem; }
input[type="color"].form-control { padding: .2rem; height: 2.25rem; width: 3rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .625rem; align-items: flex-end; }
.filter-bar > div { min-width: 150px; }

/* cards */
.card { background: var(--surface-panel); border: 1px solid var(--line); border-radius: var(--border-radius); box-shadow: none; color: var(--ink-primary); --bs-card-bg: var(--surface-panel); --bs-card-border-color: var(--line); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-weight: 600; }
.card-header h5, .card-title { font-size: .9375rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.card-body { padding: 1rem; }
.card-footer { background: transparent; border-top: 1px solid var(--line); }
.card + .card { margin-top: 1rem; }
.card-interactive { cursor: pointer; transition: border-color .15s, background-color .15s; }
.card-interactive:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.section-gap > * + * { margin-top: 1rem; }

/* tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink-primary); --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--surface-hover); --bs-table-striped-bg: var(--surface-sunken); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .625rem .75rem; }
.table thead th { background: var(--surface-sunken); color: var(--ink-muted); font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line) !important; white-space: nowrap; }
.table td { vertical-align: middle; border-color: var(--line); }
.table .num { text-align: right; white-space: nowrap; }
.table-sm > :not(caption) > * > * { padding: .4rem .6rem; }
.card > .table-responsive > .table thead th:first-child, .card > .table thead th:first-child { border-top-left-radius: var(--border-radius); }

/* dropdowns / modals */
.dropdown-menu { --bs-dropdown-bg: var(--surface-panel); --bs-dropdown-border-color: var(--line); --bs-dropdown-border-radius: var(--border-radius); --bs-dropdown-box-shadow: var(--box-shadow-lg); --bs-dropdown-link-color: var(--ink-primary); --bs-dropdown-link-hover-bg: var(--surface-hover); --bs-dropdown-link-active-bg: var(--surface-hover); --bs-dropdown-link-active-color: var(--ink-primary); --bs-dropdown-font-size: .875rem; box-shadow: var(--box-shadow-lg); padding: .35rem; }
.dropdown-item { border-radius: var(--border-radius-sm); padding: .4rem .65rem; }
.dropdown-item i { width: 1.1rem; color: var(--ink-muted); }
.dropdown-header { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.modal { --bs-modal-bg: var(--surface-panel); --bs-modal-border-color: var(--line); --bs-modal-border-radius: var(--border-radius-lg); --bs-modal-box-shadow: var(--box-shadow-xl); }
.modal-content { box-shadow: var(--box-shadow-xl); }
.modal-header { border-bottom-color: var(--line); padding: .9rem 1.1rem; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-footer { border-top-color: var(--line); }
.modal-backdrop { --bs-backdrop-opacity: .45; }
.offcanvas { --bs-offcanvas-bg: var(--surface-panel); }
.nav-tabs { --bs-nav-tabs-border-color: var(--line); gap: .25rem; }
.nav-tabs .nav-link { color: var(--ink-secondary); font-weight: 500; border: 0; border-bottom: 2px solid transparent; padding: .55rem .8rem; }
.nav-tabs .nav-link:hover { color: var(--ink-primary); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--ink-primary); border-bottom-color: #2563eb; background: transparent; }
.nav-pills .nav-link { color: var(--ink-secondary); border-radius: var(--border-radius-sm); padding: .35rem .75rem; font-weight: 500; }
.nav-pills .nav-link.active { background: var(--surface-hover); color: var(--ink-primary); }
.pagination { --bs-pagination-font-size: .8125rem; --bs-pagination-bg: var(--surface-panel); --bs-pagination-border-color: var(--line); --bs-pagination-color: var(--ink-secondary); --bs-pagination-hover-bg: var(--surface-hover); --bs-pagination-hover-color: var(--ink-primary); --bs-pagination-active-bg: #2563eb; --bs-pagination-active-border-color: #2563eb; margin: 0; }
.progress { --bs-progress-bg: var(--surface-sunken); --bs-progress-height: .5rem; --bs-progress-border-radius: 99px; }
.list-group { --bs-list-group-bg: var(--surface-panel); --bs-list-group-border-color: var(--line); --bs-list-group-color: var(--ink-primary); --bs-list-group-action-hover-bg: var(--surface-hover); }
.alert { border-radius: var(--border-radius); font-size: .875rem; }
.badge { font-weight: 500; border-radius: var(--border-radius-sm); }
.tooltip { --bs-tooltip-font-size: .75rem; }

/* 3. Shell ----------------------------------------------------------------- */
.skip-link { position: absolute; left: -999px; top: 0; z-index: 3000; background: #2563eb; color: #fff; padding: .5rem 1rem; border-radius: 0 0 var(--border-radius-sm) 0; }
.skip-link:focus { left: 0; }
.admin-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; height: var(--header-height); }
.admin-header .navbar { height: 100%; background: var(--surface-panel) !important; border-bottom: 1px solid var(--line); padding: 0; }
.admin-header .navbar > .container-fluid { height: 100%; flex-wrap: nowrap; padding-left: 1rem; padding-right: 1rem; gap: .5rem; }
.admin-header .navbar-brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; margin-right: 0; padding: 0; width: calc(var(--sidebar-width) - 3.75rem); flex-shrink: 0; }
.admin-header .navbar-brand .brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.admin-header .navbar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.admin-header .navbar-brand .brand-name { font-size: 1rem; letter-spacing: -.02em; color: var(--ink-primary); }
.admin-header .navbar-brand .brand-sub { font-size: .625rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }
.hamburger-menu { background: none; border: 0; border-radius: 6px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--ink-secondary); flex-shrink: 0; }
.hamburger-menu:hover { background: var(--surface-hover); color: var(--ink-primary); }
.hamburger-menu i { font-size: 1.05rem; transition: transform .3s cubic-bezier(.25, 1, .5, 1); }
.hamburger-menu.is-active i { transform: rotate(180deg); }
.search-container { max-width: 440px; position: relative; }
.search-container .form-control { background: var(--surface-sunken); border: 1px solid transparent; padding-left: 2.25rem; padding-right: 3.5rem; height: 2.25rem; }
.search-container .form-control:hover { background: var(--surface-hover); }
.search-container .form-control:focus { background: var(--surface-panel); border-color: #93c5fd; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); }
.search-container .search-icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; font-size: .8rem; }
.search-container .search-kbd { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font-size: .6875rem; color: var(--ink-muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 .3rem; pointer-events: none; background: var(--surface-panel); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface-panel); border: 1px solid var(--line); border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); z-index: 1050; max-height: 420px; overflow-y: auto; padding: .35rem; display: none; }
.search-results.show { display: block; }
.search-results a { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: var(--border-radius-sm); color: var(--ink-primary); }
.search-results a:hover, .search-results a.active { background: var(--surface-hover); text-decoration: none; }
.search-results a i { width: 1rem; color: var(--ink-muted); text-align: center; }
.search-results a small { margin-left: auto; color: var(--ink-muted); font-size: .7rem; }
.header-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; flex-shrink: 0; }
.header-actions > .btn, .header-actions > .dropdown > .btn { --bs-btn-color: var(--ink-secondary); --bs-btn-border-color: transparent; --bs-btn-bg: transparent; --bs-btn-hover-color: var(--ink-primary); --bs-btn-hover-bg: var(--surface-hover); --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: var(--surface-hover); --bs-btn-active-border-color: transparent; --bs-btn-active-color: var(--ink-primary); min-width: 2.375rem; height: 2.375rem; padding: .4rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .5rem; position: relative; }
.header-actions > .btn-primary { --bs-btn-color: #fff; --bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1d4ed8; --bs-btn-active-bg: #1e40af; --bs-btn-active-color: #fff; padding: .4rem .8rem; margin-right: .35rem; }
.header-actions .notif-dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: #dc2626; color: #fff; font-size: .6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--surface-panel); }
.header-actions .user-btn { gap: .5rem; padding-left: .4rem !important; padding-right: .6rem !important; margin-left: .375rem; }
.header-actions .user-sep { width: 1px; height: 1.5rem; background: var(--line); margin: 0 .25rem; }
.notif-menu { width: 360px; max-width: calc(100vw - 2rem); padding: 0; }
.notif-menu .notif-head { padding: .75rem 1rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.notif-menu .notif-list { max-height: 380px; overflow-y: auto; }
.notif-menu .notif-item { display: flex; gap: .65rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink-primary); }
.notif-menu .notif-item:hover { background: var(--surface-hover); text-decoration: none; }
.notif-menu .notif-item.unread { background: rgba(37, 99, 235, .05); }
.notif-menu .notif-item.unread .notif-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2563eb; margin-right: 6px; vertical-align: 1px; }
.notif-menu .notif-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-secondary); font-size: .8rem; }
.notif-menu .notif-title { font-weight: 500; font-size: .8125rem; line-height: 1.35; }
.notif-menu .notif-foot { padding: .55rem; text-align: center; }

.admin-sidebar { position: fixed; top: var(--header-height); left: 0; bottom: 0; width: var(--sidebar-width); background: var(--surface-panel); border-right: 1px solid var(--line); z-index: 1035; overflow-y: auto; overflow-x: hidden; transition: transform .3s cubic-bezier(.4, 0, .2, 1), width .3s cubic-bezier(.4, 0, .2, 1); }
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.admin-sidebar .sidebar-content { padding: .75rem .75rem 2rem; }
.sidebar-nav .nav { flex-direction: column; flex-wrap: nowrap; }
.sidebar-nav .nav-link { position: relative; display: flex; align-items: center; color: var(--ink-primary); border-radius: .5rem; padding: .5rem .75rem; margin-bottom: 1px; font-size: .875rem; transition: background-color .12s, color .12s; white-space: nowrap; }
.sidebar-nav .nav-link > i:first-child { width: 1.25rem; margin-right: .7rem; font-size: .95rem; color: var(--ink-muted); text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-link span { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav .nav-link:hover { background: var(--surface-hover); color: var(--bs-emphasis-color); }
.sidebar-nav .nav-link:hover > i:first-child { color: var(--bs-emphasis-color); }
.sidebar-nav .nav-link.active { background: var(--surface-hover); color: var(--ink-primary); font-weight: 600; }
.sidebar-nav .nav-link.active > i:first-child { color: var(--ink-primary); }
.sidebar-nav .nav-link.active::before { content: ""; position: absolute; left: -.75rem; top: .3125rem; bottom: .3125rem; width: 2px; border-radius: 0 2px 2px 0; background: #2563eb; }
.sidebar-nav .nav-link .chev { font-size: .65rem; color: var(--ink-muted); transition: transform .2s; margin-left: .25rem; }
.sidebar-nav .nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sidebar-nav .nav-link .badge { font-size: .65rem; margin-left: .35rem; }
.sidebar-nav .nav-section { display: block; padding: .9rem .75rem .3rem; font-size: .6875rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; color: var(--ink-muted); }
.sidebar-nav .nav-submenu { list-style: none; padding: .15rem 0 .25rem; margin: 0; }
.sidebar-nav .nav-submenu .nav-link { padding: .35rem .75rem .35rem 2.6rem; font-size: .8125rem; color: var(--ink-secondary); font-weight: 400; }
.sidebar-nav .nav-submenu .nav-link::before { display: none; }
.sidebar-nav .nav-submenu .nav-link:hover { background: rgba(37, 99, 235, .06); color: #2563eb; }
.sidebar-nav .nav-submenu .nav-link.active { background: rgba(37, 99, 235, .1); color: #2563eb; font-weight: 500; }
[data-bs-theme="dark"] .sidebar-nav .nav-submenu .nav-link.active, [data-bs-theme="dark"] .sidebar-nav .nav-submenu .nav-link:hover { color: #93c5fd; }
.sidebar-project { display: flex; align-items: center; gap: .55rem; padding: .35rem .75rem .35rem 2.6rem; font-size: .8125rem; color: var(--ink-secondary); border-radius: .5rem; }
.sidebar-project:hover { background: var(--surface-hover); color: var(--ink-primary); text-decoration: none; }
.sidebar-project .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.sidebar-footer { margin: 1rem .25rem 0; padding: .75rem; border: 1px solid var(--line); border-radius: var(--border-radius); font-size: .75rem; color: var(--ink-muted); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 1034; }
.sidebar-backdrop.show { display: block; }

.admin-main { margin-top: var(--header-height); margin-left: var(--sidebar-width); min-height: calc(100vh - var(--header-height)); transition: margin-left .3s cubic-bezier(.4, 0, .2, 1); min-width: 0; overflow-x: clip; display: flex; flex-direction: column; }
.admin-main > .page-wrap { padding: 1.5rem; flex: 1; }
.admin-footer { padding: .9rem 1.5rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--ink-muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.admin-wrapper.sidebar-collapsed .admin-sidebar { width: var(--sidebar-mini-width); }
.admin-wrapper.sidebar-collapsed .admin-sidebar .nav-link { justify-content: center; padding: .65rem .5rem; }
.admin-wrapper.sidebar-collapsed .admin-sidebar .nav-link span, .admin-wrapper.sidebar-collapsed .admin-sidebar .nav-link .badge, .admin-wrapper.sidebar-collapsed .admin-sidebar .nav-link .chev,
.admin-wrapper.sidebar-collapsed .admin-sidebar .nav-section, .admin-wrapper.sidebar-collapsed .admin-sidebar .collapse, .admin-wrapper.sidebar-collapsed .admin-sidebar .sidebar-footer { display: none !important; }
.admin-wrapper.sidebar-collapsed .admin-sidebar .nav-link > i:first-child { margin-right: 0; font-size: 1.05rem; }
.admin-wrapper.sidebar-collapsed .admin-main { margin-left: var(--sidebar-mini-width); }

@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); z-index: 1041; }
  .admin-sidebar.show { transform: translateX(0); box-shadow: 4px 0 16px rgba(0, 0, 0, .15); }
  .admin-main, .admin-wrapper.sidebar-collapsed .admin-main { margin-left: 0; }
  .admin-wrapper.sidebar-collapsed .admin-sidebar { width: var(--sidebar-width); }
  .admin-wrapper.sidebar-collapsed .admin-sidebar .nav-link { justify-content: flex-start; padding: .5rem .75rem; }
  .admin-wrapper.sidebar-collapsed .admin-sidebar .nav-link span, .admin-wrapper.sidebar-collapsed .admin-sidebar .nav-section { display: block !important; }
  .admin-wrapper.sidebar-collapsed .admin-sidebar .collapse.show { display: block !important; }
  .admin-header .navbar-brand { width: auto; }
  .search-container { display: none; }
  .admin-main > .page-wrap { padding: 1rem; }
}
@media (min-width: 992px) {
  .admin-header .hamburger-menu { position: absolute; left: calc(var(--sidebar-width) - 40px - .5rem); top: 50%; transform: translateY(-50%); }
  .admin-header .search-container { margin-left: 1.75rem; }
}
@media (max-width: 575.98px) {
  .admin-header .navbar-brand .brand-text { display: none; }
  .header-actions .user-btn .user-name, .header-actions .hide-xs { display: none !important; }
}

/* page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head .crumbs { font-size: .75rem; color: var(--ink-muted); margin-bottom: .2rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.page-head .crumbs a { color: var(--ink-muted); }
.page-head .crumbs a:hover { color: var(--ink-primary); }
.page-head .crumbs .sep { opacity: .5; }
.page-head h2 { font-size: 1.375rem; font-weight: 600; margin: 0; letter-spacing: -.02em; display: flex; align-items: center; gap: .5rem; }
.page-head .sub { color: var(--ink-muted); margin-top: .15rem; font-size: .8125rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-head .actions .form-select, .page-head .actions .form-control { min-width: 150px; width: auto; }

/* toasts */
.toast-stack { position: fixed; top: calc(var(--header-height) + 12px); right: 16px; z-index: 2000; width: 360px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: .5rem; }
.toast-stack .alert { box-shadow: var(--box-shadow-lg); margin: 0; border: 1px solid var(--line); background: var(--surface-panel); color: var(--ink-primary); padding-left: 2.5rem; position: relative; }
.toast-stack .alert::before { font-family: "Font Awesome 5 Free"; font-weight: 900; position: absolute; left: .95rem; top: .8rem; }
.toast-stack .alert-success::before { content: "\f058"; color: #16a34a; }
.toast-stack .alert-danger::before { content: "\f06a"; color: #dc2626; }
.toast-stack .alert-warning::before { content: "\f071"; color: #d97706; }
.toast-stack .alert-info::before { content: "\f05a"; color: #0891b2; }

/* 4. Components ------------------------------------------------------------ */
.hr-badge { font-weight: 600; font-size: .6875rem; padding: .3em .6em; letter-spacing: .01em; border-radius: 99px; }
.hr-badge-success { background: var(--tone-success-bg); color: var(--tone-success-fg); }
.hr-badge-warning { background: var(--tone-warning-bg); color: var(--tone-warning-fg); }
.hr-badge-danger { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.hr-badge-info { background: var(--tone-info-bg); color: var(--tone-info-fg); }
.hr-badge-primary { background: var(--tone-primary-bg); color: var(--tone-primary-fg); }
.hr-badge-secondary { background: var(--tone-secondary-bg); color: var(--tone-secondary-fg); }
.hr-badge-dark { background: var(--tone-dark-bg); color: var(--tone-dark-fg); }
.hr-badge-purple { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }

.av { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex-shrink: 0; object-fit: cover; line-height: 1; letter-spacing: .02em; vertical-align: middle; }
.av-empty { background: var(--surface-sunken); color: var(--ink-muted); border: 1px dashed var(--line-strong); }
.av-stack { display: inline-flex; align-items: center; }
.av-stack .av { border: 2px solid var(--surface-panel); margin-left: -7px; }
.av-stack .av:first-child { margin-left: 0; }
.av-stack .av-more { background: var(--surface-sunken); color: var(--ink-secondary); font-size: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; background: var(--tone-primary-bg); color: var(--tone-primary-fg); flex-shrink: 0; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; font-size: 28px; }
.person { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.person .name { font-weight: 600; color: var(--ink-primary); line-height: 1.25; }
.person .meta { font-size: .75rem; color: var(--ink-muted); }

.stats-card .card-body, .kpi { padding: 1rem 1.15rem; }
.kpi { height: 100%; display: flex; flex-direction: column; gap: .3rem; position: relative; overflow: hidden; }
.kpi .kpi-label { font-size: .6875rem; color: var(--ink-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; padding-right: 2.75rem; }
.kpi .kpi-value { font-size: 1.625rem; font-weight: 600; color: var(--ink-primary); line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-value.money { font-size: 1.3rem; padding-top: .25rem; }
.kpi .kpi-foot { font-size: .75rem; color: var(--ink-muted); }
.kpi .kpi-icon { position: absolute; right: 1rem; top: 1rem; width: 2.4rem; height: 2.4rem; border-radius: var(--border-radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--surface-sunken); color: var(--ink-secondary); border: 1px solid var(--line); }
.kpi a.stretched-link { color: inherit; }
.tone-danger .kpi-value { color: #dc2626; }
.meter { height: 6px; background: var(--surface-sunken); border-radius: 4px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: #16a34a; border-radius: 4px; }
.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean > li { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.list-clean > li:last-child { border-bottom: 0; }
.empty-state { text-align: center; color: var(--ink-muted); padding: 1.5rem .75rem; font-size: .8125rem; }
.empty-state i { display: block; font-size: 1.6rem; margin-bottom: .4rem; opacity: .45; }
.empty-state.lg { padding: 3rem 1rem; }
.empty-state.lg i { font-size: 2.5rem; }
.date-chip { width: 44px; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 3px 0; line-height: 1.1; flex-shrink: 0; background: var(--surface-panel); }
.date-chip .d { font-size: 16px; font-weight: 700; }
.date-chip .m { font-size: 10px; text-transform: uppercase; color: var(--ink-muted); }
.date-chip.danger { border-color: #fca5a5; color: #dc2626; }
.activity-feed .activity-item { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.activity-feed .activity-item:last-child { border-bottom: 0; }
.activity-feed .activity-content { min-width: 0; font-size: .8125rem; }
.activity-feed .activity-content .what { color: var(--ink-secondary); }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 190px; }
.chart-box.lg { height: 340px; }
.dot-legend { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }

/* select2 → Metis */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple { background: var(--surface-panel); border-color: var(--line-strong); border-radius: var(--border-radius-sm); min-height: 2.25rem; }
.select2-container--default .select2-selection--single { height: 2.25rem; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 2.15rem; color: var(--ink-primary); padding-left: .75rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 2.15rem; }
.select2-container--default.select2-container--focus .select2-selection--multiple, .select2-container--default.select2-container--open .select2-selection--single { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--surface-sunken); border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink-primary); font-size: .8rem; padding: 0 .4rem; margin-top: .3rem; }
.select2-dropdown { background: var(--surface-panel); border-color: var(--line); border-radius: var(--border-radius-sm); box-shadow: var(--box-shadow-lg); color: var(--ink-primary); font-size: .875rem; z-index: 2060; }
.select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: #2563eb; }
.select2-container--default .select2-results__option[aria-selected=true], .select2-container--default .select2-results__option--selected { background: var(--surface-hover); color: var(--ink-primary); }
.select2-container--default .select2-search--dropdown .select2-search__field { background: var(--surface-panel); color: var(--ink-primary); border-color: var(--line-strong); border-radius: 4px; }
.select2-container--default .select2-search--inline .select2-search__field { color: var(--ink-primary); }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--ink-muted); }
/* DataTables */
.dataTables_wrapper { font-size: .8125rem; color: var(--ink-secondary); }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border: 1px solid var(--line-strong); border-radius: 6px; padding: .3rem .6rem; background: var(--surface-panel); color: var(--ink-primary); margin-left: .4rem; }
.dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length { margin-bottom: .75rem; }
.dataTables_wrapper .dataTables_filter { float: right; } .dataTables_wrapper .dataTables_length { float: left; }
.dataTables_wrapper .dataTables_info { float: left; padding-top: .75rem; }
.dataTables_wrapper .dataTables_paginate { float: right; padding-top: .5rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button { padding: .25rem .6rem; border-radius: 6px; cursor: pointer; color: var(--ink-secondary) !important; margin-left: 2px; display: inline-block; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: #2563eb; color: #fff !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .4; cursor: default; }
.dataTables_wrapper::after { content: ""; display: table; clear: both; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { cursor: pointer; position: relative; padding-right: 1.4rem !important; }
table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::after { font-family: "Font Awesome 5 Free"; font-weight: 900; position: absolute; right: .5rem; opacity: .35; font-size: .6rem; }
table.dataTable thead .sorting::after { content: "\f0dc"; } table.dataTable thead .sorting_asc::after { content: "\f0de"; opacity: .8; } table.dataTable thead .sorting_desc::after { content: "\f0dd"; opacity: .8; }

/* 5. HR -------------------------------------------------------------------- */
.welcome { background: linear-gradient(120deg, #1e3a8a 0%, #2563eb 55%, #0891b2 100%); color: #fff; border: 0; }
.welcome h3 { color: #fff; font-weight: 600; margin: 0; font-size: 1.3rem; }
.welcome .muted { color: rgba(255, 255, 255, .8); }
.welcome .btn-light { --bs-btn-bg: #fff; --bs-btn-color: #1e40af; --bs-btn-border-color: #fff; --bs-btn-hover-bg: #eff6ff; --bs-btn-hover-color: #1e40af; }
.welcome .btn-outline-light { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .6); }
.clock { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.register-wrap { overflow-x: auto; }
.register th, .register td { text-align: center; padding: 6px 4px !important; font-size: 12px; min-width: 30px; }
.register td.emp, .register th.emp { text-align: left; min-width: 190px; position: sticky; left: 0; background: var(--surface-panel); z-index: 1; }
.register th.wk { background: var(--surface-sunken); color: var(--ink-muted); }
.att { display: inline-block; min-width: 24px; border-radius: 5px; font-weight: 700; font-size: 11px; padding: 2px 3px; }
.att-present { background: var(--tone-success-bg); color: var(--tone-success-fg); } .att-late { background: var(--tone-warning-bg); color: var(--tone-warning-fg); }
.att-half-day { background: var(--tone-info-bg); color: var(--tone-info-fg); } .att-absent { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.att-on_leave { background: var(--tone-primary-bg); color: var(--tone-primary-fg); } .att-holiday { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.att-weekly_off, .att-unmarked { color: var(--line-strong); } .att-upcoming, .att-not_employed { color: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .75rem; color: var(--ink-muted); }
.profile-head { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .5rem .75rem; font-size: .8125rem; margin: 0; }
.kv dt { color: var(--ink-muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--ink-primary); font-weight: 500; }
.perm-group { border: 1px solid var(--line); border-radius: var(--border-radius); margin-bottom: .9rem; background: var(--surface-panel); }
.perm-group > .perm-group-head { background: var(--surface-sunken); padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-weight: 600; border-radius: var(--border-radius) var(--border-radius) 0 0; }
.perm-module { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; align-items: center; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.perm-module:last-child { border-bottom: 0; }
.perm-module .mod { width: 210px; font-weight: 600; }
.payslip { max-width: 820px; margin: 0 auto; }
.payslip table td, .payslip table th { padding: 6px 10px; }

/* 6. Project management --------------------------------------------------- */
.itype { display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: #fff; flex-shrink: 0; vertical-align: middle; }
.prio { display: inline-flex; align-items: center; gap: .15rem; font-size: .8rem; }
.issue-key { font-size: .75rem; font-weight: 600; color: var(--ink-muted); letter-spacing: .01em; white-space: nowrap; }
a.issue-key:hover { color: #2563eb; }
.issue-key.done { text-decoration: line-through; }
.lozenge { display: inline-block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .2em .55em; border-radius: 4px; white-space: nowrap; line-height: 1.4; }
.lz-todo { background: var(--tone-dark-bg); color: var(--ink-secondary); }
.lz-progress { background: var(--tone-primary-bg); color: var(--tone-primary-fg); }
.lz-done { background: var(--tone-success-bg); color: var(--tone-success-fg); }
.label-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .6875rem; font-weight: 500; padding: .1em .5em; border-radius: 4px; background: var(--surface-sunken); border: 1px solid var(--line); color: var(--ink-secondary); white-space: nowrap; }
.label-chip .sw { width: 7px; height: 7px; border-radius: 2px; }
.epic-chip { display: inline-block; font-size: .6875rem; font-weight: 600; padding: .1em .5em; border-radius: 4px; color: #fff; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.pkey { display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; border-radius: 6px; width: 34px; height: 34px; flex-shrink: 0; letter-spacing: .02em; }
.pkey.sm { width: 22px; height: 22px; border-radius: 5px; font-size: .55rem; }
.pkey.lg { width: 44px; height: 44px; font-size: .8rem; border-radius: 8px; }
.progress-thin { height: 6px; background: var(--surface-sunken); border-radius: 99px; overflow: hidden; display: flex; }
.progress-thin > span { display: block; height: 100%; }
.progress-thin .p-done { background: #16a34a; } .progress-thin .p-prog { background: #2563eb; } .progress-thin .p-todo { background: transparent; }
.mention { background: var(--tone-primary-bg); color: var(--tone-primary-fg); border-radius: 4px; padding: 0 .25em; font-weight: 500; white-space: nowrap; }
.md { font-size: .875rem; line-height: 1.6; word-wrap: break-word; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { font-size: 1rem; margin: 1rem 0 .4rem; } .md h4, .md h5, .md h6 { font-size: .9rem; margin: .8rem 0 .3rem; }
.md ul, .md ol { padding-left: 1.4rem; margin-bottom: .6rem; }
.md p { margin-bottom: .6rem; }
.md pre { background: var(--surface-sunken); padding: .75rem; border-radius: var(--border-radius-sm); font-size: .8rem; border: 1px solid var(--line); }
.md pre code { background: transparent; padding: 0; color: inherit; }
.md blockquote { border-left: 3px solid var(--line-strong); padding-left: .8rem; color: var(--ink-secondary); }
.md table { width: 100%; border-collapse: collapse; margin-bottom: .6rem; } .md td, .md th { border: 1px solid var(--line); padding: .3rem .5rem; }
.md img { max-width: 100%; border-radius: 6px; }

/* project cards */
.project-card { height: 100%; display: flex; flex-direction: column; transition: border-color .15s; }
.project-card:hover { border-color: var(--line-strong); }
.project-card .card-body { display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.project-card .p-title { font-weight: 600; font-size: .9375rem; color: var(--ink-primary); line-height: 1.3; }
.project-card .p-title:hover { color: #2563eb; text-decoration: none; }
.project-card .p-desc { color: var(--ink-muted); font-size: .8125rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.project-card .p-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; font-size: .75rem; }
.project-card .p-meta .k { color: var(--ink-muted); font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; }
.project-card .p-meta .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.project-card .card-footer { display: flex; align-items: center; justify-content: space-between; padding: .65rem 1rem; }
.project-card .stripe { height: 3px; border-radius: var(--border-radius) var(--border-radius) 0 0; }
.scope-tabs .nav-link .count { background: var(--surface-sunken); color: var(--ink-muted); font-size: .7rem; border-radius: 99px; padding: 0 .45rem; margin-left: .3rem; }

/* project sub-navigation */
.project-head { display: flex; align-items: center; gap: .85rem; margin-bottom: .75rem; flex-wrap: wrap; }
.project-head .pt { min-width: 0; }
.project-head h2 { font-size: 1.25rem; margin: 0; font-weight: 600; letter-spacing: -.02em; }
.project-head .crumbs { font-size: .75rem; color: var(--ink-muted); }
.project-head .crumbs a { color: var(--ink-muted); }
.project-tabs { border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.project-tabs::-webkit-scrollbar { display: none; }
.project-tabs a { padding: .55rem .85rem; color: var(--ink-secondary); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: .45rem; margin-bottom: -1px; }
.project-tabs a i { font-size: .8rem; color: var(--ink-muted); }
.project-tabs a:hover { color: var(--ink-primary); text-decoration: none; }
.project-tabs a.active { color: var(--ink-primary); border-bottom-color: #2563eb; }
.project-tabs a.active i { color: #2563eb; }

/* backlog */
.sprint-box { border: 1px solid var(--line); border-radius: var(--border-radius); background: var(--surface-panel); margin-bottom: 1rem; }
.sprint-box.is-active { border-color: #93c5fd; }
.sprint-box > .sprint-head { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sprint-box > .sprint-head .s-name { font-weight: 600; }
.sprint-box > .sprint-head .s-meta { font-size: .75rem; color: var(--ink-muted); }
.sprint-box .pts { display: inline-flex; gap: .25rem; }
.sprint-box .pts span { font-size: .6875rem; font-weight: 700; border-radius: 99px; padding: 0 .45rem; min-width: 1.4rem; text-align: center; }
.issue-list { list-style: none; margin: 0; padding: .25rem; min-height: 2.75rem; }
.issue-row { display: flex; align-items: center; gap: .6rem; padding: .4rem .55rem; border-radius: var(--border-radius-sm); background: var(--surface-panel); border: 1px solid transparent; font-size: .8125rem; cursor: grab; }
.issue-row + .issue-row { border-top-color: var(--line); border-radius: 0; }
.issue-row:hover { background: var(--surface-hover); }
.issue-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-primary); }
.issue-row .t:hover { color: #2563eb; text-decoration: none; }
.issue-row .sp { font-size: .6875rem; font-weight: 600; background: var(--surface-sunken); border-radius: 99px; min-width: 1.6rem; text-align: center; padding: .05rem .4rem; color: var(--ink-secondary); }
.issue-row.done .t { color: var(--ink-muted); text-decoration: line-through; }
.issue-list .empty-drop { padding: .75rem; border: 1px dashed var(--line-strong); border-radius: var(--border-radius-sm); color: var(--ink-muted); text-align: center; font-size: .8125rem; }
.issue-list .ui-sortable-placeholder, .issue-list .sort-ph { visibility: visible !important; background: rgba(37, 99, 235, .06); border: 1px dashed #93c5fd !important; border-radius: var(--border-radius-sm); height: 2.35rem; }
.quick-create { padding: .25rem; }
.quick-create .qc-btn { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; border: 0; background: transparent; padding: .4rem .55rem; border-radius: var(--border-radius-sm); color: var(--ink-muted); font-size: .8125rem; }
.quick-create .qc-btn:hover { background: var(--surface-hover); color: var(--ink-primary); }
.quick-create form { display: none; gap: .4rem; align-items: center; padding: .15rem; }
.quick-create.open .qc-btn { display: none; }
.quick-create.open form { display: flex; }
.epic-panel .epic-item { display: block; padding: .5rem .6rem; border-radius: var(--border-radius-sm); border: 1px solid var(--line); margin-bottom: .4rem; color: var(--ink-primary); font-size: .8125rem; }
.epic-panel .epic-item:hover, .epic-panel .epic-item.active { border-color: var(--line-strong); background: var(--surface-hover); text-decoration: none; }

/* 7. Board ---------------------------------------------------------------- */
.board-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.board-toolbar .form-control, .board-toolbar .form-select { width: auto; }
.board-toolbar .search { width: 200px; }
.board-people .av { cursor: pointer; transition: transform .1s; }
.board-people .av:hover { transform: translateY(-2px); z-index: 2; }
.board-people .av.on { box-shadow: 0 0 0 2px #2563eb; z-index: 3; }
.board-wrap { overflow-x: auto; padding-bottom: .5rem; }
.board { display: grid; column-gap: .75rem; row-gap: 0; min-width: min-content; align-items: stretch; }
.board-col-head { z-index: 2; display: flex; align-items: center; gap: .45rem; padding: .55rem .7rem; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-secondary); background: var(--surface-column); border-radius: var(--border-radius) var(--border-radius) 0 0; border: 1px solid var(--line); border-bottom: 0; position: sticky; top: 0; }
.board-col-head .cnt { background: var(--surface-panel); border: 1px solid var(--line); border-radius: 99px; font-size: .6875rem; padding: 0 .45rem; color: var(--ink-secondary); }
.board-col-head .wip { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; }
.board-col-head.over { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.board-col-head .bar { width: 3px; height: 14px; border-radius: 2px; }
.lane-head { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .8125rem; padding: .6rem .2rem .3rem; border-top: 1px solid var(--line); margin-top: .25rem; }
.lane-head:first-child { border-top: 0; margin-top: 0; }
.lane-head .cnt { color: var(--ink-muted); font-weight: 500; font-size: .75rem; }
.board-col { background: var(--surface-column); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--border-radius) var(--border-radius); padding: .4rem; min-height: 140px; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.board-col.lane-col { border-top: 1px solid var(--line); border-radius: var(--border-radius); min-height: 70px; }
.board-col.drop-over { background: rgba(37, 99, 235, .06); border-color: #93c5fd; }
.board-col.done-col .kcard { opacity: .85; }
.kcard { background: var(--surface-panel); border: 1px solid var(--line); border-radius: var(--border-radius-sm); padding: .6rem .65rem; cursor: grab; box-shadow: 0 1px 1px rgba(9, 9, 11, .04); transition: border-color .12s, box-shadow .12s; position: relative; }
.kcard:hover { border-color: var(--line-strong); box-shadow: 0 2px 6px rgba(9, 9, 11, .07); }
.kcard.ui-sortable-helper { cursor: grabbing; box-shadow: var(--box-shadow-xl); transform: rotate(1.5deg); }
.kcard .k-title { font-size: .8125rem; color: var(--ink-primary); line-height: 1.4; margin-bottom: .45rem; word-break: break-word; display: block; }
.kcard .k-title:hover { color: #2563eb; text-decoration: none; }
.kcard .k-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .45rem; }
.kcard .k-foot { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--ink-muted); flex-wrap: wrap; row-gap: .3rem; }
.kcard .k-foot .sp { font-size: .6875rem; font-weight: 600; background: var(--surface-sunken); border-radius: 99px; min-width: 1.4rem; text-align: center; padding: 0 .35rem; color: var(--ink-secondary); }
.kcard .k-foot .ml-auto { margin-left: auto; }
.kcard .k-foot span { white-space: nowrap; }
.board-toolbar .search { padding-left: 2rem !important; }
.kcard .due { font-size: .6875rem; font-weight: 600; border-radius: 4px; padding: 0 .35rem; background: var(--surface-sunken); color: var(--ink-secondary); }
.kcard .due.overdue { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.kcard .due.soon { background: var(--tone-warning-bg); color: var(--tone-warning-fg); }
.kcard.is-done .k-title { color: var(--ink-muted); }
.kcard .k-flag { position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; }
.kcard-ph { border: 1px dashed #93c5fd; background: rgba(37, 99, 235, .05); border-radius: var(--border-radius-sm); visibility: visible !important; }
.col-add { border: 0; background: transparent; color: var(--ink-muted); font-size: .8125rem; text-align: left; padding: .35rem .45rem; border-radius: var(--border-radius-sm); }
.col-add:hover { background: var(--surface-panel); color: var(--ink-primary); }
.col-add-form textarea { resize: none; font-size: .8125rem; }
.sprint-banner { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: var(--border-radius); background: var(--surface-panel); margin-bottom: 1rem; }
.sprint-banner .goal { color: var(--ink-secondary); font-size: .8125rem; }

/* 8. Issue detail --------------------------------------------------------- */
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 1199.98px) { .issue-layout { grid-template-columns: 1fr; } }
.issue-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; margin: .35rem 0 .75rem; padding: .15rem .35rem; margin-left: -.35rem; border-radius: var(--border-radius-sm); border: 1px solid transparent; }
.issue-title[data-editable]:hover { background: var(--surface-hover); cursor: text; }
.issue-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.issue-section { margin-bottom: 1.5rem; }
.issue-section > .sec-title { font-size: .8125rem; font-weight: 600; margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; }
.issue-section > .sec-title .text-muted { font-weight: 400; }
.desc-box { border: 1px solid transparent; border-radius: var(--border-radius-sm); padding: .4rem .5rem; margin: -.4rem -.5rem; min-height: 2.5rem; }
.desc-box[data-editable]:hover { background: var(--surface-hover); cursor: text; }
.desc-box .placeholder-text { color: var(--ink-muted); font-style: italic; }
.side-panel { border: 1px solid var(--line); border-radius: var(--border-radius); background: var(--surface-panel); }
.side-panel .sp-head { padding: .65rem .9rem; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .8125rem; display: flex; justify-content: space-between; align-items: center; }
.side-panel .sp-body { padding: .5rem .9rem .8rem; }
.field-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: .5rem; align-items: center; padding: .3rem 0; font-size: .8125rem; min-height: 2.1rem; }
.field-row > .fl { color: var(--ink-muted); font-weight: 500; }
.field-row .fv { border-radius: var(--border-radius-sm); padding: .2rem .4rem; margin-left: -.4rem; border: 1px solid transparent; min-height: 1.8rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.field-row .fv[data-field]:hover { background: var(--surface-hover); cursor: pointer; }
.field-row .fv .none { color: var(--ink-muted); }
.field-row .fv.saving { opacity: .5; }
.field-row .fv .form-select, .field-row .fv .form-control { font-size: .8125rem; padding: .2rem .5rem; height: auto; }
.status-btn .dropdown-toggle::after { margin-left: .5rem; }
.subtask-list .st { display: flex; align-items: center; gap: .55rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: var(--border-radius-sm); margin-bottom: .3rem; font-size: .8125rem; background: var(--surface-panel); }
.subtask-list .st .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-primary); }
.comment { display: flex; gap: .7rem; margin-bottom: 1.1rem; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: .8125rem; margin-bottom: .2rem; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.comment .c-head .when { color: var(--ink-muted); font-size: .75rem; }
.comment .c-actions { font-size: .75rem; margin-top: .25rem; display: flex; gap: .75rem; }
.comment .c-actions a, .comment .c-actions button { color: var(--ink-muted); background: none; border: 0; padding: 0; font-size: .75rem; }
.comment .c-actions a:hover, .comment .c-actions button:hover { color: var(--ink-primary); }
.comment-box { border: 1px solid var(--line-strong); border-radius: var(--border-radius); background: var(--surface-panel); }
.comment-box:focus-within { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.comment-box textarea { border: 0; box-shadow: none !important; resize: vertical; min-height: 70px; background: transparent; }
.comment-box .cb-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem .5rem; border-top: 1px solid var(--line); }
.mention-pop { position: absolute; z-index: 2100; background: var(--surface-panel); border: 1px solid var(--line); border-radius: var(--border-radius-sm); box-shadow: var(--box-shadow-lg); min-width: 220px; padding: .25rem; display: none; }
.mention-pop a { display: flex; gap: .5rem; align-items: center; padding: .35rem .5rem; border-radius: 5px; color: var(--ink-primary); font-size: .8125rem; }
.mention-pop a.active, .mention-pop a:hover { background: var(--surface-hover); text-decoration: none; }
.history-item { display: flex; gap: .65rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .8125rem; }
.history-item:last-child { border-bottom: 0; }
.history-item .chg { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .15rem; }
.history-item .old { text-decoration: line-through; color: var(--ink-muted); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.att-tile { border: 1px solid var(--line); border-radius: var(--border-radius-sm); overflow: hidden; background: var(--surface-panel); position: relative; }
.att-tile .thumb { height: 86px; display: flex; align-items: center; justify-content: center; background: var(--surface-sunken); color: var(--ink-muted); font-size: 1.8rem; }
.att-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-tile .meta { padding: .35rem .5rem; font-size: .72rem; }
.att-tile .meta .n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-primary); display: block; }
.att-tile .del { position: absolute; top: 4px; right: 4px; }
.dropzone { border: 1px dashed var(--line-strong); border-radius: var(--border-radius-sm); padding: .9rem; text-align: center; color: var(--ink-muted); font-size: .8125rem; cursor: pointer; }
.dropzone.over { border-color: #2563eb; background: rgba(37, 99, 235, .05); color: #2563eb; }
.time-track .bar { height: 8px; background: var(--surface-sunken); border-radius: 99px; overflow: hidden; display: flex; }
.time-track .bar .spent { background: #2563eb; } .time-track .bar .over { background: #dc2626; } .time-track .bar .rem { background: #93c5fd; opacity: .45; }
.link-row { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--border-radius-sm); margin-bottom: .3rem; font-size: .8125rem; }
.link-group-label { font-size: .75rem; color: var(--ink-muted); margin: .4rem 0 .25rem; font-weight: 500; }
#taskModal .modal-dialog { max-width: 1140px; }
#taskModal .modal-body { padding: 1.25rem 1.5rem; }
#taskModal .modal-loading { min-height: 360px; display: flex; align-items: center; justify-content: center; }

/* 9. Timeline / roadmap --------------------------------------------------- */
.tl { border: 1px solid var(--line); border-radius: var(--border-radius); background: var(--surface-panel); overflow: hidden; }
.tl-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.tl-head { display: contents; }
.tl-head > div { position: sticky; top: 0; background: var(--surface-sunken); border-bottom: 1px solid var(--line); z-index: 2; }
.tl-head .tl-label { padding: .55rem .9rem; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); border-right: 1px solid var(--line); }
.tl-months { display: flex; }
.tl-months > div { border-left: 1px solid var(--line); padding: .55rem .5rem; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); white-space: nowrap; overflow: hidden; }
.tl-months > div:first-child { border-left: 0; }
.tl-row { display: contents; }
.tl-row > .tl-name { padding: .45rem .9rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: .8125rem; min-height: 2.6rem; }
.tl-row > .tl-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-primary); }
.tl-row.child > .tl-name { padding-left: 2.2rem; background: var(--surface-app); }
.tl-row > .tl-track { position: relative; border-bottom: 1px solid var(--line); min-height: 2.6rem; }
.tl-row.child > .tl-track { background: var(--surface-app); }
.tl-track .gridlines { position: absolute; inset: 0; display: flex; pointer-events: none; }
.tl-track .gridlines > div { border-left: 1px solid var(--line); opacity: .6; }
.tl-track .gridlines > div:first-child { border-left: 0; }
.tl-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 1.35rem; border-radius: 5px; color: #fff; font-size: .6875rem; font-weight: 600; display: flex; align-items: center; padding: 0 .5rem; white-space: nowrap; overflow: hidden; min-width: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); z-index: 1; }
.tl-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, .18); z-index: -1; }
.tl-bar.clip-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .tl-bar.clip-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-bar.thin { height: .5rem; top: auto; bottom: .35rem; transform: none; opacity: .5; }
.tl-bar.ghost { background: transparent !important; border: 1.5px dashed var(--line-strong); color: var(--ink-muted); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 3; pointer-events: none; }
.tl-today.lbl::before { content: "Today"; position: absolute; top: 2px; left: 4px; font-size: .6rem; font-weight: 700; color: #dc2626; text-transform: uppercase; }
.tl-diamond { position: absolute; top: 50%; width: 11px; height: 11px; transform: translate(-50%, -50%) rotate(45deg); border-radius: 2px; z-index: 2; border: 2px solid var(--surface-panel); }
.tl-flag { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2; color: #dc2626; font-size: .75rem; }
.tl-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .75rem; color: var(--ink-muted); }

/* 10. Calendar ------------------------------------------------------------ */
.cal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1199.98px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .9rem; }
.cal-toolbar .cal-title { font-size: 1.15rem; font-weight: 600; margin: 0 .5rem; min-width: 190px; letter-spacing: -.01em; }
.cal-sources label { display: flex; align-items: center; gap: .5rem; padding: .3rem .2rem; font-size: .8125rem; cursor: pointer; }
.cal-sources .sw { width: 10px; height: 10px; border-radius: 3px; }
.cal-month { border: 1px solid var(--line); border-radius: var(--border-radius); background: var(--surface-panel); overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-sunken); border-bottom: 1px solid var(--line); }
.cal-dow > div { padding: .45rem .6rem; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); position: relative; border-bottom: 1px solid var(--line); min-height: 118px; }
.cal-week:last-child { border-bottom: 0; }
.cal-day { border-left: 1px solid var(--line); padding: .3rem .4rem; min-width: 0; position: relative; }
.cal-day:first-child { border-left: 0; }
.cal-day .dn { font-size: .75rem; font-weight: 600; color: var(--ink-secondary); width: 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.other { background: var(--surface-app); }
.cal-day.other .dn { color: var(--ink-muted); opacity: .6; }
.cal-day.weekend { background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(113, 113, 122, .035) 6px, rgba(113, 113, 122, .035) 12px); }
.cal-day.today .dn { background: #2563eb; color: #fff; }
.cal-day.can-add:hover { background: var(--surface-hover); cursor: copy; }
.cal-ev-layer { position: absolute; left: 0; right: 0; top: 2rem; bottom: 0; pointer-events: none; }
.cal-ev { position: absolute; height: 1.3rem; font-size: .6875rem; font-weight: 500; border-radius: 4px; padding: 0 .4rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3rem; pointer-events: auto; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.cal-ev:hover { filter: brightness(.94); text-decoration: none; color: #fff; }
.cal-ev.dot-ev { background: transparent !important; color: var(--ink-primary); padding-left: .2rem; }
.cal-ev.dot-ev::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: 0; }
.cal-ev.dot-ev:hover { background: var(--surface-hover) !important; color: var(--ink-primary); }
.cal-ev.done { opacity: .55; text-decoration: line-through; }
.cal-ev.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .cal-ev.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-more { position: absolute; font-size: .6875rem; color: var(--ink-secondary); font-weight: 600; pointer-events: auto; cursor: pointer; padding: 0 .35rem; }
.cal-more:hover { color: #2563eb; }
.cal-list .cl-day { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.cal-list .cl-day:last-child { border-bottom: 0; }
.cal-list .cl-date { font-weight: 600; font-size: .8125rem; }
.cal-list .cl-date small { display: block; color: var(--ink-muted); font-weight: 400; }
.cal-list .cl-ev { display: flex; gap: .6rem; align-items: center; padding: .25rem 0; font-size: .8125rem; color: var(--ink-primary); }
.cal-list .cl-ev .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.cal-list .cl-ev .src { margin-left: auto; font-size: .7rem; color: var(--ink-muted); white-space: nowrap; }
.ev-pop { position: absolute; z-index: 2050; width: 320px; background: var(--surface-panel); border: 1px solid var(--line); border-radius: var(--border-radius); box-shadow: var(--box-shadow-xl); padding: .9rem 1rem; display: none; }
.ev-pop .ep-title { font-weight: 600; margin-bottom: .35rem; padding-right: 1.5rem; }
.ev-pop dl { display: grid; grid-template-columns: 90px 1fr; gap: .2rem .5rem; font-size: .8125rem; margin: .5rem 0; }
.ev-pop dt { color: var(--ink-muted); font-weight: 500; } .ev-pop dd { margin: 0; }
.ev-pop .close-pop { position: absolute; right: .6rem; top: .6rem; }
.mini-cal { font-size: .75rem; }
.mini-cal table { width: 100%; text-align: center; }
.mini-cal td, .mini-cal th { padding: .15rem 0; }
.mini-cal th { color: var(--ink-muted); font-weight: 600; font-size: .65rem; }
.mini-cal td a { display: inline-flex; width: 1.6rem; height: 1.6rem; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink-primary); }
.mini-cal td a:hover { background: var(--surface-hover); text-decoration: none; }
.mini-cal td a.today { background: #2563eb; color: #fff; }
.mini-cal td a.other { color: var(--ink-muted); opacity: .5; }
.mini-cal td a.has::after { content: ""; position: absolute; }

/* 11. Big screen (TV) ----------------------------------------------------- */
body.tv { background: #09090b; color: #f4f4f5; font-size: 15px; overflow-x: hidden; --surface-panel: #18181b; --surface-sunken: #111113; --surface-app: #09090b; --surface-hover: #27272a; --line: #27272a; --line-strong: #3f3f46; --ink-primary: #f4f4f5; --ink-secondary: #a1a1aa; --ink-muted: #8b8b94; }
.tv-wrap { padding: 1.25rem 1.5rem; height: 100vh; display: flex; flex-direction: column; gap: 1rem; overflow: hidden; }
.tv-side { display: flex; flex-direction: column; gap: 1rem; min-height: 0; overflow: hidden; }
.tv-main > .tv-panel { min-height: 0; overflow: hidden; }
.tv-top { display: flex; align-items: center; gap: 1.5rem; }
.tv-top .brand { display: flex; align-items: center; gap: .75rem; }
.tv-top .brand h1 { font-size: 1.5rem; margin: 0; color: #fff; letter-spacing: -.02em; }
.tv-top .brand small { color: #a1a1aa; display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.tv-top .clock { margin-left: auto; text-align: right; font-size: 2.2rem; line-height: 1; color: #fff; }
.tv-top .clock small { display: block; font-size: .85rem; color: #a1a1aa; font-weight: 500; margin-top: .3rem; }
.tv-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; }
.tv-kpi { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: .85rem 1rem; }
.tv-kpi .l { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #a1a1aa; font-weight: 600; }
.tv-kpi .v { font-size: 2.1rem; font-weight: 700; color: #fff; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tv-kpi.danger .v { color: #f87171; } .tv-kpi.ok .v { color: #4ade80; } .tv-kpi.warn .v { color: #fbbf24; }
.tv-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1rem; flex: 1; min-height: 0; }
.tv-panel { background: #18181b; border: 1px solid #27272a; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.tv-panel > h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #a1a1aa; padding: .75rem 1rem; margin: 0; border-bottom: 1px solid #27272a; display: flex; align-items: center; gap: .5rem; }
.tv-tl { display: grid; grid-template-columns: 290px minmax(0, 1fr); font-size: .9rem; }
.tv-tl .h { background: #111113; border-bottom: 1px solid #27272a; padding: .45rem .75rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #8b8b94; font-weight: 600; }
.tv-tl .weeks { display: flex; background: #111113; border-bottom: 1px solid #27272a; }
.tv-tl .weeks > div { flex: 1; border-left: 1px solid #27272a; font-size: .66rem; color: #8b8b94; padding: .45rem .3rem; text-align: center; white-space: nowrap; overflow: hidden; }
.tv-tl .weeks > div.month-start { color: #e4e4e7; font-weight: 700; }
.tv-tl .nm { padding: .55rem .75rem; border-bottom: 1px solid #1f1f23; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.tv-tl .nm .t { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.tv-tl .nm .s { font-size: .72rem; color: #8b8b94; }
.tv-tl .tr { position: relative; border-bottom: 1px solid #1f1f23; min-height: 3.25rem; }
.tv-tl .tr .gl { position: absolute; inset: 0; display: flex; }
.tv-tl .tr .gl > div { flex: 1; border-left: 1px solid #1c1c20; }
.tv-tl .tr .gl > div.wkend { background: rgba(255, 255, 255, .012); }
.tv-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 1.7rem; border-radius: 6px; overflow: hidden; display: flex; align-items: center; padding: 0 .55rem; font-size: .75rem; font-weight: 700; color: #fff; white-space: nowrap; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset; }
.tv-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .22); }
.tv-bar span { position: relative; }
.tv-bar.overdue { outline: 2px solid #f87171; outline-offset: 1px; }
.tv-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #f87171; box-shadow: 0 0 10px rgba(248, 113, 113, .7); z-index: 3; }
.tv-mark { position: absolute; top: 50%; transform: translate(-50%, -50%) rotate(45deg); width: 13px; height: 13px; border-radius: 2px; background: #fbbf24; border: 2px solid #18181b; z-index: 2; }
.tv-mark.rel { background: #4ade80; }
.tv-list { overflow: hidden; }
.tv-list .it { display: flex; gap: .75rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid #1f1f23; }
.tv-list .it .dt { width: 52px; text-align: center; flex-shrink: 0; border-radius: 8px; background: #111113; border: 1px solid #27272a; padding: .2rem 0; line-height: 1.1; }
.tv-list .it .dt b { display: block; font-size: 1.15rem; color: #fff; }
.tv-list .it .dt small { font-size: .62rem; text-transform: uppercase; color: #a1a1aa; letter-spacing: .05em; }
.tv-list .it .dt.today { border-color: #2563eb; background: rgba(37, 99, 235, .2); }
.tv-list .it .dt.late { border-color: #f87171; background: rgba(248, 113, 113, .12); }
.tv-list .it .tt { min-width: 0; }
.tv-list .it .tt .a { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-list .it .tt .b { font-size: .75rem; color: #a1a1aa; }
.tv-ticker { background: #18181b; border: 1px solid #27272a; border-radius: 12px; overflow: hidden; white-space: nowrap; padding: .6rem 0; font-size: .95rem; }
.tv-ticker .track { display: inline-block; padding-left: 100%; animation: tv-ticker 60s linear infinite; }
.tv-ticker .track span { margin-right: 3rem; color: #e4e4e7; }
.tv-ticker .track b { color: #f87171; margin-right: .4rem; }
@keyframes tv-ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.tv-controls { position: fixed; right: 1rem; bottom: 1rem; display: flex; gap: .4rem; opacity: .15; transition: opacity .2s; z-index: 50; }
.tv-controls:hover { opacity: 1; }
@media (max-width: 1400px) { .tv-main { grid-template-columns: 1fr; } .tv-kpis { grid-template-columns: repeat(3, 1fr); } .tv-tl { grid-template-columns: 200px minmax(0, 1fr); } }

/* 12. Auth / print / misc ------------------------------------------------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-app); }
.auth-page .auth-art { background: radial-gradient(1200px 600px at 10% 10%, #1d4ed8 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #0891b2 0%, transparent 60%), #0b1220; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-page .auth-art h1 { color: #fff; font-size: 2.1rem; letter-spacing: -.03em; line-height: 1.15; max-width: 480px; }
.auth-page .auth-art p { color: rgba(255, 255, 255, .75); max-width: 460px; }
.auth-page .auth-art .feat { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; max-width: 520px; }
.auth-page .auth-art .feat div { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; padding: .8rem .9rem; font-size: .8125rem; color: rgba(255, 255, 255, .85); }
.auth-page .auth-art .feat i { color: #93c5fd; margin-right: .4rem; }
.auth-page .auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-page .auth-card { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .auth-page { grid-template-columns: 1fr; } .auth-page .auth-art { display: none; } }

@media print {
  .no-print, .admin-header, .admin-sidebar, .admin-footer, .toast-stack, .project-tabs { display: none !important; }
  .admin-main { margin: 0 !important; }
  .admin-main > .page-wrap { padding: 0 !important; }
  body { background: #fff; }
  .card { border: 0; }
}
