    /* ── Reset & Base ─────────────────────────── */
    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 'Inter', 'Noto Sans TC', system-ui, -apple-system, 'Segoe UI', sans-serif;
      font-size: 14px;
      color: #111827;
      background: linear-gradient(135deg, #e8ecf4 0%, #f0f2f5 40%, #e5e9f0 100%);
      min-height: 100vh;
      width: 100%;
      max-width: 100vw;
      overflow-x: hidden;
    }

    html,
    #app {
      width: 100%;
      max-width: 100vw;
      overflow-x: hidden;
    }

    button {
      cursor: pointer;
      font-family: inherit;
      font-size: inherit;
      border: none;
      background: none;
    }

    input,
    select {
      font-family: inherit;
      font-size: inherit;
    }

    .hidden {
      display: none !important;
    }

    /* ── CSS Variables ────────────────────────── */
    :root {
      --nav-bg: #1e3a5f;
      --nav-active: #2563eb;
      --table-header-bg: #f3f4f6;
      --weekend-bg: #fff1f2;
      --data-cell-bg: #eff6ff;
      --data-cell-text: #1d4ed8;
      --slot-sep: #cbd5e1;
      --label-col-w: 80px;
      --date-col-min: 46px;
      --row-h: 26px;
      --table-fs: 12px;
      --modal-w: 380px;
      --modal-r: 16px;
      --toast-ok-bg: #d1fae5;
      --toast-ok-text: #065f46;
      --toast-err-bg: #fee2e2;
      --toast-err-text: #991b1b;
      --toast-warn-bg: #fef3c7;
      --toast-warn-text: #92400e;
    }

    /* ── Navbar ───────────────────────────────── */
    #navbar {
      background: linear-gradient(135deg, #0f2b4a 0%, #1e3a5f 60%, #1a3358 100%);
      display: flex;
      align-items: center;
      padding: 0 24px;
      height: 56px;
      gap: 4px;
      width: 100%;
      max-width: 100vw;
      min-width: 0;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.15);
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-brand {
      color: #fff;
      font-weight: 700;
      font-size: 15px;
      margin-right: 20px;
      white-space: nowrap;
      letter-spacing: 0.02em;
    }

    .nav-tab,
    .nav-password {
      color: rgba(255, 255, 255, 0.72);
      background: transparent;
      border: 0;
      padding: 8px 18px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      font-family: inherit;
      line-height: 1.2;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
      letter-spacing: 0.02em;
      position: relative;
    }

    .nav-tab:hover,
    .nav-password:hover {
      background: rgba(255, 255, 255, 0.12);
      color: #fff;
      transform: translateY(-1px);
    }

    .nav-tab.active {
      background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
      color: #fff;
      box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
    }

    /* ── Page Layout ──────────────────────────── */
    .page {
      padding: 24px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      animation: pageIn 0.3s ease-out;
    }

    .page-header {
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
      flex-wrap: wrap;
      min-height: 120px;
      margin-bottom: 22px;
      background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 48%, rgba(232, 242, 255, 0.96) 100%);
      border: 1px solid #dce8f7;
      border-radius: 18px;
      padding: 28px 32px;
      box-shadow: 0 18px 46px rgba(30, 58, 95, 0.10);
    }

    .page-header-main {
      position: relative;
      z-index: 1;
      min-width: 280px;
      flex: 1;
    }

    .page-eyebrow {
      color: #5f7fa5;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0;
      margin-bottom: 5px;
    }

    .page-title {
      color: #102a43;
      font-size: 30px;
      font-weight: 900;
      line-height: 1.25;
      letter-spacing: 0;
    }

    .page-subtitle {
      color: #5f7088;
      font-size: 14px;
      font-weight: 750;
      margin-top: 8px;
      line-height: 1.5;
    }

    .page-header-meta {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 10px;
    }

    .page-actions {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
      margin-left: auto;
    }

    .page-metric,
    .page-muted {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      padding: 3px 9px;
    }

    .page-metric {
      color: #1f4b7a;
      background: #eef4fb;
      border: 1px solid #d5e2f0;
    }

    .page-muted {
      color: #64748b;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
    }

    @keyframes pageIn {
      from {
        opacity: 0;
        transform: translateY(8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ── Leave Page ───────────────────────────── */
    .leave-header {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      margin-bottom: 20px;
      flex-wrap: wrap;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.88));
      backdrop-filter: blur(12px);
      border-radius: 14px;
      padding: 18px 24px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.8);
      position: relative;
      overflow: hidden;
    }

    .leave-header::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, #2563eb, #7c3aed, #2563eb);
      background-size: 200% 100%;
      animation: shimmer 3s ease infinite;
    }

    @keyframes shimmer {

      0%,
      100% {
        background-position: 0% 0;
      }

      50% {
        background-position: 100% 0;
      }
    }

    .leave-title {
      font-size: 18px;
      font-weight: 800;
      color: #0f2b4a;
      line-height: 1.3;
      letter-spacing: -0.01em;
    }

    .leave-cycle-text {
      font-size: 12px;
      color: #6b7280;
      margin-top: 4px;
      font-weight: 500;
    }

    .month-nav {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-left: auto;
      align-self: center;
    }

    .month-nav-btn {
      padding: 6px 16px;
      border: 1.5px solid #d1d5db;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      background: linear-gradient(135deg, #fff, #f9fafb);
      color: #374151;
      transition: all 0.2s ease;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .month-nav-btn:hover {
      background: linear-gradient(135deg, #eff6ff, #dbeafe);
      border-color: #93c5fd;
      color: #1d4ed8;
      transform: translateY(-1px);
      box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
    }

    /* ── Leave Table Container ────────────────── */
    #leave-table-wrap {
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
      border-radius: 14px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
      width: 100%;
      max-width: 100%;
      min-width: 0;
      overflow: hidden;
      border: 1px solid rgba(0, 0, 0, 0.04);
      contain: inline-size;
    }

    #leave-table-container {
      display: block;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      overflow-x: auto;
      overflow-y: visible;
      overscroll-behavior-x: contain;
      scrollbar-gutter: stable;
    }

    /* ── Leave Table ──────────────────────────── */
    #leave-table {
      border-collapse: collapse;
      table-layout: fixed;
      font-size: var(--table-fs);
      white-space: nowrap;
      min-width: 100%;
    }

    #leave-table th {
      background: linear-gradient(180deg, #edf1f9 0%, #e2e8f4 100%);
      border-right: 1px solid #cdd5e4;
      border-bottom: 2px solid #b8c6df;
      padding: 0 2px;
      font-weight: 700;
      text-align: center;
      position: sticky;
      top: 0;
      z-index: 3;
      user-select: none;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #leave-table th.label-col {
      width: var(--label-col-w);
      min-width: var(--label-col-w);
      left: 0;
      z-index: 4;
      background: linear-gradient(180deg, #d8e0ef 0%, #ccd5e8 100%);
      border-right: 2px solid #b0bdd6;
    }

    #leave-table th.date-col {
      min-width: var(--date-col-min);
      width: var(--date-col-min);
      line-height: 1.25;
      padding: 5px 2px;
      font-size: 11px;
    }

    #leave-table th.weekend-col {
      background: #f5dde0;
    }

    #leave-table th.today-col {
      background: #1e40af !important;
      color: #fff;
    }

    /* Table body cells */
    #leave-table td {
      border-right: 1px solid #e5e9f0;
      border-bottom: 1px solid #e5e9f0;
      height: var(--row-h);
      padding: 0 3px;
      text-align: center;
      vertical-align: middle;
      overflow: hidden;
      text-overflow: ellipsis;
      background: #fff;
    }

    #leave-table td.label-col {
      width: var(--label-col-w);
      min-width: var(--label-col-w);
      position: sticky;
      left: 0;
      background: #f1f5fb;
      z-index: 2;
      text-align: center;
      font-weight: 700;
      color: #374151;
      padding: 0 4px;
      font-size: 11px;
      letter-spacing: 0.03em;
      border-right: 2px solid #c0cade;
    }

    #leave-table td.weekend-col {
      background: #fef6f7;
    }

    #leave-table td.today-col {
      border-left: 2px solid #3b82f6;
      border-right: 2px solid #3b82f6;
    }

    #leave-table td.today-col:not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy):not(.incomplete) {
      background: #eff6ff;
    }

    #leave-table td.today-col.weekend-col:not(.data-emp):not(.data-shift-colored):not(.data-leave-colored) {
      background: #fef6f7;
    }

    /* Filled data cells */
    #leave-table td.data-emp {
      font-weight: 700;
      font-size: 12px;
      color: #1a1a2e;
      text-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.06);
    }

    #leave-table td.data-field {
      background: var(--data-cell-bg);
      color: var(--data-cell-text);
      font-weight: 600;
      font-size: 11px;
    }

    #leave-table td.data-shift-colored {
      font-weight: 700;
      font-size: 11px;
      border-radius: 0;
    }

    #leave-table td.data-leave-colored {
      font-weight: 700;
      font-size: 11px;
      border-radius: 0;
    }

    #leave-table td.data-proxy {
      background: #f0fdf4;
      color: #166534;
      font-size: 11px;
      font-weight: 600;
    }

    #leave-table td.data-no-proxy {
      background: #f9fafb;
      color: #9ca3af;
      font-size: 10px;
      font-style: italic;
    }

    /* ── Slot background tinting (each slot = one leave record) ── */
    /* Slot 0: subtle indigo tint */
    #leave-table tbody tr[data-slot="0"] td:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
      background: #f5f3ff;
    }

    #leave-table tbody tr[data-slot="0"] td.weekend-col:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
      background: #ede9fe;
    }

    /* Slot 1: subtle sky-blue tint */
    #leave-table tbody tr[data-slot="1"] td:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
      background: #f0f9ff;
    }

    #leave-table tbody tr[data-slot="1"] td.weekend-col:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
      background: #e0f2fe;
    }

    /* Slot 2: subtle emerald tint */
    #leave-table tbody tr[data-slot="2"] td:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
      background: #f0fdf4;
    }

    #leave-table tbody tr[data-slot="2"] td.weekend-col:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
      background: #dcfce7;
    }

    /* Slot label accent bars — thicker & more vivid */
    #leave-table td.label-col[data-slot="0"] {
      border-left: 4px solid #6366f1;
      background: linear-gradient(90deg, #eef2ff 0%, #f5f3ff 100%);
      color: #4338ca;
    }

    #leave-table td.label-col[data-slot="1"] {
      border-left: 4px solid #0ea5e9;
      background: linear-gradient(90deg, #e0f4ff 0%, #f0f9ff 100%);
      color: #0369a1;
    }

    #leave-table td.label-col[data-slot="2"] {
      border-left: 4px solid #10b981;
      background: linear-gradient(90deg, #e6faf3 0%, #f0fdf4 100%);
      color: #047857;
    }

    /* Bottom border on row-4 (proxy_lower) = end of a slot group */
    #leave-table tbody tr[data-slot="0"][data-row-end] td,
    #leave-table tbody tr[data-slot="1"][data-row-end] td,
    #leave-table tbody tr[data-slot="2"][data-row-end] td {
      border-bottom: 2px solid rgba(0, 0, 0, 0.12);
    }

    /* Slot separator row — bold coloured divider between cards */
    #leave-table tr.slot-sep td {
      border-top: 0;
      background: #e2e8f0 !important;
      height: 5px;
      padding: 0;
      box-shadow: inset 0 2px 0 #64748b;
    }

    #leave-table tr.slot-sep td.label-col {
      background: #d1dae8 !important;
      box-shadow: inset 0 2px 0 #64748b;
    }

    /* Slot 1 separator: sky accent (slot-after=1) */
    #leave-table tr.slot-sep[data-slot-after="1"] td {
      background: #dbeafe !important;
      box-shadow: inset 0 2px 0 #0ea5e9;
    }

    #leave-table tr.slot-sep[data-slot-after="1"] td.label-col {
      background: #bfdbfe !important;
      box-shadow: inset 0 2px 0 #0ea5e9;
    }

    /* Slot 2 separator: emerald accent (slot-after=2) */
    #leave-table tr.slot-sep[data-slot-after="2"] td {
      background: #d1fae5 !important;
      box-shadow: inset 0 2px 0 #10b981;
    }

    #leave-table tr.slot-sep[data-slot-after="2"] td.label-col {
      background: #a7f3d0 !important;
      box-shadow: inset 0 2px 0 #10b981;
    }

    /* Short leave row */
    #leave-table tr.short-sep td {
      height: 0;
      padding: 0;
      border: none;
      background: transparent !important;
    }

    #leave-table tr.short-sep td.label-col {
      background: transparent !important;
      border: none;
    }

    #leave-table tr.short-row td {
      background: #faf5ff;
      height: auto;
      min-height: 30px;
      padding: 4px 3px;
      border-top: 2px dashed #c4b5fd;
    }

    #leave-table tr.short-row td.label-col {
      background: linear-gradient(90deg, #f3e8ff 0%, #faf5ff 100%);
      border-left: 4px solid #7c3aed;
      border-top: 2px dashed #c4b5fd;
      font-size: 11px;
      font-weight: 700;
      color: #6d28d9;
      letter-spacing: 0.03em;
    }

    .short-chips-cell {
      display: flex;
      flex-wrap: wrap;
      gap: 3px;
      justify-content: center;
      align-items: center;
    }

    .short-chip {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      gap: 1px;
      padding: 2px 5px;
      border-radius: 8px;
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
      border: 1px solid rgba(0, 0, 0, 0.08);
      line-height: 1.3;
      max-width: 44px;
      overflow: hidden;
    }

    .short-chip .chip-name {
      font-size: 10px;
      font-weight: 700;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    .short-chip .chip-type {
      font-size: 9px;
      font-weight: 600;
      opacity: 0.85;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    .short-chip:hover {
      opacity: 0.82;
    }

    .short-add-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #ede9fe;
      color: #7c3aed;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      border: 1px dashed #7c3aed;
      transition: background 0.15s;
    }

    .short-add-btn:hover {
      background: #ddd6fe;
    }

    /* Clickable cells */
    #leave-table td.clickable {
      cursor: pointer;
    }

    #leave-table td.clickable:hover {
      outline: 2px solid #93c5fd;
      outline-offset: -2px;
      z-index: 1;
      position: relative;
    }

    /* Incomplete / unfilled required field */
    #leave-table td.incomplete {
      color: #f97316;
      font-size: 10px;
      font-style: italic;
      cursor: pointer;
    }

    #leave-table td.incomplete:hover {
      background: #fff7ed;
      outline: 2px solid #fb923c;
      outline-offset: -2px;
    }

    /* ── View Switcher Bar ────────────────────── */
    .cycle-toolbar,
    .leave-view-bar {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
      margin-bottom: 16px;
      background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
      border-radius: 10px;
      padding: 6px;
      box-shadow: 0 1px 6px rgba(0,0,0,0.04);
      border: 1px solid #e0e7ff;
    }
    .cycle-toolbar {
      justify-content: space-between;
    }
    .cycle-toolbar-tabs,
    .leave-view-tabs {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
    }
    .cycle-toolbar-label {
      padding: 0 10px;
      color: #64748b;
      font-size: 12px;
      font-weight: 850;
    }
    .cycle-tab-btn,
    .lv-view-btn {
      padding: 8px 20px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      color: #64748b;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .cycle-tab-btn:hover,
    .lv-view-btn:hover { background: #edf3f9; color: #183a5d; }
    .cycle-tab-btn.active,
    .lv-view-btn.active {
      background: var(--nav-bg);
      color: #fff;
      box-shadow: 0 2px 10px rgba(30, 58, 95, 0.18);
    }
    .month-strip {
      display: block;
      flex: 1 1 620px;
      margin-left: auto;
      max-width: 100%;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      overscroll-behavior-x: contain;
      scrollbar-width: thin;
      scrollbar-gutter: stable;
    }
    .month-strip-track {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 4px;
      width: max-content;
      min-width: max-content;
      margin-left: auto;
    }
    .month-strip-btn {
      width: 44px;
      min-width: 44px;
      flex: 0 0 44px;
      height: 30px;
      min-height: 30px;
      padding: 0;
      border: 1px solid #d6dee8;
      border-radius: 8px;
      background: #f8fafc;
      color: #334155;
      font-size: 12px;
      font-weight: 850;
      letter-spacing: 0;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }
    .month-strip-btn:hover {
      background: #edf3f9;
      border-color: #bfd0e5;
      color: #183a5d;
    }
    .month-strip-btn.active {
      background: var(--nav-bg);
      border-color: var(--nav-bg);
      color: #fff;
      cursor: default;
    }
    .month-focus-btn {
      width: 36px;
      min-width: 36px;
      flex-basis: 36px;
      margin-right: 6px;
      border-color: #bfd0e5;
      background: #eff6ff;
      color: #1d4ed8;
      font-size: 14px;
    }
    .month-focus-btn:hover {
      background: #dbeafe;
      border-color: #93c5fd;
      color: #1e3a5f;
    }
    .month-focus-btn.active {
      background: #dbeafe;
      border-color: #93c5fd;
      color: #1e3a5f;
    }
    .leave-view-panel { animation: pageIn 0.25s ease-out; }

    /* ── Section Labels (vertical left headers) ── */
    #leave-table th.section-col {
      width: 36px;
      min-width: 36px;
      background: linear-gradient(180deg, #0f2b4a 0%, #1e3a5f 100%);
      border-right: 2px solid rgba(255,255,255,0.1);
      position: sticky;
      left: 0;
      z-index: 5;
    }
    #leave-table td.section-label {
      width: 36px;
      min-width: 36px;
      position: sticky;
      left: 0;
      z-index: 3;
      text-align: center;
      vertical-align: middle;
      padding: 8px 4px;
      border-right: 2px solid rgba(0,0,0,0.08);
      writing-mode: vertical-rl;
      text-orientation: upright;
      letter-spacing: 0.15em;
    }
    #leave-table td.section-label .section-label-text {
      writing-mode: vertical-rl;
      text-orientation: upright;
      font-weight: 800;
      font-size: 13px;
      letter-spacing: 0.2em;
      line-height: 1;
    }
    #leave-table td.section-label .section-label-sub {
      writing-mode: vertical-rl;
      text-orientation: upright;
      font-size: 9px;
      font-weight: 600;
      margin-top: 6px;
      opacity: 0.65;
      letter-spacing: 0.05em;
      line-height: 1;
    }
    #leave-table td.section-proxy {
      background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
      color: #92400e;
      border-right: 3px solid #f59e0b;
    }
    #leave-table td.section-noproxy {
      background: linear-gradient(180deg, #ede9fe 0%, #ddd6fe 100%);
      color: #5b21b6;
      border-right: 3px solid #7c3aed;
      border-top: 2px solid #7c3aed;
    }

    /* Adjust label-col sticky left for the section column */
    #leave-table th.label-col {
      left: 36px;
    }
    #leave-table td.label-col {
      left: 36px;
    }

    /* ── Calendar View ────────────────────────── */
    .lv-cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 2px;
      background: #e0e7ff;
      border-radius: 14px;
      overflow: hidden;
      box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    }
    .lv-cal-head {
      background: linear-gradient(180deg, #1e3a5f, #162c47);
      color: #fff;
      font-weight: 700;
      font-size: 13px;
      text-align: center;
      padding: 10px 4px;
    }
    .lv-cal-head.lv-cal-wk { background: #3d1a2e; }
    .lv-cal-cell {
      background: #fff;
      min-height: 90px;
      padding: 6px;
      position: relative;
      cursor: default;
      transition: background 0.15s;
    }
    .lv-cal-cell:hover { background: #f5f7ff; }
    .lv-cal-cell.lv-cal-wk { background: #fdf8f9; }
    .lv-cal-cell.lv-cal-today {
      background: #eff6ff;
      box-shadow: inset 0 3px 0 #2563eb;
    }
    .lv-cal-cell.lv-cal-other { background: #f8fafc; opacity: 0.35; min-height: 40px; }
    .lv-cal-day { font-size: 14px; font-weight: 700; color: #374151; margin-bottom: 4px; }
    .lv-cal-cell.lv-cal-today .lv-cal-day { color: #1d4ed8; }
    .lv-cal-count {
      position: absolute; top: 6px; right: 6px;
      background: #ef4444; color: #fff;
      font-size: 9px; font-weight: 800;
      width: 18px; height: 18px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
    }
    .lv-cal-tags { display: flex; flex-direction: column; gap: 2px; }
    .lv-cal-tag {
      display: block;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ── List View ────────────────────────────── */
    .lv-list-bar {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .lv-list-bar select, .lv-list-bar input {
      padding: 8px 14px;
      border-radius: 8px;
      border: 1.5px solid #d1d5db;
      font-size: 12px;
      font-family: inherit;
      background: #fff;
      transition: border-color 0.2s;
    }
    .lv-list-bar select:focus, .lv-list-bar input:focus {
      border-color: #6366f1;
      outline: none;
      box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
    }
    .lv-list-tbl {
      width: 100%;
      min-width: 760px;
      border-collapse: collapse;
      background: #fff;
      border-radius: 14px;
      overflow: hidden;
      box-shadow: 0 2px 16px rgba(0,0,0,0.06);
      border: 1px solid rgba(0,0,0,0.04);
    }
    .lv-list-tbl th {
      background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
      padding: 10px 12px;
      text-align: left;
      font-size: 12px;
      font-weight: 700;
      color: #475569;
      border-bottom: 2px solid #cbd5e1;
    }
    .lv-list-tbl td {
      padding: 10px 12px;
      font-size: 12px;
      border-bottom: 1px solid #f1f5f9;
    }
    .lv-list-tbl tr:hover td { background: #f5f7ff; }
    .lv-list-emp {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 6px;
      font-weight: 700;
      font-size: 12px;
    }
    .lv-list-warn { color: #d97706; font-weight: 600; }
    .lv-list-status {
      display: inline-block;
      padding: 3px 12px;
      border-radius: 12px;
      font-size: 10px;
      font-weight: 700;
    }
    .lv-st-ok { background: #dcfce7; color: #166534; }
    .lv-st-warn { background: #fef3c7; color: #92400e; }
    .lv-st-pend { background: #f3f4f6; color: #6b7280; }

    /* Calendar legend */
    .lv-cal-legend {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 12px;
      padding: 10px 16px;
      background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
      border-radius: 10px;
      border: 1px solid #e0e7ff;
      box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }
    .lv-cal-legend-title { font-size: 14px; font-weight: 800; color: #1e1b4b; }
    .lv-cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #475569; }
    .lv-cal-legend-dot { width: 10px; height: 10px; border-radius: 3px; }

    /* Calendar personal highlights */
    .lv-cal-cell.lv-cal-myleave { background: #fffbeb !important; box-shadow: inset 0 0 0 2px #f59e0b; }
    .lv-cal-cell.lv-cal-myproxy { background: #eff6ff !important; box-shadow: inset 0 0 0 2px #2563eb; }
    .lv-cal-cell.lv-cal-myleave.lv-cal-myproxy { box-shadow: inset 3px 0 0 #f59e0b, inset -3px 0 0 #2563eb; }

    .lv-cal-tag-leave {
      background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
      color: #92400e !important;
      font-weight: 700;
    }
    .lv-cal-tag-proxy {
      background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
      color: #1e40af !important;
      font-weight: 700;
    }
    .lv-cal-tag-pending {
      border: 1.5px dashed #9ca3af;
    }

    .lv-cal-empty {
      text-align: center;
      padding: 30px 20px;
      color: #94a3b8;
      font-size: 14px;
      margin-top: 12px;
    }

    /* List view role badges */
    .lv-list-legend {
      font-size: 15px;
      font-weight: 800;
      color: #1e1b4b;
      margin-bottom: 12px;
      padding: 10px 16px;
      background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
      border-radius: 10px;
      border: 1px solid #e0e7ff;
      box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }
    .lv-list-role {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 6px;
      font-weight: 700;
      font-size: 11px;
    }
    .lv-role-leave { background: #fef3c7; color: #92400e; }
    .lv-role-proxy { background: #dbeafe; color: #1e40af; }

    .lv-list-stats {
      display: flex;
      gap: 20px;
      margin-top: 12px;
      padding: 10px 16px;
      background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
      border-radius: 10px;
      border: 1px solid #e0e7ff;
      font-size: 13px;
      color: #374151;
      font-weight: 500;
    }
    .lv-list-stats b { color: #1e1b4b; }
    .lv-list-stats-warn { color: #d97706; font-weight: 700; }

    /* ── Proxy Action Buttons (all views) ───── */
    .proxy-action-btns {
      display: inline-flex;
      gap: 2px;
      margin-left: 2px;
      vertical-align: middle;
    }
    .proxy-accept-btn, .proxy-reject-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 800;
      cursor: pointer;
      border: none;
      transition: transform 0.1s, box-shadow 0.1s;
      line-height: 1;
    }
    .proxy-accept-btn {
      background: #dcfce7;
      color: #166534;
    }
    .proxy-accept-btn:hover {
      background: #bbf7d0;
      transform: scale(1.15);
      box-shadow: 0 2px 6px rgba(22,101,52,0.2);
    }
    .proxy-reject-btn {
      background: #fee2e2;
      color: #991b1b;
    }
    .proxy-reject-btn:hover {
      background: #fecaca;
      transform: scale(1.15);
      box-shadow: 0 2px 6px rgba(153,27,27,0.2);
    }

    /* Calendar view small action buttons */
    .proxy-accept-btn-sm, .proxy-reject-btn-sm {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 15px;
      height: 15px;
      border-radius: 3px;
      font-size: 9px;
      font-weight: 800;
      cursor: pointer;
      border: none;
      transition: transform 0.1s;
      margin-left: 2px;
      vertical-align: middle;
    }
    .proxy-accept-btn-sm { background: #dcfce7; color: #166534; }
    .proxy-accept-btn-sm:hover { background: #bbf7d0; transform: scale(1.2); }
    .proxy-reject-btn-sm { background: #fee2e2; color: #991b1b; }
    .proxy-reject-btn-sm:hover { background: #fecaca; transform: scale(1.2); }

    /* Calendar two-line tags */
    .lv-cal-tag {
      display: flex;
      flex-direction: column;
      gap: 1px;
      padding: 3px 6px;
    }
    .lv-cal-tag-line1 {
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .lv-cal-tag-line2 {
      font-size: 9px;
      font-weight: 600;
      opacity: 0.8;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* List view actions column */
    .lv-list-actions {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
    }
    .lv-list-actions .proxy-accept-btn,
    .lv-list-actions .proxy-reject-btn {
      width: auto;
      height: auto;
      padding: 3px 8px;
      font-size: 11px;
      border-radius: 6px;
      gap: 3px;
    }

    /* ── Cell Picker Popover ──────────────────── */
    .cell-popover {
      position: fixed;
      z-index: 600;
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
      border: 1px solid #e5e7eb;
      min-width: 260px;
      max-width: 340px;
      overflow: hidden;
      animation: cpIn 0.13s ease-out;
    }

    @keyframes cpIn {
      from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .cp-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 9px 12px 7px;
      background: #f8fafc;
      border-bottom: 1px solid #f0f0f0;
    }

    .cp-title {
      font-size: 11px;
      font-weight: 700;
      color: #6b7280;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .cp-close {
      font-size: 14px;
      color: #9ca3af;
      padding: 1px 5px;
      border-radius: 4px;
      line-height: 1;
    }

    .cp-close:hover {
      background: #e5e7eb;
      color: #374151;
    }

    .cp-body {
      padding: 10px 10px 8px;
    }

    .cp-group-label {
      font-size: 10px;
      font-weight: 700;
      color: #9ca3af;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      padding: 4px 2px 2px;
      margin-top: 4px;
      border-top: 1px solid #f3f4f6;
    }

    .cp-group-label:first-child {
      border-top: none;
      margin-top: 0;
    }

    .cp-group-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin-bottom: 2px;
    }

    .cp-btn {
      padding: 7px 5px;
      border: 2px solid transparent;
      border-radius: 7px;
      font-size: 12px;
      font-weight: 600;
      text-align: center;
      cursor: pointer;
      transition: transform 0.08s, border-color 0.1s, opacity 0.1s;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .cp-btn:hover:not(:disabled) {
      transform: scale(1.04);
    }

    .cp-btn.cp-sel {
      border-color: #1d4ed8 !important;
      box-shadow: 0 0 0 1px #1d4ed8;
    }

    .cp-btn:disabled {
      opacity: 0.28;
      cursor: not-allowed;
      transform: none;
      text-decoration: line-through;
    }

    .cp-shift-btn {
      background: #dbeafe;
      color: #1e40af;
    }

    .cp-leave-btn {
      background: #d1fae5;
      color: #065f46;
    }

    .cp-none-btn {
      background: #f3f4f6;
      color: #374151;
    }

    .cp-none-btn.cp-sel {
      border-color: #6b7280 !important;
      box-shadow: 0 0 0 1px #6b7280;
    }

    .cp-clear-btn {
      background: #fff7ed;
      color: #c2410c;
      grid-column: span 2;
      font-size: 11px;
      border-radius: 6px;
      padding: 5px;
    }

    .cp-clear-btn:hover {
      background: #ffedd5;
    }

    .cp-footer {
      padding: 6px 10px 10px;
      border-top: 1px solid #f3f4f6;
    }

    .cp-del-btn {
      width: 100%;
      padding: 7px;
      background: #fee2e2;
      color: #991b1b;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
    }

    .cp-del-btn:hover {
      background: #fecaca;
    }

    /* Short leave picker extra */
    .cp-hours-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid #f3f4f6;
    }

    .cp-hours-label {
      font-size: 11px;
      color: #6b7280;
      font-weight: 600;
    }

    .cp-hours-input {
      width: 80px;
      padding: 5px 8px;
      border: 1.5px solid #d1d5db;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      text-align: center;
      outline: none;
    }

    .cp-hours-input:focus {
      border-color: #7c3aed;
      box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
    }

    .cp-save-btn {
      padding: 6px 14px;
      background: #7c3aed;
      color: #fff;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
    }

    .cp-save-btn:hover {
      background: #6d28d9;
    }

    /* ── Modal (overtime + short leave) ──────── */
    #modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.45);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }

    #modal-box {
      background: #fff;
      width: var(--modal-w);
      max-width: 95vw;
      border-radius: var(--modal-r);
      max-height: 90vh;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 20px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    }

    .modal-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: 700;
      font-size: 15px;
      margin-bottom: 16px;
      color: #1e3a5f;
    }

    .modal-close {
      font-size: 20px;
      color: #9ca3af;
      padding: 2px 6px;
      border-radius: 4px;
    }

    .modal-close:hover {
      background: #f3f4f6;
      color: #374151;
    }

    .modal-footer {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px solid #e5e7eb;
      align-items: center;
    }

    .btn-delete {
      margin-right: auto;
      background: #fee2e2;
      color: #991b1b;
      padding: 7px 14px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
    }

    .btn-delete:hover {
      background: #fecaca;
    }

    .btn-cancel {
      background: #f3f4f6;
      color: #374151;
      padding: 7px 14px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
    }

    .btn-cancel:hover {
      background: #e5e7eb;
    }

    .btn-confirm {
      background: #2563eb;
      color: #fff;
      padding: 7px 16px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
    }

    .btn-confirm:hover:not(:disabled) {
      background: #1d4ed8;
    }

    .btn-confirm:disabled {
      background: #dbeafe;
      color: rgba(255, 255, 255, 0.9);
      cursor: not-allowed;
    }

    .modal-error {
      color: #ef4444;
      font-size: 12px;
      margin-top: 6px;
      min-height: 16px;
      font-weight: 500;
    }

    .app-dialog-overlay {
      position: fixed;
      inset: 0;
      z-index: 2600;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(15, 23, 42, 0.45);
    }

    .app-dialog-box {
      width: min(420px, calc(100vw - 32px));
      background: #fff;
      border-radius: 16px;
      padding: 20px;
      box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    }

    .app-dialog-title {
      color: #1e3a5f;
      font-size: 16px;
      font-weight: 800;
      margin-bottom: 10px;
    }

    .app-dialog-message {
      color: #334155;
      font-size: 14px;
      line-height: 1.6;
      white-space: pre-line;
    }

    .app-dialog-field {
      display: grid;
      gap: 8px;
      margin-top: 14px;
      color: #475569;
      font-size: 13px;
      font-weight: 700;
    }

    .app-dialog-input {
      min-height: 92px;
      resize: vertical;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      padding: 10px 12px;
      color: #0f172a;
      font: inherit;
      line-height: 1.5;
      outline: none;
    }

    .app-dialog-input:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }

    .app-dialog-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 18px;
      padding-top: 14px;
      border-top: 1px solid #e5e7eb;
    }

    .app-dialog-actions .btn-delete {
      margin-right: 0;
    }

    #modal-box.password-modal-box {
      width: 440px;
      padding: 22px;
    }

    .password-modal-body {
      display: grid;
      gap: 14px;
    }

    .password-target-card {
      display: grid;
      gap: 3px;
      padding: 14px 16px;
      border: 1px solid #d8e4f2;
      border-radius: 12px;
      background: #f8fbff;
    }

    .password-target-card span,
    .password-field label {
      color: #64748b;
      font-size: 12px;
      font-weight: 800;
    }

    .password-target-card strong {
      color: #102a43;
      font-size: 18px;
      font-weight: 900;
    }

    .password-target-card small {
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
    }

    .password-field {
      display: grid;
      gap: 7px;
    }

    .password-field input {
      width: 100%;
      padding: 11px 12px;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      background: #fff;
      color: #102a43;
      outline: none;
      font-weight: 700;
    }

    .password-field input:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    }

    .password-hint {
      padding: 10px 12px;
      border-radius: 10px;
      background: #f8fafc;
      color: #64748b;
      font-size: 12px;
      line-height: 1.5;
    }

    .password-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      width: fit-content;
      color: #334155;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
      user-select: none;
    }

    .password-toggle input {
      width: 16px;
      height: 16px;
      accent-color: #2563eb;
      cursor: pointer;
    }

    /* ── Toast ────────────────────────────────── */
    #toast {
      position: fixed;
      bottom: 28px;
      left: 50%;
      transform: translateX(-50%);
      padding: 10px 24px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      z-index: 2000;
      pointer-events: none;
      transition: opacity 0.3s;
      white-space: nowrap;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }

    #toast.ok {
      background: var(--toast-ok-bg);
      color: var(--toast-ok-text);
    }

    #toast.err {
      background: var(--toast-err-bg);
      color: var(--toast-err-text);
    }

    #toast.warn {
      background: var(--toast-warn-bg);
      color: var(--toast-warn-text);
    }

    /* ── Overtime Page ────────────────────────── */
    .ot-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
      flex-wrap: wrap;
      background: #fff;
      border-radius: 10px;
      padding: 14px 18px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    .ot-title {
      font-size: 16px;
      font-weight: 700;
      color: #1e3a5f;
    }

    .ot-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 16px;
    }

    .ot-summary-chip {
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 20px;
      padding: 4px 14px;
      font-size: 12px;
      color: #374151;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .ot-summary-chip.warn {
      background: #fff7ed;
      border-color: #f97316;
      color: #c2410c;
      font-weight: 600;
    }

    .ot-summary-chip.block {
      background: #fee2e2;
      border-color: #ef4444;
      color: #991b1b;
      font-weight: 600;
    }

    .ot-card {
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      overflow: hidden;
    }

    .ot-table-wrap {
      overflow-x: auto;
    }

    .table-scroll-wrap,
    .ot-table-wrap,
    .info-table-wrap,
    .report-table-wrap,
    .db-rec-table-wrap {
      max-width: 100%;
      min-width: 0;
      contain: inline-size;
      overscroll-behavior-x: contain;
      scrollbar-gutter: stable;
    }

    #leave-calendar-container,
    #leave-list-container,
    #leave-footer-container,
    .lv-cal-grid,
    .lf-groups-row,
    .month-strip {
      max-width: 100%;
      min-width: 0;
    }

    .table-scroll-wrap {
      width: 100%;
      overflow-x: auto;
      overflow-y: visible;
    }

    .ot-table-wrap,
    .info-table-wrap,
    .report-table-wrap {
      width: 100%;
    }

    .ot-table {
      border-collapse: collapse;
      width: 100%;
      font-size: 13px;
    }

    .ot-table th {
      background: #e8edf5;
      border: 1px solid #d1d9e6;
      padding: 7px 10px;
      text-align: center;
      font-weight: 700;
      font-size: 12px;
      white-space: nowrap;
    }

    .ot-table td {
      border: 1px solid #e5e7eb;
      padding: 6px 10px;
      vertical-align: middle;
      white-space: nowrap;
    }

    .ot-table td:nth-child(1),
    .ot-table td:nth-child(2),
    .ot-table td:nth-child(3),
    .ot-table td:nth-child(4),
    .ot-table td:nth-child(6),
    .ot-table td:nth-child(7),
    .ot-table td:nth-child(8) {
      text-align: center;
    }

    .ot-table td:nth-child(5),
    .ot-table td:nth-child(9) {
      text-align: left;
    }

    .ot-table tr:nth-child(even) td {
      background: #f9fafb;
    }

    .ot-table tr:hover td {
      background: #eff6ff;
    }

    .ot-table td.ot-empty {
      color: #9ca3af;
      font-style: italic;
    }

    .ot-btn {
      padding: 4px 11px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
    }

    .ot-btn-fill {
      background: #dbeafe;
      color: #1e40af;
    }

    .ot-btn-fill:hover {
      background: #bfdbfe;
    }

    .ot-btn-edit {
      background: #fef3c7;
      color: #92400e;
    }

    .ot-btn-edit:hover {
      background: #fde68a;
    }

    .ot-empty-state {
      text-align: center;
      padding: 48px;
      color: #9ca3af;
      font-size: 14px;
    }

    .ot-modal-info {
      background: #f3f4f6;
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 13px;
      margin-bottom: 14px;
      line-height: 1.8;
      color: #374151;
    }

    .ot-modal-info strong {
      color: #1e3a5f;
    }

    .ot-field {
      margin-bottom: 12px;
    }

    .ot-field label {
      display: block;
      font-size: 12px;
      font-weight: 600;
      color: #374151;
      margin-bottom: 4px;
    }

    .ot-field input {
      width: 100%;
      padding: 7px 10px;
      border: 1px solid #d1d5db;
      border-radius: 6px;
      font-size: 14px;
      outline: none;
      transition: border-color 0.15s;
    }

    .ot-field input:focus {
      border-color: var(--nav-active);
    }

    .ot-comp-preview {
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      border-radius: 6px;
      padding: 8px 14px;
      font-size: 13px;
      margin-bottom: 12px;
    }

    .ot-comp-preview span {
      font-weight: 700;
      color: #1d4ed8;
      font-size: 16px;
    }

    .ot-cap-warn {
      border-radius: 6px;
      padding: 8px 12px;
      font-size: 12px;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .ot-cap-warn.warn {
      background: #fff7ed;
      color: #c2410c;
      border: 1px solid #fed7aa;
    }

    .ot-cap-warn.block {
      background: #fee2e2;
      color: #991b1b;
      border: 1px solid #fca5a5;
    }

    /* ── Admin Page ───────────────────────────── */
    .admin-card {
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      padding: 20px;
    }

    .admin-tabs {
      display: flex;
      gap: 4px;
      border-bottom: 2px solid #e5e7eb;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }

    .admin-tab-btn {
      padding: 8px 18px;
      font-size: 13px;
      font-weight: 600;
      color: #6b7280;
      border-bottom: 2px solid transparent;
      margin-bottom: -2px;
      border-radius: 4px 4px 0 0;
      transition: color 0.15s;
    }

    .admin-tab-btn:hover {
      color: #374151;
      background: #f3f4f6;
    }

    .admin-tab-btn.active {
      color: var(--nav-active);
      border-bottom-color: var(--nav-active);
    }

    .admin-subtabs {
      display: flex;
      gap: 10px;
      margin: 0 0 22px;
      padding: 8px;
      background: #f1f5f9;
      border: 1px solid #d8e1ec;
      border-radius: 10px;
      width: 100%;
      max-width: 100%;
      flex-wrap: wrap;
    }

    .admin-subtab-btn {
      min-width: 150px;
      padding: 11px 16px;
      border: 1px solid #d3dde8;
      border-radius: 8px;
      background: #fff;
      color: #475569;
      font-size: 14px;
      font-weight: 800;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .admin-subtab-btn:hover {
      background: #eef4fb;
      border-color: #bfd0e5;
      color: #183a5d;
    }

    .admin-subtab-btn.active {
      background: #1e3a5f;
      border-color: #1e3a5f;
      color: #fff;
      box-shadow: 0 8px 18px rgba(30, 58, 95, 0.18);
    }

    .admin-section-title {
      font-size: 15px;
      font-weight: 700;
      color: #1e3a5f;
      margin-bottom: 16px;
    }

    .admin-list {
      list-style: none;
    }

    .admin-list-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      margin-bottom: 6px;
      background: #fafafa;
      transition: background 0.1s;
    }

    .admin-list-item:hover {
      background: #f0f4ff;
    }

    .color-swatch {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 1px solid rgba(0, 0, 0, 0.1);
      flex-shrink: 0;
    }

    .item-name {
      flex: 1;
      font-weight: 500;
      color: #1f2937;
    }

    .item-code {
      background: #e5e7eb;
      border-radius: 4px;
      padding: 2px 8px;
      font-size: 11px;
      color: #374151;
      font-family: monospace;
      font-weight: 600;
    }

    .item-sub {
      font-size: 12px;
      color: #9ca3af;
    }

    .admin-order-btns {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .admin-order-btn {
      font-size: 10px;
      padding: 2px 6px;
      background: #e5e7eb;
      border-radius: 3px;
      color: #374151;
      line-height: 1.4;
    }

    .admin-order-btn:hover {
      background: #d1d5db;
    }

    .admin-order-btn:disabled {
      opacity: 0.3;
      cursor: default;
    }

    .admin-del-btn {
      padding: 4px 12px;
      background: #fee2e2;
      color: #991b1b;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
    }

    .admin-del-btn:hover {
      background: #fecaca;
    }

    .admin-add-row {
      display: flex;
      gap: 8px;
      margin-top: 14px;
      align-items: center;
      flex-wrap: wrap;
      padding-top: 14px;
      border-top: 1px solid #e5e7eb;
    }

    .admin-input {
      flex: 1;
      min-width: 120px;
      padding: 7px 10px;
      border: 1px solid #d1d5db;
      border-radius: 6px;
      font-size: 13px;
      outline: none;
      background: #fff;
    }

    .admin-input:focus {
      border-color: var(--nav-active);
    }

    .admin-add-btn {
      padding: 7px 18px;
      background: var(--nav-active);
      color: #fff;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
    }

    .admin-add-btn:hover {
      background: #1d4ed8;
    }

    /* ── Employee Info Table ─────────────────── */
    .info-table-wrap {
      overflow-x: auto;
    }

    .info-table {
      border-collapse: collapse;
      width: 100%;
      font-size: 13px;
    }

    .info-table th {
      background: #e8edf5;
      border: 1px solid #d1d9e6;
      padding: 8px 12px;
      text-align: left;
      font-weight: 700;
      font-size: 12px;
      white-space: nowrap;
    }

    .info-table td {
      border: 1px solid #e5e7eb;
      padding: 7px 12px;
      vertical-align: middle;
      white-space: nowrap;
    }

    .info-table tr:nth-child(even) td {
      background: #f9fafb;
    }

    .info-table tr:hover td {
      background: #eff6ff;
    }

    /* ── Groups / Drag-and-Drop ──────────────── */
    .grp-pool {
      background: #f8fafc;
      border: 2px dashed #d1d5db;
      border-radius: 10px;
      padding: 14px;
      margin-bottom: 18px;
      min-height: 60px;
      transition: border-color 0.2s, background 0.2s;
    }

    .grp-pool.drag-over {
      border-color: #93c5fd;
      background: #eff6ff;
    }

    .grp-pool-title {
      font-size: 12px;
      font-weight: 700;
      color: #6b7280;
      margin-bottom: 10px;
      letter-spacing: 0.05em;
    }

    .grp-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      min-height: 32px;
    }

    .grp-chip {
      padding: 5px 12px;
      border-radius: 16px;
      font-size: 12px;
      font-weight: 600;
      cursor: grab;
      user-select: none;
      transition: transform 0.1s, box-shadow 0.1s, opacity 0.15s;
      border: 2px solid rgba(0, 0, 0, 0.06);
      color: #1a1a2e;
      position: relative;
    }

    .grp-chip:hover {
      transform: scale(1.05);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    .grp-chip.dragging {
      opacity: 0.4;
      transform: scale(0.95);
    }

    /* In-card chip: sortable within group */
    .grp-card-body .grp-chip {
      cursor: grab;
    }

    .grp-card-body .grp-chip.drag-over-top {
      border-top: 2px solid #2563eb;
    }

    .grp-card-body .grp-chip.drag-over-bot {
      border-bottom: 2px solid #2563eb;
    }

    .grp-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }

    .grp-card {
      border-radius: 10px;
      border: 2px solid #e5e7eb;
      overflow: hidden;
      transition: border-color 0.2s, background 0.2s;
      background: #fff;
    }

    .grp-card.drag-over {
      border-color: #93c5fd;
      background: #f0f7ff;
    }

    .grp-card-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 14px;
      font-weight: 700;
      font-size: 13px;
      color: #1f2937;
      border-bottom: 1px solid #e5e7eb;
      cursor: grab;
    }

    .grp-card-header:active {
      cursor: grabbing;
    }

    .grp-color-dot {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      border: 1px solid rgba(0, 0, 0, 0.1);
      flex-shrink: 0;
    }

    .grp-card-body {
      padding: 10px 12px;
      min-height: 50px;
    }

    .grp-card-body .grp-chips {
      flex-direction: column;
      align-items: stretch;
    }

    .grp-card-body .grp-chip {
      text-align: center;
    }

    .grp-empty-hint {
      color: #9ca3af;
      font-size: 11px;
      font-style: italic;
      padding: 8px 0;
      text-align: center;
    }

    .grp-card-actions {
      display: flex;
      gap: 4px;
      margin-left: auto;
    }

    .grp-card-action-btn {
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 4px;
      color: #6b7280;
      background: #f3f4f6;
    }

    .grp-card-action-btn:hover {
      background: #e5e7eb;
      color: #374151;
    }

    .grp-card-action-btn.del:hover {
      background: #fee2e2;
      color: #991b1b;
    }

    .grp-add-row {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    /* Group card drag-to-reorder */
    .grp-card.grp-drag-over-left {
      border-left: 3px solid #2563eb;
    }

    .grp-card.grp-drag-over-right {
      border-right: 3px solid #2563eb;
    }

    .grp-card.grp-reordering {
      opacity: 0.45;
      box-shadow: none;
    }

    /* ── Types table (假別/班別) ─────────────── */
    .types-table {
      border-collapse: collapse;
      width: 100%;
      font-size: 13px;
    }

    .types-table th {
      background: #e8edf5;
      border: 1px solid #d1d9e6;
      padding: 8px 12px;
      text-align: left;
      font-weight: 700;
      font-size: 12px;
      white-space: nowrap;
    }

    .types-table td {
      border: 1px solid #e5e7eb;
      padding: 6px 10px;
      vertical-align: middle;
    }

    .types-table tr.dragging-row {
      opacity: 0.3;
    }

    .types-table tr.drag-over-top td {
      border-top: 2px solid #2563eb;
    }

    .types-table tr.drag-over-bot td {
      border-bottom: 2px solid #2563eb;
    }

    .types-table tr:nth-child(even) td {
      background: #f9fafb;
    }

    .types-table tr:hover td {
      background: #eff6ff;
    }

    .drag-handle {
      cursor: grab;
      color: #9ca3af;
      font-size: 16px;
      padding: 0 4px;
      user-select: none;
    }

    .drag-handle:active {
      cursor: grabbing;
    }

    .color-pill {
      display: inline-block;
      width: 60px;
      height: 20px;
      border-radius: 4px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      vertical-align: middle;
      cursor: pointer;
    }

    /* ── Sortable info-table headers ─────────── */
    .info-table th.sortable {
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }

    .info-table th.sortable:hover {
      background: #dce6f5;
    }

    .sort-arrow {
      margin-left: 4px;
      font-size: 10px;
      opacity: 0.5;
    }

    .info-table th.sort-asc .sort-arrow,
    .info-table th.sort-desc .sort-arrow {
      opacity: 1;
      color: #2563eb;
    }

    /* ── Report ───────────────────────────────── */
    .report-section {
      margin-bottom: 28px;
    }

    .report-toolbar {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      padding: 18px 20px;
      margin-bottom: 14px;
      border: 1px solid #dbe5f1;
      border-radius: 12px;
      background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
    }

    .report-toolbar-main {
      min-width: 220px;
    }

    .report-kicker,
    .report-block-kicker {
      color: #5f7fa5;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0;
      text-transform: uppercase;
    }

    .report-title {
      color: #102a43;
      font-size: 24px;
      font-weight: 850;
      line-height: 1.25;
      margin-top: 2px;
    }

    .report-period {
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
      margin-top: 6px;
    }

    .report-toolbar-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .report-stat-row {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 10px;
      margin-bottom: 22px;
    }

    .report-stat {
      min-height: 74px;
      padding: 12px 14px;
      border: 1px solid #dbe5f1;
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    }

    .report-stat-label {
      display: block;
      color: #64748b;
      font-size: 12px;
      font-weight: 800;
      margin-bottom: 5px;
    }

    .report-stat-value {
      color: #102a43;
      font-size: 25px;
      font-weight: 850;
      line-height: 1.1;
      font-variant-numeric: tabular-nums;
    }

    .report-stat-value small {
      color: #94a3b8;
      font-size: 13px;
      font-weight: 800;
      margin-left: 4px;
    }

    .report-panel {
      padding: 16px;
      border: 1px solid #dbe5f1;
      border-radius: 12px;
      background: #fff;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
    }

    .report-subtitle {
      font-size: 13px;
      font-weight: 700;
      color: #102a43;
      margin-bottom: 10px;
      padding-bottom: 5px;
      border-bottom: 1px solid #dbe5f1;
    }

    .report-overview-section {
      display: grid;
      gap: 18px;
      margin: 18px 0 34px;
    }

    .report-overview-block {
      padding: 18px;
      border: 1px solid #dbe5f1;
      border-radius: 14px;
      background: #fff;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    }

    .report-block-heading {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 16px;
    }

    .report-block-title {
      color: #102a43;
      font-size: 18px;
      font-weight: 850;
      margin-top: 3px;
    }

    .report-block-total {
      flex: 0 0 auto;
      min-width: 96px;
      padding: 8px 12px;
      border-radius: 999px;
      background: #eef4fb;
      color: #1f4b7a;
      font-size: 16px;
      font-weight: 850;
      text-align: center;
      font-variant-numeric: tabular-nums;
    }

    .report-overview-grid {
      display: grid;
      grid-template-columns: minmax(320px, 520px) minmax(360px, 1fr);
      align-items: center;
      gap: 28px;
    }

    .report-summary-wrap {
      width: 100%;
    }

    .report-summary-table {
      width: 100%;
      border: 1px solid #cbd7e6;
      border-collapse: separate;
      border-spacing: 0;
      border-radius: 9px;
      table-layout: fixed;
      background: #fff;
      color: #0f172a;
      font-family: "Noto Sans TC", Inter, sans-serif;
      overflow: hidden;
    }

    .report-summary-table th,
    .report-summary-table td {
      border-right: 1px solid #dbe5f1;
      border-bottom: 1px solid #dbe5f1;
      padding: 5px 8px;
      line-height: 1.25;
    }

    .report-summary-table th:last-child,
    .report-summary-table td:last-child {
      border-right: 0;
    }

    .report-summary-table tbody tr:last-child td {
      border-bottom: 0;
    }

    .report-summary-table th {
      background: #f1f6fb;
      color: #102a43;
      text-align: center;
      font-size: 18px;
      font-weight: 800;
    }

    .report-summary-table td {
      font-size: 15px;
      font-weight: 650;
    }

    .report-summary-table td:first-child {
      width: 48%;
    }

    .report-summary-table td:nth-child(2) {
      text-align: center;
    }

    .report-summary-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .report-summary-dot {
      width: 9px;
      height: 9px;
      border-radius: 999px;
      flex: 0 0 auto;
    }

    .report-summary-num,
    .report-summary-pct {
      text-align: right;
      font-variant-numeric: tabular-nums;
    }

    .report-summary-pct {
      min-width: 118px;
    }

    .report-summary-pct-text {
      display: block;
      margin-bottom: 4px;
    }

    .report-summary-bar {
      display: block;
      height: 4px;
      border-radius: 999px;
      background: #e2e8f0;
      overflow: hidden;
    }

    .report-summary-bar span {
      display: block;
      height: 100%;
      border-radius: inherit;
    }

    .report-summary-total td {
      background: #f8fafc;
      font-weight: 850;
    }

    .report-summary-note {
      margin-top: 12px;
      padding: 10px 12px;
      border-left: 4px solid #5f7fa5;
      border-radius: 8px;
      background: #f6f9fd;
      color: #334155;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.6;
    }

    .report-pie-card {
      min-height: 356px;
      border: 1px solid #dbe5f1;
      border-radius: 12px;
      background: #fbfdff;
      padding: 16px 22px 12px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .report-pie-title {
      text-align: center;
      color: #334155;
      font-size: 18px;
      font-weight: 800;
      line-height: 1.3;
      margin-bottom: 4px;
    }

    .report-pie-card canvas {
      width: 100%;
      max-width: 640px;
      align-self: center;
    }

    .report-table-wrap {
      overflow-x: auto;
      border: 1px solid #dbe5f1;
      border-radius: 10px;
    }

    .report-table {
      border-collapse: separate;
      border-spacing: 0;
      width: 100%;
      font-size: 13px;
    }

    .report-table th {
      background: #eef4fb;
      border-right: 1px solid #dbe5f1;
      border-bottom: 1px solid #dbe5f1;
      padding: 6px 12px;
      text-align: left;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    .report-table td {
      border-right: 1px solid #e5ecf5;
      border-bottom: 1px solid #e5ecf5;
      padding: 6px 12px;
      vertical-align: middle;
    }

    .report-table th:last-child,
    .report-table td:last-child {
      border-right: 0;
    }

    .report-table tbody tr:last-child td {
      border-bottom: 0;
    }

    .report-table tr:nth-child(even) td {
      background: #f8fafc;
    }

    .report-detail-table {
      min-width: 1120px;
    }

    .report-detail-table th:first-child,
    .report-detail-table td:first-child {
      position: sticky;
      left: 0;
      z-index: 2;
      background: #fff;
      box-shadow: inset -1px 0 0 #dbe5f1;
    }

    .report-detail-table th:first-child {
      z-index: 3;
      background: #eef4fb;
    }

    .report-detail-table tr:nth-child(even) td:first-child {
      background: #f8fafc;
    }

    .report-hours-input {
      width: 86px;
      padding: 4px 8px;
      font-size: 13px;
      text-align: center;
    }

    .report-setting-value {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 54px;
      min-height: 24px;
      color: #102a43;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }

    .report-config-actions {
      margin-top: 12px;
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .print-btn {
      min-height: 30px;
      padding: 6px 16px;
      background: #374151;
      color: #fff;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
    }

    .print-btn:hover {
      background: #1f2937;
    }

    @media print {

      #navbar,
      .admin-tabs,
      .month-nav,
      .print-btn,
      .leave-header,
      .leave-footer {
        display: none !important;
      }

      .page {
        padding: 0;
      }

      body {
        background: #fff;
      }
    }

    /* ── Chart canvas ─────────────────────────── */
    .chart-container {
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 10px;
      padding: 16px;
      margin-bottom: 16px;
    }

    .chart-title {
      font-size: 13px;
      font-weight: 700;
      color: #374151;
      margin-bottom: 12px;
    }

    @media (max-width: 980px) {
      .report-toolbar {
        flex-direction: column;
      }

      .report-toolbar-actions {
        justify-content: flex-start;
      }

      .report-stat-row {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
      }

      .report-overview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
      }

      .report-summary-note {
        margin-top: 16px;
        font-size: 14px;
      }
    }

    @media (max-width: 640px) {
      .report-stat-row {
        grid-template-columns: 1fr;
      }

      .report-overview-block,
      .report-panel,
      .report-toolbar {
        padding: 14px;
      }
    }

    /* ── Leave Footer — 應休未休時數 ────────────── */
    .leave-footer {
      margin-top: 20px;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.88));
      backdrop-filter: blur(12px);
      border-radius: 14px;
      padding: 20px 24px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(0, 0, 0, 0.04);
    }

    .leave-footer-title {
      font-size: 16px;
      font-weight: 800;
      color: #0f2b4a;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .leave-footer-title .icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      background: linear-gradient(135deg, #f0f7ff, #dbeafe);
      border-radius: 8px;
      font-size: 14px;
    }

    .leave-footer-desc {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 16px;
      line-height: 1.6;
      font-weight: 500;
    }

    .leave-footer-desc code {
      background: #fef3c7;
      color: #92400e;
      padding: 1px 6px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 700;
    }

    /* Group separator in footer */
    .lf-group-sep {
      font-size: 11px;
      font-weight: 700;
      color: #9ca3af;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      margin-bottom: 8px;
      padding-bottom: 4px;
      border-bottom: 1px solid #e5e7eb;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .lf-group-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    /* 橫向群組排列容器 */
    .lf-groups-row {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      overflow-x: auto;
      gap: 16px;
      align-items: flex-start;
      padding-bottom: 6px;
    }

    /* 每個群組欄 */
    .lf-group-col {
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      min-width: 220px;
    }

    /* 同群組的卡片縱向排列 */
    .lf-grid {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .lf-card {
      background: linear-gradient(135deg, #f8fafc, #f1f5f9);
      border: 1.5px solid #e2e8f0;
      border-radius: 10px;
      padding: 12px 14px;
      transition: all 0.2s ease;
      position: relative;
      overflow: hidden;
      min-width: 220px;
      flex-shrink: 0;
    }

    .lf-card:hover {
      border-color: #bfdbfe;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    }

    .lf-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      width: 3px;
      border-radius: 3px 0 0 3px;
    }

    .lf-card.status-safe::before {
      background: #10b981;
    }

    .lf-card.status-warn::before {
      background: #f59e0b;
    }

    .lf-card.status-danger::before {
      background: #ef4444;
    }

    .lf-card-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
    }

    .lf-emp-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 1px solid rgba(0, 0, 0, 0.1);
      flex-shrink: 0;
    }

    .lf-emp-name {
      font-weight: 700;
      font-size: 13px;
      color: #1f2937;
    }

    .lf-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
      font-size: 12px;
    }

    .lf-row:last-child {
      margin-bottom: 0;
    }

    .lf-label {
      color: #6b7280;
      font-weight: 500;
    }

    .lf-value {
      font-weight: 700;
      color: #1f2937;
      font-size: 13px;
    }

    .lf-input-row {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .lf-input {
      width: 70px;
      padding: 4px 8px;
      border: 1.5px solid #d1d5db;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      text-align: center;
      outline: none;
      transition: border-color 0.2s;
      background: #fff;
    }

    .lf-input:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }

    .lf-input.warn {
      border-color: #f59e0b;
      background: #fffbeb;
    }

    .lf-input.danger {
      border-color: #ef4444;
      background: #fef2f2;
    }

    .lf-unit {
      font-size: 11px;
      color: #9ca3af;
      font-weight: 500;
    }

    .lf-total-bar {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid #e5e7eb;
    }

    .lf-total-val {
      font-size: 14px;
    }

    .lf-total-val.safe {
      color: #059669;
    }

    .lf-total-val.warn {
      color: #d97706;
    }

    .lf-total-val.danger {
      color: #dc2626;
    }

    .lf-cap-badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 10px;
      font-weight: 700;
      margin-left: 6px;
    }

    .lf-cap-badge.safe {
      background: #d1fae5;
      color: #065f46;
    }

    .lf-cap-badge.warn {
      background: #fef3c7;
      color: #92400e;
    }

    .lf-cap-badge.danger {
      background: #fee2e2;
      color: #991b1b;
    }

    /* ── Dashboard Page ───────────────────────── */
    .db-page {
      padding: 24px;
    }

    .db-header {
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.88));
      border-radius: 14px;
      padding: 20px 24px;
      margin-bottom: 20px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.8);
      position: relative;
      overflow: hidden;
    }

    .db-header::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, #7c3aed, #2563eb, #7c3aed);
      background-size: 200% 100%;
      animation: shimmer 3s ease infinite;
    }

    .db-emp-select {
      padding: 8px 14px;
      border: 1.5px solid #d1d5db;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      background: #fff;
      outline: none;
      min-width: 160px;
      cursor: pointer;
    }

    .db-emp-select:focus {
      border-color: #7c3aed;
      box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
    }

    .db-cycle-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: linear-gradient(135deg, #ede9fe, #ddd6fe);
      color: #5b21b6;
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
      border: 1px solid #c4b5fd;
    }

    .db-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(150px, 1fr));
      gap: 14px;
      margin-bottom: 22px;
    }

    .db-stat-card {
      display: grid;
      grid-template-columns: 56px minmax(0, 1fr);
      align-items: center;
      gap: 14px;
      min-height: 104px;
      background: rgba(255, 255, 255, 0.86);
      border-radius: 12px;
      padding: 15px 16px;
      box-shadow: 0 10px 24px rgba(30, 58, 95, 0.08);
      border: 1px solid rgba(203, 213, 225, 0.72);
      backdrop-filter: blur(6px);
      position: relative;
      overflow: hidden;
    }

    .db-stat-card::before {
      display: none;
    }

    .db-stat-card.blue {
      border-color: #cfe2fb;
    }

    .db-stat-card.green {
      border-color: #d8f0df;
    }

    .db-stat-card.purple {
      border-color: #e1d7fb;
    }

    .db-stat-card.amber {
      border-color: #f3ddc0;
    }

    .db-stat-card.cyan {
      border-color: #bae6fd;
      background: #e0f2fe;
    }

    .db-stat-icon {
      width: 52px;
      height: 52px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      font-weight: 900;
      line-height: 1;
      background: #e6f1ff;
      color: #2878d9;
    }

    .db-stat-card.green .db-stat-icon {
      background: #e4f8eb;
      color: #22a05a;
    }

    .db-stat-card.purple .db-stat-icon {
      background: #eee7ff;
      color: #6d45dc;
    }

    .db-stat-card.amber .db-stat-icon {
      background: #fff0dc;
      color: #eb8416;
    }

    .db-stat-card.cyan .db-stat-icon {
      background: #e0f2fe;
      color: #0284c7;
    }

    .db-stat-label {
      color: #6f8197;
      font-size: 12px;
      font-weight: 850;
      line-height: 1.25;
      white-space: normal;
      margin-bottom: 0;
    }

    .db-stat-value {
      margin-top: 6px;
      color: #2878d9;
      font-size: 30px;
      font-weight: 900;
      line-height: 1;
      font-variant-numeric: tabular-nums;
    }

    .db-stat-card.green .db-stat-value {
      color: #16a05a;
    }

    .db-stat-card.purple .db-stat-value {
      color: #6d45dc;
    }

    .db-stat-card.amber .db-stat-value {
      color: #e37b16;
    }

    .db-stat-card.cyan .db-stat-value {
      color: #0284c7;
    }

    .db-stat-value.is-date {
      color: #1f2937;
      font-size: 20px;
      line-height: 1.18;
    }

    .db-stat-unit {
      color: #7f91a7;
      font-size: 14px;
      font-weight: 850;
      margin-left: 5px;
    }

    .db-stat-sub {
      margin-top: 6px;
      color: #73859b;
      font-size: 12px;
      font-weight: 800;
      line-height: 1.35;
    }

    @media (max-width: 1280px) {
      .db-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      }
    }

    /* Payout table */
    .db-payout-section {
      background: #fff;
      border-radius: 12px;
      padding: 20px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      border: 1px solid #e5e7eb;
    }

    .db-payout-title {
      font-size: 14px;
      font-weight: 700;
      color: #1e3a5f;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .db-add-payout-btn {
      padding: 6px 14px;
      background: linear-gradient(135deg, #7c3aed, #6d28d9);
      color: #fff;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
    }

    .db-add-payout-btn:hover {
      background: linear-gradient(135deg, #6d28d9, #5b21b6);
    }

    .db-payout-table {
      border-collapse: collapse;
      width: 100%;
      font-size: 13px;
    }

    .db-payout-table th {
      background: #f5f3ff;
      border: 1px solid #ede9fe;
      padding: 7px 12px;
      text-align: left;
      font-weight: 700;
      font-size: 12px;
    }

    .db-payout-table td {
      border: 1px solid #e5e7eb;
      padding: 6px 12px;
      vertical-align: middle;
    }

    .db-payout-table tr:nth-child(even) td {
      background: #faf5ff;
    }

    .db-payout-del {
      padding: 3px 8px;
      background: #fee2e2;
      color: #991b1b;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
    }

    .db-payout-del:hover {
      background: #fecaca;
    }

    .db-empty {
      text-align: center;
      color: #9ca3af;
      font-size: 13px;
      padding: 24px;
      font-style: italic;
    }

    /* ── Dashboard Tab Panel ───────────────────── */
    .db-tab-panel {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      border: 1px solid #e5e7eb;
      margin-top: 16px;
      overflow: hidden;
    }

    .db-tab-bar {
      display: flex;
      border-bottom: 2px solid #e5e7eb;
      background: #f8fafc;
      padding: 0 4px;
      gap: 2px;
    }

    .db-tab-btn {
      padding: 11px 20px;
      font-size: 13px;
      font-weight: 600;
      color: #6b7280;
      border: none;
      background: none;
      border-bottom: 2px solid transparent;
      margin-bottom: -2px;
      border-radius: 6px 6px 0 0;
      cursor: pointer;
      transition: color 0.15s, border-color 0.15s, background 0.15s;
      white-space: nowrap;
    }

    .db-tab-btn:hover {
      color: #374151;
      background: #f0f4ff;
    }

    .db-tab-btn.active {
      color: #2563eb;
      border-bottom-color: #2563eb;
      background: #fff;
    }

    .db-tab-content {
      padding: 24px;
    }

    .db-tab-pane {
      display: none;
    }

    .db-tab-pane.active {
      display: block;
    }

    /* Month navigation (inside tab) */
    .db-tab-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 20px;
      flex-wrap: wrap;
      gap: 8px;
    }

    .db-tab-title {
      font-size: 17px;
      font-weight: 900;
      color: #1e3a5f;
    }

    .db-cal-nav {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .db-cal-nav-btn {
      padding: 3px 10px;
      border: 1.5px solid #d1d5db;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      background: #f9fafb;
      color: #374151;
      transition: all 0.15s;
    }

    .db-cal-nav-btn:hover {
      background: #eff6ff;
      border-color: #93c5fd;
      color: #1d4ed8;
    }

    .db-cal-month-label {
      font-size: 12px;
      font-weight: 700;
      color: #374151;
      min-width: 80px;
      text-align: center;
    }

    /* Calendar grid */
    .db-cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px;
      margin-top: 8px;
    }

    .db-cal-dow {
      text-align: center;
      font-size: 12px;
      font-weight: 900;
      color: #9ca3af;
      padding: 7px 0;
      letter-spacing: 0.04em;
    }

    .db-cal-day {
      border-radius: 10px;
      min-height: clamp(82px, 8.8vh, 118px);
      padding: 8px 10px;
      font-size: 13px;
      position: relative;
      cursor: default;
      transition: background 0.1s;
    }

    .db-cal-day.empty {
      background: transparent;
    }

    .db-cal-day.weekend {
      background: #fff5f5;
    }

    .db-cal-day.today {
      outline: 2px solid #2563eb;
      outline-offset: -2px;
    }

    .db-cal-day:not(.empty):hover {
      background: #f0f7ff;
    }

    .db-cal-day-num {
      font-weight: 900;
      color: #374151;
      font-size: 13px;
      display: block;
      margin-bottom: 7px;
    }

    .db-cal-day.today .db-cal-day-num {
      color: #2563eb;
    }

    .db-cal-pip {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .db-cal-chip {
      border-radius: 5px;
      padding: 3px 7px;
      font-size: 11px;
      font-weight: 850;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    /* Records list */
    .db-rec-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 440px;
      overflow-y: auto;
    }

    .db-rec-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 13px;
      border-radius: 8px;
      border: 1px solid #e5e7eb;
      font-size: 12px;
      background: #fafafa;
      transition: background 0.1s;
    }

    .db-rec-item:hover {
      background: #f0f7ff;
    }

    .db-rec-date {
      font-weight: 700;
      color: #1e3a5f;
      min-width: 48px;
      font-size: 11px;
    }

    .db-rec-badge {
      padding: 2px 8px;
      border-radius: 10px;
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .db-rec-desc {
      flex: 1;
      color: #374151;
    }

    .db-rec-hours {
      font-weight: 700;
      font-size: 12px;
      white-space: nowrap;
    }

    .db-rec-empty {
      text-align: center;
      color: #9ca3af;
      font-size: 13px;
      padding: 32px 0;
      font-style: italic;
    }

    /* ── Dashboard Mode Switch ─────────────────── */
    .db-mode-switch {
      display: flex;
      gap: 4px;
      background: #f1f5f9;
      border: 1.5px solid #e2e8f0;
      border-radius: 10px;
      padding: 3px;
      margin-left: auto;
    }

    .db-mode-btn {
      padding: 7px 18px;
      border-radius: 7px;
      font-size: 13px;
      font-weight: 600;
      color: #6b7280;
      background: none;
      border: none;
      cursor: pointer;
      transition: all 0.18s;
      white-space: nowrap;
    }

    .db-mode-btn:hover {
      background: #e2e8f0;
      color: #374151;
    }

    .db-mode-btn.active {
      background: #fff;
      color: #1e3a5f;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .db-overview-hero {
      position: relative;
      overflow: hidden;
      min-height: 210px;
      margin-bottom: 22px;
      padding: 24px 28px 26px;
      border-radius: 18px;
      border: 1px solid #dce8f7;
      background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.97) 0%, rgba(246, 250, 255, 0.98) 46%, rgba(231, 241, 255, 0.95) 100%);
      box-shadow: 0 18px 46px rgba(30, 58, 95, 0.12);
      display: grid;
      grid-template-columns: minmax(0, 1fr) 230px;
      gap: 24px;
    }

    .db-overview-hero::before,
    .db-overview-hero::after {
      content: '';
      position: absolute;
      pointer-events: none;
      inset: auto -80px -120px 58%;
      height: 260px;
      border: 1px solid rgba(147, 197, 253, 0.35);
      border-left: 0;
      border-bottom: 0;
      border-radius: 55% 45% 0 0;
      transform: rotate(-10deg);
    }

    .db-overview-hero::after {
      inset: auto -50px -138px 61%;
      border-color: rgba(191, 219, 254, 0.5);
      transform: rotate(-7deg);
    }

    .db-overview-main {
      position: relative;
      z-index: 1;
      align-self: center;
    }

    .db-overview-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 30px;
      padding: 5px 12px;
      border-radius: 10px;
      background: #e8f2ff;
      color: #1976d2;
      font-size: 14px;
      font-weight: 850;
    }

    .db-kicker-mark {
      font-size: 16px;
      line-height: 1;
    }

    .db-overview-title {
      margin-top: 0;
      color: #102a43;
      font-size: 34px;
      font-weight: 900;
      line-height: 1.16;
    }

    .db-overview-subtitle {
      margin-top: 10px;
      color: #72849a;
      font-size: 15px;
      font-weight: 700;
    }

    .db-overview-actions {
      position: absolute;
      z-index: 2;
      top: 28px;
      right: 28px;
    }

    .db-overview-stats {
      display: grid;
      grid-template-columns: repeat(5, minmax(142px, 1fr));
      gap: 14px;
      margin-top: 24px;
      max-width: 1580px;
    }

    .db-overview-hero-compact {
      min-height: 138px;
      margin-bottom: 16px;
      padding: 18px 24px 20px;
      grid-template-columns: minmax(0, 1fr) 170px;
      gap: 18px;
    }

    .db-overview-hero-compact .db-overview-title {
      font-size: 26px;
      line-height: 1.15;
    }

    .db-overview-hero-compact .db-overview-stats {
      grid-template-columns: repeat(3, minmax(190px, 240px));
      gap: 12px;
      margin-top: 18px;
      max-width: 760px;
    }

    .db-overview-hero-compact .db-hero-stat {
      grid-template-columns: 44px minmax(0, 1fr);
      min-height: 80px;
      padding: 12px 14px;
      gap: 12px;
    }

    .db-overview-hero-compact .db-hero-stat-icon {
      width: 42px;
      height: 42px;
      font-size: 18px;
    }

    .db-overview-hero-compact .db-hero-stat-value {
      margin-top: 4px;
      font-size: 26px;
    }

    .db-overview-hero-compact .db-overview-actions {
      top: 18px;
      right: 24px;
    }

    .db-overview-hero-compact .db-overview-art {
      width: 160px;
      height: 124px;
      align-self: center;
    }

    .db-overview-hero-compact .db-art-dots {
      width: 90px;
      height: 70px;
      right: 10px;
      top: 8px;
    }

    .db-overview-hero-compact .db-art-calendar {
      right: 12px;
      bottom: 16px;
      width: 94px;
      height: 74px;
      padding: 23px 11px 10px;
      border-radius: 14px;
      gap: 5px;
    }

    .db-overview-hero-compact .db-art-calendar::before {
      height: 22px;
      border-radius: 14px 14px 7px 7px;
    }

    .db-overview-hero-compact .db-art-calendar::after {
      left: 16px;
      right: 16px;
      top: -8px;
      height: 14px;
      background:
        linear-gradient(90deg, #65b7ff 0 6px, transparent 6px 24px, #65b7ff 24px 30px, transparent 30px 48px, #65b7ff 48px 54px, transparent 54px);
    }

    .db-overview-hero-compact .db-art-clock {
      right: 2px;
      bottom: 2px;
      width: 54px;
      height: 54px;
      border-width: 6px;
    }

    .db-hero-stat {
      display: grid;
      grid-template-columns: 56px minmax(0, 1fr);
      align-items: center;
      gap: 14px;
      min-height: 104px;
      padding: 15px 16px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.86);
      border: 1px solid rgba(203, 213, 225, 0.72);
      box-shadow: 0 10px 24px rgba(30, 58, 95, 0.08);
      backdrop-filter: blur(6px);
    }

    .db-hero-stat.blue {
      border-color: #cfe2fb;
    }

    .db-hero-stat.green {
      border-color: #d8f0df;
    }

    .db-hero-stat.purple {
      border-color: #e1d7fb;
    }

    .db-hero-stat.amber {
      border-color: #f3ddc0;
    }

    .db-hero-stat.cyan {
      border-color: #bae6fd;
      background: #e0f2fe;
    }

    .db-hero-stat-icon {
      width: 52px;
      height: 52px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      font-weight: 900;
      line-height: 1;
      background: #e6f1ff;
      color: #2878d9;
    }

    .db-hero-stat.green .db-hero-stat-icon {
      background: #e4f8eb;
      color: #22a05a;
    }

    .db-hero-stat.purple .db-hero-stat-icon {
      background: #eee7ff;
      color: #6d45dc;
    }

    .db-hero-stat.amber .db-hero-stat-icon {
      background: #fff0dc;
      color: #eb8416;
    }

    .db-hero-stat.cyan .db-hero-stat-icon {
      background: #d7f0ff;
      color: #0284c7;
    }

    .db-hero-stat-label {
      color: #6f8197;
      font-size: 12px;
      font-weight: 850;
      line-height: 1.25;
      white-space: normal;
    }

    .db-hero-stat-value {
      margin-top: 6px;
      color: #2878d9;
      font-size: 30px;
      font-weight: 900;
      line-height: 1;
      font-variant-numeric: tabular-nums;
    }

    .db-hero-stat.green .db-hero-stat-value {
      color: #16a05a;
    }

    .db-hero-stat.purple .db-hero-stat-value {
      color: #6d45dc;
    }

    .db-hero-stat.amber .db-hero-stat-value {
      color: #e37b16;
    }

    .db-hero-stat.cyan .db-hero-stat-value {
      color: #0284c7;
    }

    .db-hero-stat-value.is-date {
      color: #1f2937;
      font-size: 20px;
      line-height: 1.18;
    }

    .db-hero-stat-value span {
      color: #7f91a7;
      font-size: 14px;
      font-weight: 850;
      margin-left: 5px;
    }

    .db-hero-stat-sub {
      margin-top: 7px;
      color: #75869a;
      font-size: 11px;
      font-weight: 700;
      line-height: 1.4;
    }

    .db-overview-art {
      position: relative;
      z-index: 1;
      align-self: end;
      justify-self: end;
      width: 218px;
      height: 178px;
      margin-top: 58px;
    }

    .db-art-dots {
      position: absolute;
      width: 92px;
      height: 92px;
      right: 80px;
      top: 16px;
      opacity: 0.4;
      background-image: radial-gradient(#6ea8ea 1.2px, transparent 1.2px);
      background-size: 12px 12px;
    }

    .db-art-calendar {
      position: absolute;
      right: 18px;
      bottom: 26px;
      width: 132px;
      height: 104px;
      padding: 32px 16px 14px;
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff, #e9f3ff);
      box-shadow: 0 14px 26px rgba(37, 99, 235, 0.2);
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      transform: rotate(5deg);
    }

    .db-art-calendar::before {
      content: '';
      position: absolute;
      inset: 0 0 auto;
      height: 30px;
      border-radius: 18px 18px 8px 8px;
      background: linear-gradient(90deg, #38a7ff, #2477e8);
    }

    .db-art-calendar::after {
      content: '';
      position: absolute;
      left: 22px;
      right: 22px;
      top: -10px;
      height: 18px;
      background:
        linear-gradient(90deg, #65b7ff 0 8px, transparent 8px 34px, #65b7ff 34px 42px, transparent 42px 68px, #65b7ff 68px 76px, transparent 76px);
      border-radius: 8px;
    }

    .db-art-calendar span {
      position: relative;
      z-index: 1;
      border-radius: 5px;
      background: #cfe1f7;
    }

    .db-art-calendar span.active {
      background: #2878e8;
      box-shadow: 0 4px 10px rgba(40, 120, 232, 0.32);
    }

    .db-art-clock {
      position: absolute;
      right: 0;
      bottom: 12px;
      width: 62px;
      height: 62px;
      border-radius: 999px;
      border: 8px solid #2c6fe0;
      background: #f7fbff;
      box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
    }

    .db-art-clock::before {
      content: '';
      position: absolute;
      left: 24px;
      top: 13px;
      width: 4px;
      height: 17px;
      border-radius: 2px;
      background: #2c6fe0;
      transform-origin: bottom center;
      transform: rotate(30deg);
    }

    .db-art-clock::after {
      content: '';
      position: absolute;
      left: 26px;
      top: 27px;
      width: 17px;
      height: 4px;
      border-radius: 2px;
      background: #2c6fe0;
      transform-origin: left center;
      transform: rotate(-28deg);
    }

    .db-art-leaf {
      position: absolute;
      bottom: 22px;
      width: 34px;
      height: 58px;
      border-radius: 34px 0 34px 0;
      background: linear-gradient(180deg, #80dab7, #42b982);
      opacity: 0.86;
    }

    .db-art-leaf.left {
      right: 152px;
      transform: rotate(-48deg);
    }

    .db-art-leaf.right {
      right: 4px;
      bottom: 34px;
      transform: rotate(38deg);
    }

    .db-personal-layout {
      display: flex;
      align-items: stretch;
      gap: 20px;
      margin-top: 22px;
    }

    .db-personal-main {
      display: flex;
      flex: 1 1 auto;
      min-width: 0;
    }

    .db-personal-main .db-tab-panel {
      display: flex;
      flex: 1 1 auto;
      flex-direction: column;
      margin-top: 0;
    }

    .db-personal-main .db-tab-content {
      flex: 1 1 auto;
      position: relative;
      min-height: var(--db-tab-content-min-h, 0px);
    }

    .db-emp-sidebar {
      width: 208px;
      flex: 0 0 208px;
      display: flex;
      flex-direction: column;
      padding: 14px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid #dbe5f0;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
      min-height: 100%;
    }

    .db-emp-sidebar-title {
      flex-shrink: 0;
      margin: 2px 2px 10px;
      color: #334155;
      font-size: 14px;
      font-weight: 900;
    }

    .db-emp-search {
      width: 100%;
      flex-shrink: 0;
      margin-bottom: 12px;
      padding: 8px 10px;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      outline: none;
      background: #fff;
      color: #102a43;
      font-size: 13px;
      font-weight: 650;
    }

    .db-emp-search:focus {
      border-color: #3b82f6;
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    }

    .db-emp-list-scroll {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      padding-right: 2px;
    }

    .db-emp-list-item {
      align-items: baseline;
      gap: 8px;
      margin-bottom: 6px;
      padding: 12px 12px;
      border-radius: 8px;
      color: #475569;
      cursor: pointer;
      font-size: 14px;
      font-weight: 750;
      line-height: 1.2;
      transition: background 0.16s, color 0.16s, box-shadow 0.16s;
    }

    .db-emp-list-item:hover {
      background: #eef6ff;
      color: #1e3a5f;
    }

    .db-emp-list-item.active {
      background: #dfe7ff;
      color: #1e40af;
      box-shadow: inset 3px 0 0 #3b6ff5;
    }

    .db-emp-list-item:last-child {
      margin-bottom: 0;
    }

    .db-emp-list-item small {
      color: #94a3b8;
      font-size: 12px;
      font-weight: 800;
    }

    @media (max-width: 1280px) {
      .db-overview-hero {
        grid-template-columns: 1fr;
        padding-right: 28px;
      }

      .db-overview-hero-compact .db-overview-stats {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        max-width: none;
      }

      .db-overview-stats {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        padding-right: 0;
      }

      .db-overview-art {
        display: none;
      }
    }

    @media (max-width: 760px) {
      .db-overview-hero {
        padding: 20px;
      }

      .db-overview-hero-compact {
        min-height: 0;
        padding: 16px;
      }

      .db-overview-actions {
        position: static;
        margin-bottom: 18px;
        order: -1;
      }

      .db-overview-title {
        font-size: 26px;
      }

      .db-overview-hero-compact .db-overview-title {
        font-size: 22px;
      }

      .db-overview-subtitle {
        font-size: 13px;
      }

      .db-overview-hero-compact .db-overview-stats {
        grid-template-columns: 1fr;
        margin-top: 14px;
      }

      .db-overview-stats {
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .db-personal-layout {
        flex-direction: column;
      }

      .db-emp-sidebar {
        width: 100%;
        flex-basis: auto;
        max-height: 260px;
      }

    }

    /* ── Overview Table ────────────────────────── */
    .ov-section {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      border: 1px solid #e5e7eb;
      padding: 20px;
      margin-top: 16px;
    }

    .ov-section-title {
      font-size: 14px;
      font-weight: 700;
      color: #1e3a5f;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ov-table {
      border-collapse: collapse;
      width: 100%;
      font-size: 13px;
    }

    .ov-table th {
      background: #f0f4fb;
      border: 1px solid #dce3ef;
      padding: 9px 14px;
      text-align: left;
      font-weight: 700;
      font-size: 12px;
      white-space: nowrap;
      color: #374151;
    }

    .ov-table td {
      border: 1px solid #e5e7eb;
      padding: 10px 14px;
      vertical-align: middle;
      white-space: nowrap;
    }

    .ov-table tr:nth-child(even) td {
      background: #f9fafb;
    }

    .ov-table tr:hover td {
      background: #eff6ff;
      cursor: pointer;
    }

    .ov-table tr.grp-header td {
      background: #f1f5f9;
      font-weight: 700;
      font-size: 11px;
      color: #6b7280;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      padding: 6px 14px;
      border-bottom: 2px solid #e2e8f0;
    }

    .ov-name {
      font-weight: 700;
      color: #1f2937;
    }

    .ov-val {
      font-weight: 700;
      color: #1e3a5f;
    }

    .ov-zero {
      color: #9ca3af;
      font-weight: 400;
    }

    /* Status badge */
    .ov-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }

    .ov-badge.safe {
      background: #d1fae5;
      color: #065f46;
    }

    .ov-badge.warn {
      background: #fef3c7;
      color: #92400e;
    }

    .ov-badge.danger {
      background: #fee2e2;
      color: #991b1b;
    }

    .ov-badge.zero {
      background: #f3f4f6;
      color: #6b7280;
    }

    /* Days until settlement */
    .ov-days-bar {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ov-days-track {
      flex: 1;
      height: 6px;
      background: #e5e7eb;
      border-radius: 3px;
      min-width: 80px;
      overflow: hidden;
    }

    .ov-days-fill {
      height: 100%;
      border-radius: 3px;
      transition: width 0.3s ease;
    }

    .ov-days-fill.soon {
      background: #f59e0b;
    }

    .ov-days-fill.mid {
      background: #3b82f6;
    }

    .ov-days-fill.plenty {
      background: #10b981;
    }

    .ov-days-num {
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    .ov-days-num.soon {
      color: #d97706;
    }

    .ov-days-num.mid {
      color: #2563eb;
    }

    .ov-days-num.plenty {
      color: #059669;
    }

    /* Remaining bar */
    .ov-remain-bar {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .ov-remain-track {
      width: 80px;
      height: 6px;
      background: #e5e7eb;
      border-radius: 3px;
      overflow: hidden;
    }

    .ov-remain-fill {
      height: 100%;
      border-radius: 3px;
      background: #7c3aed;
    }

    /* 12-cell countdown bar */
    .ov-cells-bar {
      display: flex;
      gap: 2px;
      align-items: center;
    }

    .ov-cell {
      height: 14px;
      border-radius: 3px;
      flex: 1;
      min-width: 0;
      background: #e5e7eb;
      transition: background 0.2s;
    }

    .ov-cell.filled.soon {
      background: #f59e0b;
    }

    .ov-cell.filled.mid {
      background: #3b82f6;
    }

    .ov-cell.filled.plenty {
      background: #10b981;
    }

    .ov-cell.partial.soon {
      background: linear-gradient(to right, #f59e0b var(--p), #e5e7eb var(--p));
    }

    .ov-cell.partial.mid {
      background: linear-gradient(to right, #3b82f6 var(--p), #e5e7eb var(--p));
    }

    .ov-cell.partial.plenty {
      background: linear-gradient(to right, #10b981 var(--p), #e5e7eb var(--p));
    }

    /* Accumulated hours cell: clickable */
    .ov-acc-cell {
      cursor: pointer;
      transition: background 0.15s;
    }

    .ov-acc-cell:hover {
      background: #ede9fe !important;
    }

    .ov-acc-cell .ov-val {
      text-decoration: underline dotted #7c3aed;
      color: #5b21b6;
    }

    .ov-acc-hint {
      font-size: 10px;
      color: #a78bfa;
      display: block;
      margin-top: 1px;
    }
    /* ── Data Backup Panel ─────────────────────── */
    .backup-section {
      background: #f8fafc;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      padding: 22px 24px;
      margin-bottom: 20px;
    }

    .backup-section-title {
      font-size: 14px;
      font-weight: 700;
      color: #1e3a5f;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .backup-section-desc {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 16px;
      line-height: 1.6;
    }

    .backup-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .backup-label {
      font-size: 12px;
      font-weight: 600;
      color: #374151;
      min-width: 80px;
    }

    .backup-radio-group {
      display: flex;
      gap: 16px;
      align-items: center;
    }

    .backup-radio-group label {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 13px;
      color: #374151;
      cursor: pointer;
      font-weight: 500;
    }

    .backup-date-range {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .backup-date-input {
      padding: 5px 10px;
      border: 1.5px solid #d1d5db;
      border-radius: 7px;
      font-size: 13px;
      font-family: inherit;
      outline: none;
      color: #1f2937;
      background: #fff;
      transition: border-color 0.15s;
    }

    .backup-date-input:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
    }

    .backup-date-input:disabled {
      background: #f3f4f6;
      color: #9ca3af;
      cursor: not-allowed;
    }

    .backup-export-btn {
      padding: 9px 22px;
      background: linear-gradient(135deg, #2563eb, #1d4ed8);
      color: #fff;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      box-shadow: 0 2px 8px rgba(37,99,235,0.25);
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .backup-export-btn:hover {
      background: linear-gradient(135deg, #1d4ed8, #1e40af);
      box-shadow: 0 4px 12px rgba(37,99,235,0.35);
      transform: translateY(-1px);
    }

    .backup-import-btn {
      padding: 9px 22px;
      background: linear-gradient(135deg, #059669, #047857);
      color: #fff;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      box-shadow: 0 2px 8px rgba(5,150,105,0.25);
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .backup-import-btn:hover {
      background: linear-gradient(135deg, #047857, #065f46);
      box-shadow: 0 4px 12px rgba(5,150,105,0.35);
      transform: translateY(-1px);
    }

    .backup-import-zone {
      border: 2px dashed #93c5fd;
      border-radius: 10px;
      padding: 20px;
      text-align: center;
      background: #eff6ff;
      cursor: pointer;
      transition: all 0.15s;
      position: relative;
    }

    .backup-import-zone:hover {
      border-color: #2563eb;
      background: #dbeafe;
    }

    .backup-import-zone.drag-over {
      border-color: #2563eb;
      background: #dbeafe;
      box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    }

    .backup-import-zone input[type=file] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
    }

    .backup-import-icon {
      font-size: 28px;
      margin-bottom: 6px;
    }

    .backup-import-hint {
      font-size: 12px;
      color: #6b7280;
      margin-top: 4px;
    }

    .backup-preview {
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 14px 16px;
      margin-top: 12px;
      font-size: 12px;
      color: #374151;
      display: none;
    }

    .backup-preview.show { display: block; }

    .backup-preview-title {
      font-weight: 700;
      color: #1e3a5f;
      margin-bottom: 8px;
      font-size: 13px;
    }

    .backup-stat {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #f3f4f6;
      border-radius: 6px;
      padding: 3px 10px;
      margin: 3px 4px 3px 0;
      font-size: 12px;
      font-weight: 600;
      color: #374151;
    }

    .backup-stat .stat-num {
      color: #2563eb;
    }

    .backup-confirm-btn {
      margin-top: 12px;
      padding: 8px 20px;
      background: #dc2626;
      color: #fff;
      border-radius: 7px;
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: background 0.15s;
    }

    .backup-confirm-btn:hover {
      background: #b91c1c;
    }

    .backup-warn {
      background: #fff7ed;
      border: 1px solid #fed7aa;
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 12px;
      color: #c2410c;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      margin-top: 10px;
    }

/* ════════════════════════════════════════════
   ROLE-BASED VISIBILITY
   ════════════════════════════════════════════ */

/* 預設隱藏角色限定元素，由 applyRoleUI() 依角色啟用 */
.admin-only,
.supervisor-only {
  display: none !important;
}

.admin-only.role-visible,
.supervisor-only.role-visible {
  display: revert !important;
}

/* 導覽列使用者資訊 */
.nav-user {
  margin-left: auto;
  color: rgba(255,255,255,.75);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.nav-user:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-user:focus-visible {
  outline: 2px solid rgba(255,255,255,.55);
  outline-offset: 2px;
}

/* 導覽列登出按鈕 */
.nav-logout {
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  margin-left: 8px;
  transition: background .15s;
}
.nav-logout:hover {
  background: rgba(255,255,255,.2);
}

/* 角色標籤 badge */
.role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
}
.role-badge-admin      { background: #fef3c7; color: #92400e; }
.role-badge-supervisor { background: #dbeafe; color: #1e40af; }
.role-badge-staff      { background: #f3f4f6; color: #4b5563; }

/* 帳號權限管理頁樣式 */
.roles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.roles-table th,
.roles-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.roles-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}
.roles-table tr:hover td { background: #f9fafb; }
.role-select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

/* ── Proxy Confirm Modal ───────────────────── */
.proxy-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.proxy-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  overflow: hidden;
}
.proxy-modal-head {
  background: #1e3a5f;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 20px;
}
.proxy-modal-body {
  padding: 20px;
}
.proxy-modal-info {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.proxy-modal-invite {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #0f2f55;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
}

.proxy-status-modal .proxy-modal-invite {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.45;
}

.proxy-modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.proxy-modal-label { color: #6b7280; }
.proxy-modal-val   { font-weight: 600; color: #111827; }
.proxy-modal-q {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.proxy-modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
}
.proxy-modal-btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.proxy-modal-btn:hover { opacity: 0.85; }
.proxy-modal-accept { background: #22c55e; color: #fff; }
.proxy-modal-reject { background: #ef4444; color: #fff; }
.proxy-modal-cancel { background: #e5e7eb; color: #374151; }
.proxy-modal-save {
  background: #2563eb;
  color: #fff;
}

.proxy-status-modal {
  width: 640px;
}

.proxy-status-board {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.proxy-status-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.proxy-status-switch {
  --proxy-switch-width: 100%;
  --proxy-switch-height: 68px;
  --proxy-switch-padding: 6px;
  --proxy-item-width: calc((var(--proxy-switch-width) - (var(--proxy-switch-padding) * 2)) / 3);
  position: relative;
  width: var(--proxy-switch-width);
  height: var(--proxy-switch-height);
  display: flex;
  align-items: center;
  padding: var(--proxy-switch-padding);
  border: 1px solid #dbe5f0;
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  overflow: hidden;
}

.proxy-status-option {
  flex: 1;
  height: 100%;
  position: relative;
  z-index: 2;
}

.proxy-status-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.proxy-status-label {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 13px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.proxy-status-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.proxy-status-option input:checked + .proxy-status-label {
  color: #0f172a;
}

.proxy-status-option input:focus-visible + .proxy-status-label {
  outline: 2px solid #93c5fd;
  outline-offset: -4px;
}

.proxy-status-option:active .proxy-status-label {
  transform: scale(0.96);
}

.proxy-status-highlight {
  position: absolute;
  top: var(--proxy-switch-padding);
  left: var(--proxy-switch-padding);
  width: var(--proxy-item-width);
  height: calc(var(--proxy-switch-height) - (var(--proxy-switch-padding) * 2));
  z-index: 1;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.proxy-status-highlight-inner {
  height: 100%;
  border-radius: 13px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.16);
}

.proxy-status-switch.is-pending .proxy-status-highlight {
  transform: translateX(100%);
}

.proxy-status-switch.is-accepted .proxy-status-highlight {
  transform: translateX(200%);
}

.proxy-status-switch.is-rejected .proxy-status-highlight {
  transform: translateX(0%);
}

.proxy-status-switch.is-accepted .proxy-status-highlight-inner {
  border-color: #86efac;
  background: #ecfdf5;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.16);
}

.proxy-status-switch.is-rejected .proxy-status-highlight-inner {
  border-color: #fecaca;
  background: #fef2f2;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.16);
}

.proxy-status-switch.is-pending .proxy-status-option input:checked + .proxy-status-label {
  color: #92400e;
}

.proxy-status-switch.is-accepted .proxy-status-option input:checked + .proxy-status-label {
  color: #166534;
}

.proxy-status-switch.is-rejected .proxy-status-option input:checked + .proxy-status-label {
  color: #991b1b;
}

/* ── Design Refresh ─────────────────────────── */
:root {
  --nav-bg: #183552;
  --nav-active: #dce7f5;
  --table-header-bg: #f3f6fa;
  --weekend-bg: #fbf2f4;
  --data-cell-bg: #eef4fb;
  --data-cell-text: #1f4b7a;
  --slot-sep: #d7e0ea;
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 30%),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
  color: #0f172a;
}

#navbar {
  height: 60px;
  gap: 8px;
  padding: 0 20px;
  background: rgba(24, 53, 82, 0.94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.nav-brand {
  margin-right: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav-tab,
.nav-password {
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 0;
}

.nav-tab:hover,
.nav-password:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: none;
}

.nav-spacer {
  flex: 1;
}

.nav-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(24, 53, 82, 0.96);
}

.page,
.db-page {
  padding: 20px 24px 28px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.leave-header,
.db-header,
#leave-table-wrap,
.ot-card,
.admin-card,
.db-payout-section,
.db-tab-panel,
.ov-section,
.lf-card,
.grp-card,
.proxy-modal-box,
#modal-box {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.leave-header,
.db-header,
#leave-table-wrap,
.ot-card,
.admin-card,
.db-payout-section,
.db-tab-panel,
.ov-section,
.lf-card,
.grp-card {
  background: rgba(255, 255, 255, 0.96);
}

.page-header,
.page-actions,
.leave-view-panel,
.cycle-toolbar,
.ot-card,
.admin-card,
.report-section,
.db-tab-panel,
.db-payout-section,
.ov-section,
.leave-footer,
.personal-comp-summary {
  max-width: 100%;
  min-width: 0;
}

.leave-header,
.db-header {
  padding: 18px 22px;
  backdrop-filter: blur(10px);
}

.leave-header::before,
.db-header::before {
  display: none;
}

.leave-title,
.db-title,
.db-payout-title,
.ov-section-title {
  color: #102a43;
}

.leave-cycle-text,
.db-stat-sub,
.db-empty,
.db-rec-empty {
  color: #64748b;
}

.month-nav,
.db-cal-nav {
  gap: 8px;
}

.month-nav-btn,
.db-cal-nav-btn,
.db-add-payout-btn,
.nav-logout {
  border-radius: 10px;
}

.month-nav-btn,
.db-cal-nav-btn {
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid #d6dee8;
  color: #334155;
  box-shadow: none;
}

.month-nav-btn:hover,
.db-cal-nav-btn:hover {
  transform: none;
  background: #edf3f9;
  border-color: #bfd0e5;
  color: #183a5d;
  box-shadow: none;
}

.month-nav.month-jump {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: min(560px, 100%);
  min-width: min(420px, 100%);
  margin-left: auto;
}

.month-nav.month-jump.month-year-only {
  width: auto;
  min-width: 0;
}

.month-nav-years {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.month-year-only .month-nav-years {
  padding: 0;
  overflow: visible;
}

.month-year-tab {
  position: relative;
  z-index: 0;
  min-width: 74px;
  min-height: 36px;
  padding: 8px 14px 9px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #dfe8f4;
  color: #466078;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.month-year-only .month-year-tab {
  min-width: 82px;
  border: 1px solid #d6dee8;
  border-radius: 10px;
}

.month-year-tab:hover {
  background: #edf3f9;
  color: #183a5d;
}

.month-year-tab.active {
  z-index: 2;
  background: #fff;
  border-color: #bfd0e5;
  color: #102a43;
  cursor: default;
}

.month-year-only .month-year-tab.active {
  border-color: #bfd0e5;
  box-shadow: 0 8px 22px rgba(30, 58, 95, 0.08);
}

.month-year-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #fff;
}

.month-year-only .month-year-tab.active::after {
  display: none;
}

.month-nav-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: -1px;
  padding: 10px;
  border: 1px solid #bfd0e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(30, 58, 95, 0.08);
}

.month-nav-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(46px, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.month-picker-btn,
.month-nav-today {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.month-picker-btn:hover,
.month-nav-today:hover {
  background: #edf3f9;
  border-color: #bfd0e5;
  color: #183a5d;
}

.month-picker-btn.active {
  background: var(--nav-bg);
  border-color: var(--nav-bg);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.18);
  cursor: default;
}

.month-nav-today {
  flex: 0 0 auto;
  padding-inline: 14px;
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.month-nav-today.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a5f;
  cursor: default;
}

.page-header .month-nav.month-jump {
  justify-content: flex-start;
}

.report-toolbar-actions .month-nav.month-jump {
  flex: 0 0 auto;
  margin-left: 0;
}

.ot-view-bar,
.report-cycle-toolbar {
  margin-bottom: 14px;
}

.report-cycle-toolbar {
  align-items: center;
}

.cycle-toolbar,
.leave-view-bar,
.db-mode-switch {
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #dde6ef;
  box-shadow: none;
}

.personal-comp-summary {
  display: block;
  margin: 18px 0 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #dce8f7;
  border-radius: 14px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 255, 0.96));
  box-shadow: 0 12px 30px rgba(30, 58, 95, 0.07);
}

.personal-comp-section-head {
  margin-bottom: 14px;
}

.personal-comp-kicker {
  color: #5f7fa5;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.personal-comp-title {
  margin-top: 5px;
  color: #102a43;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.18;
}

.personal-comp-subtitle {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.personal-comp-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 14px;
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.personal-comp-card-grid .db-hero-stat {
  min-width: 0;
  min-height: 122px;
}

.personal-comp-settle-card {
  align-items: start;
}

.cycle-progress {
  margin-top: 10px;
}

.cycle-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #0f9f6e;
  font-size: 11px;
  font-weight: 900;
}

.cycle-progress-track {
  position: relative;
  height: 12px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(8.333% - 2px),
      rgba(255, 255, 255, 0.95) calc(8.333% - 2px),
      rgba(255, 255, 255, 0.95) 8.333%
    ),
    #e2e8f0;
}

.cycle-progress-track::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(8.333% - 2px),
      rgba(255, 255, 255, 0.95) calc(8.333% - 2px),
      rgba(255, 255, 255, 0.95) 8.333%
    ),
    #10b981;
}

.leave-footer {
  margin-top: 22px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.leave-footer-title {
  font-size: 15px;
  font-weight: 800;
  color: #102a43;
  margin-bottom: 6px;
}

.leave-footer-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 18px;
}

.leave-footer-desc code {
  background: #f7ead0;
  color: #9a5a00;
  border-radius: 999px;
  padding: 2px 8px;
}

.lf-groups-row {
  display: grid;
  --lf-group-col-min: 280px;
  grid-auto-flow: column;
  grid-auto-columns: minmax(var(--lf-group-col-min), 1fr);
  gap: 18px;
  align-items: start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-gutter: stable;
}

.lf-group-col {
  min-width: var(--lf-group-col-min);
}

.lf-group-sep {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  letter-spacing: 0.04em;
}

.lf-grid {
  display: grid;
  gap: 12px;
}

.lv-view-btn,
.db-mode-btn {
  border-radius: 8px;
  font-weight: 600;
  color: #64748b;
}

.lv-view-btn:hover,
.db-mode-btn:hover {
  background: #eef3f9;
  color: #183a5d;
}

.lv-view-btn.active,
.db-mode-btn.active {
  background: #fff;
  color: #183a5d;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

#leave-table {
  border-collapse: separate;
  border-spacing: 0;
}

#leave-table th {
  background: #f3f6fa;
  border-right: 1px solid #dde6ef;
  border-bottom: 1px solid #d3dde8;
  color: #334155;
  box-shadow: none;
}

#leave-table th.label-col {
  background: #edf2f7;
  border-right: 1px solid #d3dde8;
}

#leave-table th.weekend-col {
  background: #f8ecef;
}

#leave-table td {
  border-right: 1px solid #e7edf3;
  border-bottom: 1px solid #e7edf3;
}

#leave-table td.label-col {
  background: #f7fafc;
  border-left: 3px solid #d3dde8;
  border-right: 1px solid #d3dde8;
  color: #475569;
  letter-spacing: 0.01em;
}

#leave-table th.label-col,
#leave-table td.label-col {
  left: 0;
  --sticky-label-bg: #f7fafc;
  background-clip: border-box;
  box-shadow: inset -1px 0 0 #d3dde8;
}

#leave-table th.label-col {
  --sticky-label-bg: #edf2f7;
  z-index: 6;
}

#leave-table td.label-col {
  --sticky-label-bg: #f7fafc;
  z-index: 4;
}

#leave-table td.weekend-col {
  background: #fdf7f8;
}

#leave-table tbody tr[data-row-end] td {
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
}

#leave-table td.data-emp {
  color: #102a43;
  text-shadow: none;
}

#leave-table td.data-field {
  background: #eef4fb;
  color: #1f4b7a;
}

#leave-table td.data-proxy {
  background: #f3f8f3;
  color: #305b39;
}

#leave-table td.data-no-proxy {
  background: #f8fafc;
  color: #94a3b8;
}

#leave-table tbody tr[data-slot="0"] td:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy),
#leave-table tbody tr[data-slot="1"] td:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy),
#leave-table tbody tr[data-slot="2"] td:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
  background: #ffffff;
}

#leave-table tbody tr[data-slot="0"] td.weekend-col:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy),
#leave-table tbody tr[data-slot="1"] td.weekend-col:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy),
#leave-table tbody tr[data-slot="2"] td.weekend-col:not(.label-col):not(.data-emp):not(.data-shift-colored):not(.data-leave-colored):not(.data-proxy):not(.data-no-proxy) {
  background: #fdf7f8;
}

#leave-table td.label-col[data-slot="0"],
#leave-table td.label-col[data-slot="1"],
#leave-table td.label-col[data-slot="2"] {
  border-left-width: 3px;
  background: #f7fafc;
}

#leave-table td.label-col[data-slot="0"] {
  border-left-color: #5f7fa5;
  color: #35506d;
}

#leave-table td.label-col[data-slot="1"] {
  border-left-color: #7c93b0;
  color: #35506d;
}

#leave-table td.label-col[data-slot="2"] {
  border-left-color: #8ba694;
  color: #35506d;
}

#leave-table tr.slot-sep td,
#leave-table tr.slot-sep[data-slot-after="1"] td,
#leave-table tr.slot-sep[data-slot-after="2"] td {
  background: #edf2f7 !important;
  box-shadow: inset 0 1px 0 #d7e0ea;
  height: 4px;
}

#leave-table tr.slot-sep td.label-col,
#leave-table tr.slot-sep[data-slot-after="1"] td.label-col,
#leave-table tr.slot-sep[data-slot-after="2"] td.label-col {
  background: #e7edf3 !important;
  box-shadow: inset 0 1px 0 #d7e0ea;
}

#leave-table tr.short-row td {
  background: #fbfcfe;
  border-top: 1px dashed #cbd5e1;
}

#leave-table tr.short-row td.label-col {
  background: #f7fafc;
  border-left: 3px solid #94a3b8;
  border-top: 1px dashed #cbd5e1;
  color: #475569;
}

.short-chip {
  border-radius: 7px;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

.short-add-btn {
  background: #f8fafc;
  color: #35506d;
  border: 1px dashed #bfd0e5;
}

.lv-cal-grid,
.lv-list-tbl {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.lv-cal-grid {
  gap: 1px;
  background: #dde6ef;
}

.lv-cal-head {
  background: #edf2f7;
  color: #334155;
}

.lv-cal-head.lv-cal-wk {
  background: #f3e8ea;
}

.lv-cal-cell,
.lv-cal-cell.lv-cal-other {
  background: #fff;
}

.lv-cal-cell.lv-cal-wk {
  background: #fdf7f8;
}

.lv-cal-cell.lv-cal-today {
  background: #f3f8fd;
  box-shadow: inset 0 3px 0 #4c7bb0;
}

.lv-cal-cell:hover,
.db-rec-item:hover,
.db-cal-day:not(.empty):hover {
  background: #f7fafc;
}

.lv-list-bar select,
.lv-list-bar input,
.db-emp-select {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.lv-list-bar select:focus,
.lv-list-bar input:focus,
.db-emp-select:focus {
  border-color: #4c7bb0;
  box-shadow: 0 0 0 3px rgba(76, 123, 176, 0.12);
}

.lv-list-tbl th {
  background: #f3f6fa;
  border-bottom: 1px solid #d3dde8;
  color: #475569;
}

.lv-list-tbl td {
  border-bottom: 1px solid #e7edf3;
}

.lf-card {
  background: rgba(255, 255, 255, 0.96);
}

.lf-card::before,
.db-stat-card::before {
  height: 2px;
}

.db-cycle-badge {
  background: #eef4fb;
  color: #1f4b7a;
  border-color: #d5e2f0;
}

.db-stat-card,
.db-tab-panel,
.db-payout-section,
.ov-section {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.db-stat-card.purple::before,
.db-stat-card.blue::before,
.db-stat-card.green::before,
.db-stat-card.amber::before {
  background: #bfd0e5;
}

.db-tab-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px;
  gap: 4px;
}

.db-tab-btn {
  padding: 10px 16px;
  margin-bottom: 0;
  border: 0;
  border-radius: 8px;
}

.db-tab-btn:hover {
  background: #eef3f9;
  color: #183a5d;
}

.db-tab-btn.active {
  background: #fff;
  color: #183a5d;
  border-bottom-color: transparent;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.db-cal-day.weekend {
  background: #fdf7f8;
}

.db-cal-day.today {
  outline-color: #4c7bb0;
}

@media (min-width: 1440px) {
  .db-cal-day {
    min-height: 104px;
  }
}

.db-tab-panel {
  border-color: #d8e3ef;
  border-radius: 14px;
  overflow: hidden;
}

.db-tab-bar {
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #eef4fb;
  border-bottom: 1px solid #d5e2f0;
}

.db-tab-btn {
  min-height: 38px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #50657d;
  font-size: 14px;
  font-weight: 900;
}

.db-tab-btn:hover {
  background: #e2ecf8;
  color: #102a43;
}

.db-tab-btn.active {
  background: #fff;
  color: #0f2f55;
  border-color: #cbd9e8;
  box-shadow: 0 8px 18px rgba(30, 58, 95, 0.10);
}

.db-tab-content {
  padding: 28px;
  font-size: 15px;
}

.db-tab-title {
  font-size: 20px;
  letter-spacing: 0;
}

.db-cal-nav-btn {
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 850;
}

.db-cal-month-label {
  min-width: 96px;
  font-size: 14px;
}

.db-cal-dow {
  font-size: 13px;
}

.db-cal-day {
  min-height: clamp(96px, 10vh, 132px);
  padding: 10px 12px;
  font-size: 14px;
}

.db-cal-day-num {
  font-size: 14px;
}

.db-cal-chip {
  padding: 4px 8px;
  font-size: 12px;
}

.db-rec-item {
  border-radius: 10px;
  border-color: #e2e8f0;
  background: #fff;
  gap: 12px;
  padding: 12px 15px;
  font-size: 15px;
}

.db-rec-date {
  min-width: 56px;
  font-size: 13px;
  font-weight: 900;
}

.db-rec-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.db-rec-desc {
  color: #102a43;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.db-rec-hours {
  font-size: 14px;
  font-weight: 900;
}

.db-cal-month-label {
  min-width: 210px;
  white-space: nowrap;
}

.db-rec-header-stack {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

.db-rec-filter-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 1 1 560px;
}

.db-rec-filter-nav .month-strip {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 0;
}

.db-cal-nav-btn.active {
  background: var(--nav-bg);
  border-color: var(--nav-bg);
  color: #fff;
  box-shadow: 0 2px 10px rgba(30, 58, 95, 0.18);
}

.db-rec-all-btn {
  min-width: 58px;
}

.db-rec-list {
  display: block;
  max-height: none;
  overflow: visible;
}

.db-rec-table-wrap {
  width: 100%;
  max-height: 460px;
  overflow: auto;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  background: #fff;
}

.db-rec-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  color: #102a43;
}

.db-rec-table th,
.db-rec-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
}

.db-rec-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6fa;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.db-rec-table td {
  font-size: 14px;
  font-weight: 700;
}

.db-rec-table tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.db-rec-table tbody tr:hover td {
  background: #eef6ff;
}

.db-rec-table tbody tr:last-child td {
  border-bottom: 0;
}

.db-rec-type {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7c2;
  color: #6d4c00;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.db-rec-type.is-overtime {
  background: #dbeafe;
  color: #1e40af;
}

.db-rec-table-hours {
  color: #1e3a5f;
  font-weight: 950 !important;
  white-space: nowrap;
}

#modal-overlay,
.proxy-modal-overlay {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
}

#modal-box,
.proxy-modal-box {
  background: rgba(255, 255, 255, 0.98);
}

.modal-title,
.proxy-modal-head {
  color: #102a43;
}

.proxy-modal-head {
  background: #f3f6fa;
  border-bottom: 1px solid #e2e8f0;
}

.proxy-modal-info,
.ot-modal-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

#modal-box.notif-modal-box {
  width: 720px;
  max-width: calc(100vw - 48px);
}

.notif-card {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 10px;
  border: 1px solid;
  border-radius: 10px;
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.notif-card-pending {
  background: #ecfdf5;
  border-color: #86efac;
}

.notif-card-done {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.notif-card-accept {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.notif-card-reject {
  background: #fef2f2;
  border-color: #fecaca;
}

.notif-card-warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.notif-card-info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.notif-card-muted {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.notif-card.is-unread {
  box-shadow: 0 10px 24px rgba(30, 58, 95, 0.08);
}

.notif-message {
  margin-bottom: 5px;
  color: #24364a;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.55;
}

.notif-message strong {
  color: #102a43;
  font-weight: 900;
}

.proxy-modal-btn {
  border-radius: 10px;
}

.proxy-modal-accept {
  background: #305b39;
}

.proxy-modal-reject {
  background: #b42318;
}

.proxy-modal-cancel,
.btn-cancel {
  background: #f1f5f9;
  color: #334155;
}

.nav-user {
  margin-left: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  padding: 0 2px;
}

.nav-logout {
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  padding: 8px 12px;
  font-weight: 600;
}

.nav-logout:hover {
  background: rgba(255,255,255,.14);
}

.lv-cal-legend {
  flex-wrap: wrap;
}

.lv-cal-legend-hint {
  margin-left: auto;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.lv-list-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lv-list-legend-counts {
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.lv-list-hours {
  color: #1e3a5f;
  font-weight: 850;
  white-space: nowrap;
}

.lv-cal-grid {
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  align-items: stretch;
}

.lv-cal-head {
  padding: 11px 6px;
  font-size: 13px;
  letter-spacing: 0;
}

.lv-cal-cell {
  min-height: 128px;
  padding: 8px;
  cursor: pointer;
}

.lv-cal-cell.lv-cal-other {
  min-height: 128px;
}

.lv-cal-day {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lv-cal-day span {
  font-size: 18px;
  font-weight: 800;
}

.lv-cal-day small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.lv-cal-tags {
  gap: 5px;
}

.lv-cal-grid {
  overflow: visible;
}

.lv-cal-tag {
  position: relative;
  border-radius: 6px;
  padding: 5px 8px;
  line-height: 1.25;
  overflow: visible;
}

.lv-cal-tag[data-tooltip] {
  cursor: help;
}

.lv-cal-tag-proxy[data-tooltip] {
  cursor: pointer;
}

.lv-cal-tag[data-tooltip]::before,
.lv-cal-tag[data-tooltip]::after {
  position: absolute;
  left: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 80;
}

.lv-cal-tag[data-tooltip]::before {
  content: '';
  top: calc(100% + 2px);
  border: 6px solid transparent;
  border-bottom-color: #102a43;
}

.lv-cal-tag[data-tooltip]::after {
  content: attr(data-tooltip);
  top: calc(100% + 14px);
  width: max-content;
  max-width: min(320px, 72vw);
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  background: #102a43;
  color: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  white-space: normal;
}

.lv-cal-tag[data-tooltip]:hover,
.lv-cal-tag[data-tooltip]:focus-within {
  z-index: 90;
}

.lv-cal-tag[data-tooltip]:hover::before,
.lv-cal-tag[data-tooltip]:hover::after,
.lv-cal-tag[data-tooltip]:focus-within::before,
.lv-cal-tag[data-tooltip]:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.lv-cal-tag-line1 {
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
  font-weight: 850;
}

.lv-cal-tag-line2 {
  font-size: 11px;
  font-weight: 750;
}

.lv-cal-tag-note {
  background: #fff7ed !important;
  color: #9a3412 !important;
  border: 1px solid #fed7aa;
  font-weight: 700;
  cursor: grab;
}

.lv-cal-tag-note.is-done {
  color: #94a3b8 !important;
  background: #f8fafc !important;
  border-color: #e2e8f0;
  text-decoration: line-through;
}

.lv-cal-tag-note.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.lv-cal-tag-dispatch {
  background: #ede9fe !important;
  color: #5b21b6 !important;
  border: 1px solid #c4b5fd;
  font-weight: 800;
}

.lv-list-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(720px, 100%);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  white-space: normal;
}

.lv-status-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.lv-list-status.lv-st-ok {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.lv-list-status.lv-st-warn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.lv-list-status.lv-st-pend {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.lv-list-status.lv-st-reject {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.lv-list-status.lv-st-dispatch {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.lv-list-status.lv-st-info {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #075985;
}

.lv-cal-cell.lv-cal-drop-target {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #eff6ff !important;
}

#modal-box.calendar-event-modal {
  width: min(480px, 94vw);
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.cal-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.cal-event-kicker {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cal-event-title {
  color: #102a43;
  font-size: 24px;
  font-weight: 900;
  margin-top: 4px;
}

.cal-event-body {
  padding: 18px 24px 24px;
}

.cal-event-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 3px;
}

.cal-event-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 8px 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.cal-event-row.is-done {
  background: #f8fafc;
}

.cal-event-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cal-event-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cal-event-check span {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  background: #fff;
}

.cal-event-check input:checked + span {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 3px #fff;
}

.cal-event-text {
  color: #102a43;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cal-event-row.is-done .cal-event-text {
  color: #94a3b8;
  text-decoration: line-through;
}

.cal-event-del {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff1f2;
  color: #e11d48;
  font-size: 20px;
  font-weight: 700;
}

.cal-event-del:hover {
  background: #ffe4e6;
}

.cal-event-empty {
  color: #94a3b8;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.cal-event-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.cal-event-add input {
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 14px;
  font: inherit;
  outline: none;
}

.cal-event-add input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cal-event-add button {
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}

.page-header.leave-header,
.page-header.ot-header,
.page-header.db-header,
.page-header.admin-header {
  position: relative;
  overflow: hidden;
  align-items: center;
  gap: 24px;
  min-height: 120px;
  margin-bottom: 22px;
  padding: 28px 32px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 48%, rgba(232, 242, 255, 0.96) 100%);
  border: 1px solid #dce8f7;
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(30, 58, 95, 0.10);
}

.page-header .month-nav,
.page-header .db-mode-switch {
  margin-left: 0;
}

.page-header .month-nav {
  justify-content: flex-end;
}

.page-header.admin-header {
  margin-bottom: 22px;
}

.admin-tab-btn.active {
  background: #f8fafc;
  color: #183a5d;
  border-bottom-color: #5f7fa5;
}

.admin-tab-btn:hover {
  color: #183a5d;
}

.ot-header .page-title,
.admin-header .page-title {
  color: #102a43;
}

.nav-user .role-badge {
  display: none;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 760px) {
  #navbar {
    height: auto;
    min-height: 60px;
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .nav-brand {
    width: 100%;
    margin-right: 0;
  }

  .nav-spacer {
    display: none;
  }

  .page,
  .db-page {
    padding: 14px;
  }

  .page-header {
    padding: 16px;
  }

  .page-actions,
  .page-header .month-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .page-title {
    font-size: 18px;
  }

  .personal-comp-summary {
    margin-top: 14px;
    padding: 16px;
  }

  .personal-comp-title {
    font-size: 20px;
  }

  .personal-comp-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .month-nav.month-jump {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .month-nav-years {
    padding: 0 6px;
  }

  .month-year-only .month-nav-years {
    overflow-x: auto;
  }

  .month-year-tab {
    flex: 0 0 auto;
    min-width: 68px;
    padding: 7px 12px 8px;
  }

  .month-nav-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .month-nav-months {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .month-picker-btn,
  .month-nav-today {
    min-width: 0;
  }

  .cycle-toolbar-tabs,
  .leave-view-tabs {
    flex: 0 0 auto;
  }

  .db-rec-header-stack,
  .db-rec-filter-nav {
    width: 100%;
    justify-content: flex-start;
    flex-basis: 100%;
  }

  .db-rec-filter-nav .month-strip {
    flex: 1 1 100%;
  }

  .month-strip {
    flex-basis: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .month-strip-track {
    margin-left: 0;
  }

  .month-strip-btn {
    flex: 0 0 44px;
  }

  .month-focus-btn {
    flex-basis: 36px;
  }
}

@media (max-width: 420px) {
  .month-nav-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .personal-comp-card-grid {
    grid-template-columns: 1fr;
  }

  .month-strip-btn {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
  }

  .month-focus-btn {
    margin-right: 0;
    flex-basis: 36px;
    width: 36px;
    min-width: 36px;
  }
}

@media (max-width: 900px) {
  .lv-cal-grid {
    overflow-x: auto;
  }

  .lv-cal-head,
  .lv-cal-cell {
    min-width: 128px;
  }
}

#modal-box.leave-modal-box {
  --leave-card-pad-y: 20px;
  --leave-card-pad-x: 22px;
  --leave-control-h: 54px;
  --leave-control-radius: 8px;
  --leave-section-title-fs: 17px;
  --leave-control-fs: 17px;
  --leave-proxy-fs: 16px;
  width: min(1060px, 96vw);
  padding: 24px 28px;
  border-radius: 18px;
  max-height: 94vh;
  background: rgba(255, 255, 255, 0.98);
}

.leave-modal-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 48px;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
  min-height: 104px;
  color: #102a43;
  margin: -24px -28px 22px;
  padding: 18px 38px;
  border: 1px solid #d7e5f6;
  border-width: 1px 0;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(110deg, rgba(239, 246, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 58%, rgba(235, 244, 255, 0.95) 100%);
  box-shadow: inset 0 -1px 0 rgba(203, 213, 225, 0.55);
}

.leave-modal-title::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 260px;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(191, 219, 254, 0), rgba(96, 165, 250, 0.22));
  clip-path: polygon(28% 100%, 100% 100%, 100% 0, 78% 14%, 66% 42%, 50% 67%);
  pointer-events: none;
}

.leave-modal-title::after {
  content: "";
  position: absolute;
  right: 52px;
  bottom: -18px;
  width: 210px;
  height: 84px;
  background: rgba(37, 99, 235, 0.12);
  clip-path: polygon(0 100%, 100% 100%, 100% 38%, 78% 22%, 58% 42%, 34% 72%);
  pointer-events: none;
}

.leave-title-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.leave-title-copy {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  gap: 4px 8px;
  min-width: 0;
}

.leave-title-date,
.leave-title-action {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.leave-title-subtitle {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.leave-title-applicant {
  display: grid;
  grid-template-columns: 42px auto;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  min-height: 62px;
  padding: 10px 16px;
  border: 1px solid #d7e3f2;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(30, 58, 95, 0.08);
  color: #102a43;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.leave-title-user-icon {
  width: 36px;
  height: 36px;
  border: 3px solid #2563eb;
  border-radius: 50%;
  position: relative;
  background: #eff6ff;
}

.leave-title-user-icon::before,
.leave-title-user-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
}

.leave-title-user-icon::before {
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.leave-title-user-icon::after {
  bottom: 7px;
  width: 18px;
  height: 9px;
  border-radius: 11px 11px 5px 5px;
}

.leave-title-applicant-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.leave-title-applicant-label,
.leave-title-applicant-name {
  line-height: 1.2;
}

.leave-title-applicant-label {
  color: #48617c;
  font-size: 12px;
  font-weight: 700;
}

.leave-title-applicant-name {
  min-width: 64px;
  color: #102a43;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.leave-title-applicant-select {
  min-width: 76px;
  border: 0;
  border-radius: 8px;
  padding: 0 24px 0 0;
  color: #102a43;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
  outline: none;
}

.leave-title-applicant-select:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.leave-modal-title .modal-close {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  border: 1px solid #dbe5f0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: #475569;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.leave-modal-title .modal-close:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.leave-title-mark,
.leave-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
}

.leave-title-mark {
  width: 50px;
  height: 50px;
  color: #2563eb;
  background: #eef4ff;
}

.leave-icon {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.leave-title-icon {
  width: 31px;
  height: 31px;
  object-fit: contain;
  display: block;
}

.leave-icon-img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  display: block;
}

.leave-icon.blue { color: #2563eb; background: #eff6ff; }
.leave-icon.green { color: #16a34a; background: #f0fdf4; }
.leave-icon.amber { color: #d97706; background: #fffbeb; }

.leave-icon.has-image {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.leave-modal-body {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(430px, 1.08fr);
  gap: 18px 20px;
  max-height: none;
  overflow: visible;
  padding: 2px 0 2px;
}

.leave-modal-body.is-dispatch {
  grid-template-columns: minmax(420px, 1fr);
  max-width: 720px;
}

.leave-mode-switch {
  grid-column: 1;
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 6px;
  border: 1px solid #d7e3f2;
  border-radius: 12px;
  background: #f4f8fd;
}

.leave-mode-btn {
  min-width: 116px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #60758f;
  font-size: 14px;
  font-weight: 850;
}

.leave-mode-btn:hover {
  background: #e8f2ff;
  color: #1f4b7a;
}

.leave-mode-btn.is-selected {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
  box-shadow: 0 8px 18px rgba(30, 58, 95, 0.16);
}

.leave-shift-card,
.leave-time-card,
.leave-type-card {
  grid-column: 1;
}

.leave-side-card {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: start;
}

.leave-modal-body.is-dispatch .leave-time-card,
.leave-dispatch-card,
.leave-dispatch-note-card {
  grid-column: 1;
  grid-row: auto;
}

.leave-dispatch-grid {
  display: grid;
  grid-template-columns: repeat(var(--dispatch-cols, 4), minmax(0, 1fr));
  gap: 10px;
}

.leave-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: var(--leave-card-pad-y) var(--leave-card-pad-x);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.leave-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #102a43;
  font-size: var(--leave-section-title-fs);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}

.leave-hidden-select {
  display: none;
}

.leave-clean-select {
  width: 100%;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  padding: 11px 14px;
  color: #102a43;
  font: inherit;
  background: #fff;
}

.leave-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.leave-shift-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.leave-pill,
.leave-proxy-btn {
  min-height: var(--leave-control-h);
  border: 1px solid #d6dee9;
  border-radius: var(--leave-control-radius);
  background: #fff;
  color: #102a43;
  font-size: var(--leave-control-fs);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.leave-pill:hover,
.leave-proxy-btn:hover:not(:disabled) {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.leave-pill.is-selected,
.leave-proxy-btn.is-selected {
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb inset;
}

.leave-proxy-btn:disabled,
.leave-proxy-btn.is-disabled {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.leave-proxy-btn.is-cap-blocked {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.leave-proxy-btn.is-selected:disabled,
.leave-proxy-btn.is-selected.is-disabled {
  border-color: #cbd5e1;
  color: #64748b;
  box-shadow: 0 0 0 1px #cbd5e1 inset;
}

.leave-check {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.leave-time-row {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) 16px minmax(112px, 1fr) 56px;
  gap: 12px;
  align-items: end;
}

.leave-time-field label {
  display: block;
  margin-bottom: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.leave-time-input {
  width: 100%;
  height: var(--leave-control-h);
  border: 1px solid #d6dee9;
  border-radius: var(--leave-control-radius);
  text-align: center;
  font-size: 24px;
  line-height: 1;
  outline: none;
}

.leave-time-input:focus,
.leave-note-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.leave-time-sep,
.leave-duration {
  align-self: center;
  font-size: 16px;
  font-weight: 800;
  padding-top: 22px;
}

.leave-time-sep { color: #102a43; }
.leave-duration { color: #2563eb; }

.leave-dispatch-time-hint {
  margin-top: 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.leave-dispatch-time-warning {
  margin-top: 12px;
  margin-bottom: 0;
}

.leave-info-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: var(--leave-control-radius);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 700;
}

.leave-info-line span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: #3b82f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.leave-quota-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  margin-top: 12px;
}

.leave-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 20px 0;
}

.leave-proxy-row {
  display: block;
  margin-bottom: 24px;
}

.leave-proxy-row .leave-section-label {
  margin-bottom: 14px;
}

.leave-proxy-row.is-unavailable .leave-section-label {
  color: #64748b;
}

.leave-proxy-section-label {
  flex-wrap: wrap;
  gap: 8px 10px;
}

.leave-proxy-time-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.leave-proxy-row.is-unavailable .leave-proxy-time-badge {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.leave-proxy-grid {
  display: grid;
  grid-template-columns: repeat(var(--proxy-cols, 1), minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.leave-proxy-btn {
  width: 100%;
  min-height: var(--leave-control-h);
  padding: 0 6px;
  background: var(--proxy-bg, #fff);
  border-color: var(--proxy-border, #d6dee9);
  color: var(--proxy-fg, #102a43);
  font-size: var(--proxy-name-fs, var(--leave-proxy-fs));
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.leave-proxy-btn:hover:not(:disabled) {
  border-color: var(--proxy-border, #93c5fd);
  color: var(--proxy-fg, #102a43);
  filter: brightness(0.98);
}

.leave-proxy-btn.is-selected {
  color: var(--proxy-fg, #102a43);
  box-shadow: 0 0 0 2px #2563eb inset;
}

.leave-proxy-btn:disabled,
.leave-proxy-btn.is-disabled {
  background: var(--proxy-bg, #f1f5f9);
  border-color: var(--proxy-border, #e2e8f0);
  color: var(--proxy-fg, #94a3b8);
  opacity: 0.48;
}

.leave-proxy-btn.is-cap-blocked {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  opacity: 0.78;
}

.leave-proxy-btn.leave-proxy-none {
  min-height: 50px;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  color: #475569;
  opacity: 1;
  font-size: 16px;
  font-weight: 900;
  box-shadow: none;
}

.leave-proxy-btn.leave-proxy-none::before,
.leave-proxy-btn.leave-proxy-none::after {
  content: '';
  width: 34px;
  height: 1px;
  background: #cbd5e1;
}

.leave-proxy-btn.leave-proxy-none.is-selected {
  background:
    repeating-linear-gradient(135deg, rgba(15, 23, 42, 0.06) 0 8px, rgba(15, 23, 42, 0.02) 8px 16px),
    #f8fafc;
  border: 2px solid #334155;
  color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.leave-proxy-btn.leave-proxy-none.is-selected::before,
.leave-proxy-btn.leave-proxy-none.is-selected::after {
  background: #64748b;
}

.leave-proxy-btn.leave-proxy-none:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #64748b;
  color: #334155;
  filter: none;
}

.leave-proxy-grid-unavailable {
  pointer-events: none;
}

.leave-proxy-grid-unavailable .leave-proxy-btn {
  filter: grayscale(0.32);
}

.leave-note-input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid #d6dee9;
  border-radius: var(--leave-control-radius);
  padding: 12px 14px;
  color: #102a43;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
}

.leave-note-count {
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  margin-top: 6px;
}

.leave-modal-footer {
  margin-top: 20px;
  padding-top: 18px;
  gap: 18px;
}

.leave-modal-footer .btn-cancel,
.leave-modal-footer .btn-confirm {
  min-width: 120px;
  height: 46px;
  border-radius: var(--leave-control-radius);
  font-size: 16px;
  font-weight: 800;
}

.leave-modal-footer .btn-confirm {
  background: #2563eb;
}

@media (max-width: 860px) {
  #modal-box.leave-modal-box {
    padding: 18px;
  }

  .leave-modal-title {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 12px;
    min-height: auto;
    margin: -18px -18px 20px;
    padding: 16px 18px;
  }

  .leave-title-left {
    min-width: 0;
    gap: 12px;
  }

  .leave-title-copy {
    grid-template-columns: auto;
    gap: 2px;
  }

  .leave-title-date,
  .leave-title-action {
    font-size: 22px;
  }

  .leave-title-applicant {
    grid-column: 1 / -1;
    grid-template-columns: 42px minmax(0, 1fr);
    width: 100%;
    gap: 12px;
    box-sizing: border-box;
  }

  .leave-title-applicant-name,
  .leave-title-applicant-select {
    text-align: left;
  }

  .leave-card {
    padding: 18px;
  }

  .leave-modal-body {
    grid-template-columns: 1fr;
  }

  .leave-time-row,
  .leave-proxy-row {
    grid-template-columns: 1fr;
  }

  .leave-modal-body,
  .leave-shift-card,
  .leave-time-card,
  .leave-type-card,
  .leave-side-card {
    grid-column: auto;
    grid-row: auto;
  }

  .leave-side-card {
    position: static;
  }

  .leave-time-sep,
  .leave-duration {
    padding-top: 0;
  }

  .leave-choice-grid {
    grid-template-columns: 1fr;
  }

  .leave-proxy-grid {
    grid-template-columns: repeat(var(--proxy-cols, 1), minmax(0, 1fr));
    gap: 8px;
  }

  .leave-proxy-btn {
    min-height: 44px;
    padding: 0 4px;
    font-size: var(--proxy-name-fs, 13px);
  }
}

/* Overtime modal polish */
#modal-box.ot-modal-box {
  width: 480px;
  padding: 0;
  overflow: hidden;
}

#modal-box.ot-modal-box .modal-title {
  margin: 0;
  padding: 22px 24px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 18px;
  font-weight: 850;
}

#modal-box.ot-modal-box .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ot-modal-body {
  max-height: calc(90vh - 148px);
  overflow-y: auto;
  padding: 18px 24px;
}

.ot-info-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #dbe5f1;
}

.ot-info-card div {
  min-width: 0;
}

.ot-info-card span {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.ot-info-card strong {
  display: block;
  color: #102a43;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ot-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.ot-modal-box .ot-field {
  margin-bottom: 14px;
}

.ot-modal-box .ot-field label {
  margin-bottom: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.ot-modal-box .ot-field input,
.ot-modal-box .ot-field select,
.ot-modal-box .ot-field textarea,
.ot-readonly-value,
.ot-readonly-note {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #d6dee9;
  border-radius: 10px;
  background: #fff;
  color: #102a43;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
}

.ot-modal-box .ot-field input,
.ot-modal-box .ot-field select {
  padding: 0 12px;
}

.ot-modal-box .ot-field textarea {
  min-height: 70px;
  padding: 12px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.ot-readonly-value,
.ot-readonly-note {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
}

.ot-readonly-note {
  min-height: 64px;
  align-items: flex-start;
  line-height: 1.6;
  font-weight: 600;
}

.ot-time-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ot-hours-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ot-hour-btn {
  min-height: 42px;
  border: 1px solid #d6dee9;
  border-radius: 10px;
  background: #f8fafc;
  color: #102a43;
  font-size: 14px;
  font-weight: 850;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.ot-hour-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.ot-hour-btn.is-selected {
  border-color: #2563eb;
  background: #1e3a8a;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.ot-modal-box .ot-comp-preview {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.ot-modal-box .ot-comp-preview span {
  font-size: 13px;
  font-weight: 800;
}

.ot-modal-box .ot-comp-preview strong {
  color: #1d4ed8;
  font-size: 22px;
  font-weight: 900;
}

.ot-modal-box .ot-comp-preview small {
  font-size: 13px;
  font-weight: 800;
}

#modal-box.ot-modal-box .modal-footer {
  margin: 0;
  padding: 16px 24px 20px;
  background: #f8fafc;
}

#modal-box.ot-modal-box .btn-delete,
#modal-box.ot-modal-box .btn-cancel,
#modal-box.ot-modal-box .btn-confirm {
  min-width: 72px;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

#modal-box.ot-confirm-box {
  width: 430px;
}

#modal-box.ot-confirm-box .modal-footer {
  border-top: 0;
  background: transparent;
  padding: 18px 0 0;
}

.ot-confirm-modal {
  padding: 24px;
}

.ot-confirm-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #fee2e2;
  color: #b42318;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
}

.ot-confirm-title {
  color: #102a43;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
}

.ot-confirm-text {
  color: #64748b;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.6;
}

.ot-delete-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff7f7;
}

.ot-delete-summary div {
  min-width: 0;
}

.ot-delete-summary span {
  display: block;
  margin-bottom: 3px;
  color: #991b1b;
  font-size: 11px;
  font-weight: 800;
}

.ot-delete-summary strong {
  display: block;
  color: #102a43;
  font-size: 14px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.ot-confirm-footer .btn-delete,
.ot-delete-confirm {
  margin-right: 0;
  background: #b42318;
  color: #fff;
}

.ot-confirm-footer .btn-delete:hover,
.ot-delete-confirm:hover {
  background: #991b1b;
}

#modal-box.payout-modal-box {
  width: 430px;
}

#modal-box.payout-modal-box .modal-title {
  margin-bottom: 18px;
}

.payout-balance-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #ddd6fe;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eef6ff 100%);
}

.payout-balance-item {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.payout-balance-item span {
  display: block;
  margin-bottom: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.payout-balance-item strong {
  display: block;
  color: #6d28d9;
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.payout-balance-item small {
  margin-left: 5px;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.payout-balance-item.muted strong {
  color: #0f766e;
}

.payout-modal-box .ot-field {
  margin-bottom: 16px;
}

.payout-modal-box .ot-field label {
  color: #102a43;
  font-size: 13px;
  font-weight: 900;
}

.payout-modal-box .ot-field input {
  height: 42px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 750;
}

.payout-modal-box .modal-footer {
  margin-top: 20px;
}

/* Overtime detail modal */
#modal-box.ot-detail-modal {
  width: 720px;
  padding: 0;
  overflow: hidden;
}

#modal-box.ot-detail-modal .modal-title {
  margin: 0;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #102a43;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
}

#modal-box.ot-detail-modal .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ot-detail-summary {
  display: grid;
  grid-template-columns: minmax(310px, 1.9fr) repeat(3, minmax(108px, 1fr));
  gap: 10px;
  padding: 18px 24px 14px;
  background: #fbfdff;
}

.ot-detail-cycle,
.ot-detail-stat {
  min-height: 72px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  box-sizing: border-box;
}

.ot-detail-cycle span,
.ot-detail-stat span {
  display: block;
  margin-bottom: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.ot-detail-cycle strong {
  display: block;
  color: #102a43;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
  white-space: nowrap;
}

.ot-detail-stat strong {
  display: block;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ot-detail-stat small {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 850;
}

.ot-detail-stat.purple {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.ot-detail-stat.purple strong,
.ot-detail-stat.purple span {
  color: #6d28d9;
}

.ot-detail-stat.red {
  background: #fff1f2;
  border-color: #fecdd3;
}

.ot-detail-stat.red strong,
.ot-detail-stat.red span {
  color: #be123c;
}

.ot-detail-stat.green {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.ot-detail-stat.green strong,
.ot-detail-stat.green span {
  color: #047857;
}

.ot-detail-table-wrap {
  max-height: 52vh;
  overflow: auto;
  margin: 0 24px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  background: #fff;
}

.ot-detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  table-layout: fixed;
}

.ot-detail-table th,
.ot-detail-table td {
  padding: 12px 14px;
  border-right: 1px solid #e5ecf5;
  border-bottom: 1px solid #e5ecf5;
  color: #102a43;
  line-height: 1.35;
}

.ot-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4fb;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.ot-detail-table th:last-child,
.ot-detail-table td:last-child {
  border-right: 0;
}

.ot-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.ot-detail-table td {
  font-weight: 700;
}

.ot-detail-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ot-detail-table .comp {
  color: #6d28d9;
  font-weight: 950;
}

.ot-detail-table .payout {
  color: #dc2626;
  font-weight: 950;
}

.ot-detail-table .empty {
  padding: 28px 16px;
  color: #94a3b8;
  text-align: center;
  font-weight: 750;
}

.ot-detail-table .section-row td {
  background: #fff7f7;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

#modal-box.ot-detail-modal .modal-footer {
  margin: 0;
  padding: 18px 24px 22px;
  border-top: 0;
  background: #fbfdff;
}

#modal-box.ot-detail-modal .btn-cancel {
  min-width: 84px;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 850;
}

.ot-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ot-weekend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.ot-rest-day-note {
  margin-top: -4px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 800;
}

.rest-ot-review {
  display: block;
}

.rest-ot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.rest-ot-help,
.rest-ot-empty {
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.rest-ot-quota-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.rest-ot-quota-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
}

.rest-ot-quota-chip.is-over {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.rest-ot-quota-chip.is-active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.rest-ot-error {
  min-height: 0;
  margin-bottom: 10px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
}

.rest-ot-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.rest-ot-check input {
  width: 16px;
  height: 16px;
}

.rest-ot-table tr.is-over td {
  background: #fff7ed;
}

.rest-ot-table th,
.rest-ot-table td {
  text-align: center !important;
  vertical-align: middle;
}

.rest-ot-table .ot-date-wrap {
  justify-content: center;
}

.rest-ot-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.rest-ot-status.is-ok {
  background: #dcfce7;
  color: #166534;
}

.rest-ot-status.is-warn {
  background: #fef3c7;
  color: #92400e;
}

.rest-ot-status.is-over {
  background: #fee2e2;
  color: #991b1b;
}

.rest-ot-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

@media (max-width: 560px) {
  #modal-box.ot-modal-box {
    width: min(94vw, 480px);
  }

  #modal-box.payout-modal-box {
    width: min(94vw, 430px);
  }

  #modal-box.ot-detail-modal {
    width: min(94vw, 720px);
  }

  #modal-box.ot-modal-box .modal-title,
  #modal-box.ot-detail-modal .modal-title,
  .ot-modal-body,
  .ot-detail-summary,
  #modal-box.ot-detail-modal .modal-footer,
  #modal-box.ot-modal-box .modal-footer,
  .ot-confirm-modal {
    padding-left: 18px;
    padding-right: 18px;
  }

  .ot-info-card,
  .ot-form-grid,
  .payout-balance-card,
  .ot-detail-summary,
  .ot-delete-summary {
    grid-template-columns: 1fr;
  }

  .ot-detail-table-wrap {
    margin: 0 18px;
  }

  .ot-detail-cycle strong {
    white-space: normal;
  }

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