  :root {
    /* Cool slate-tinted neutral, not the warm-cream tone every AI-generated
       dashboard defaults to. Sidebar fills solid navy instead of white, so
       the shell reads as real light/dark structure rather than one flat
       plane of near-white cards. */
    --page-bg:     #EDEFF3;
    --sidebar-bg:  var(--navy);
    --topbar-bg:   #FFFFFF;
    --card-bg:     #FFFFFF;
    --card-hover:  #F9FAFC;
    --input-bg:    #F5F6F9;
    --modal-bg:    #FFFFFF;

    --navy:        #0B1F3A;
    --navy-mid:    #1A3560;
    --gold:        #C9922A;
    --gold-light:  #E8B84B;
    --saffron:     #E8630A;

    --text-1:      #0B1F3A;
    --text-2:      #2C3A54;
    --text-3:      #5B6B85;

    --border:      #E3E6ED;
    --border-md:   #D2D6E2;
    --border-gold: rgba(201,146,42,0.30);

    --success:     #1A7A52;
    --danger:      #C0392B;

    --acc-teal:    #0D9488;
    --acc-blue:    #2563EB;
    --acc-amber:   #D97706;
    --acc-green:   #15803D;

    --sidebar-w:   256px;
    --topbar-h:    62px;
    /* Radius now signals hierarchy instead of being one flat value on
       everything: 8px for cards/controls (a utility feel appropriate for
       a data-dense HR tool), 16px reserved for surfaces that actually
       float above the page (modals, the login card). */
    --radius:      8px;
    --radius-lg:   16px;

    --shadow-sm:   0 1px 3px rgba(11,31,58,0.07), 0 1px 2px rgba(11,31,58,0.04);
    --shadow-md:   0 4px 12px rgba(11,31,58,0.09), 0 2px 4px rgba(11,31,58,0.05);
    --shadow-lg:   0 16px 40px rgba(11,31,58,0.13), 0 4px 12px rgba(11,31,58,0.07);
  }

  *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

  html, body {
    height:100%;
    width:100%;
    max-width:100%;
    font-family:'DM Sans', sans-serif;
    background: var(--page-bg);
    color: var(--text-1);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust:100%;
    touch-action:manipulation;
    overflow-x:hidden;
  }

  /* Safety net: nothing should ever be able to push the viewport wider
     than the screen on mobile. Long emails/addresses/URLs wrap instead
     of forcing horizontal page-scroll. */
  img { max-width:100%; }
  #app, .main, .content { max-width:100vw; }

  ::-webkit-scrollbar { width:5px; height:5px; }
  ::-webkit-scrollbar-track { background:transparent; }
  ::-webkit-scrollbar-thumb { background:var(--border-md); border-radius:4px; }

  /* ═══════════════════════════════════════
     MOTION — shared keyframes + reduced-motion opt-out.
     These run automatically whenever an element is freshly inserted
     into the DOM, which is exactly what happens on every page render
     in this app (page-content.innerHTML is replaced wholesale) — so
     no JS changes were needed to wire these up.
  ═══════════════════════════════════════ */
  @keyframes fadeInUp {
    from { opacity:0; transform:translateY(10px); }
    to   { opacity:1; transform:translateY(0); }
  }
  @keyframes popIn {
    from { opacity:0; transform:scale(.94) translateY(6px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
  }
  @keyframes slideInLeft {
    from { opacity:0; transform:translateX(-10px); }
    to   { opacity:1; transform:translateX(0); }
  }
  @keyframes modalPop {
    from { opacity:0; transform:scale(.95) translateY(8px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
  }
  @keyframes countPulse {
    0%   { opacity:0; transform:scale(.85); }
    60%  { opacity:1; transform:scale(1.05); }
    100% { opacity:1; transform:scale(1); }
  }
  @keyframes spinSlow { to { transform:rotate(360deg); } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration:.001ms !important;
      animation-iteration-count:1 !important;
      transition-duration:.001ms !important;
      scroll-behavior:auto !important;
    }
  }

  /* ═══════════════════════════════════════
     LOGIN
  ═══════════════════════════════════════ */
  #login-screen {
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:
      radial-gradient(ellipse 65% 50% at 5% 50%, rgba(201,146,42,0.07) 0%, transparent 65%),
      radial-gradient(ellipse 50% 40% at 95% 10%, rgba(11,31,58,0.05) 0%, transparent 60%),
      linear-gradient(150deg, #EEF0F5 0%, #EDEFF3 50%, #E8EAF1 100%);
  }

  .login-wrap { width:100%; max-width:420px; }

  .login-brand {
    text-align:center;
    margin-bottom:28px;
  }
  .login-brand img {
    height:52px; width:auto; object-fit:contain;
    display:block; margin:0 auto 10px;
  }
  .login-brand .portal-label {
    font-size:10px; font-weight:700;
    letter-spacing:4px; text-transform:uppercase;
    color:var(--gold); display:block; margin-top:6px;
  }

  .login-card {
    background: #FFFFFF;
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:38px 36px;
    box-shadow: var(--shadow-lg);
    position:relative;
    overflow:hidden;
  }
  .login-card::before {
    content:'';
    position:absolute; top:0; left:0; right:0; height:3px;
    background:linear-gradient(90deg, var(--navy) 0%, var(--gold) 50%, var(--saffron) 100%);
  }
  .login-card h2 {
    font-family:'Cormorant Garamond', serif;
    font-size:26px; font-weight:700;
    color:var(--navy); margin-bottom:4px;
  }
  .login-sub {
    font-size:13.5px; color:var(--text-3); margin-bottom:26px;
  }

  /* ═══════════════════════════════════════
     FORM FIELDS
  ═══════════════════════════════════════ */
  .field { margin-bottom:16px; }
  .field label {
    display:block; font-size:10.5px; font-weight:700;
    color:var(--text-3); letter-spacing:1.5px;
    text-transform:uppercase; margin-bottom:6px;
  }
  .field input,
  .field select,
  .field textarea {
    width:100%; padding:11px 14px;
    background:var(--input-bg);
    border:1.5px solid var(--border);
    border-radius:9px;
    font-family:'DM Sans', sans-serif;
    /* 16px is deliberate, not a typo: any input font-size below 16px makes
       iOS Safari zoom in on focus. With user-scalable=no in the viewport
       meta tag, that zoom can get stuck, which is what makes the page look
       like it "goes outside" the screen on a phone. */
    font-size:16px; color:var(--text-1);
    outline:none;
    transition:border-color .2s, background .2s, box-shadow .2s;
    -webkit-appearance:none;
    max-width:100%;
  }
  .field input::placeholder { color:var(--text-3); }
  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    border-color:var(--gold);
    background:#FFFDF8;
    box-shadow:0 0 0 3px rgba(201,146,42,0.10);
  }
  .field select option { background:#fff; color:var(--text-1); }
  .field textarea { resize:vertical; min-height:72px; line-height:1.55; }

  .loc-checklist {
    max-height:170px; overflow-y:auto;
    border:1.5px solid var(--border); border-radius:9px;
    padding:6px 12px; background:var(--input-bg);
  }
  .loc-check-item {
    display:flex; align-items:center; gap:8px;
    padding:7px 2px; font-size:13.5px; color:var(--text-1);
    border-bottom:1px solid var(--border); cursor:pointer;
  }
  .loc-check-item:last-child { border-bottom:none; }
  .loc-check-item input[type="checkbox"] {
    width:16px; height:16px; flex-shrink:0;
    padding:0; margin:0; border:1.5px solid var(--border-md);
    background:#fff; border-radius:4px;
    -webkit-appearance:checkbox; appearance:checkbox;
    accent-color:var(--gold); cursor:pointer;
  }

  /* ═══════════════════════════════════════
     BUTTONS
  ═══════════════════════════════════════ */
  .btn {
    padding:11px 20px; border:none; border-radius:9px;
    font-family:'DM Sans', sans-serif; font-size:14px; font-weight:600;
    cursor:pointer; transition:all .18s;
    display:inline-flex; align-items:center; justify-content:center;
    gap:6px; white-space:nowrap;
    -webkit-tap-highlight-color:transparent;
  }
  .btn:active { transform:scale(.96); }
  .btn-primary {
    background:linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color:#FFFFFF;
    box-shadow: 0 4px 14px rgba(11,31,58,0.22);
  }
  .btn-primary:hover  { transform:translateY(-1px); box-shadow:0 8px 22px rgba(11,31,58,0.30); }
  .btn-primary:active { transform:translateY(0); }
  .btn-secondary {
    background:#F2F3F7; color:var(--text-2);
    border:1.5px solid var(--border-md);
  }
  .btn-secondary:hover { background:var(--border); color:var(--text-1); }
  .btn-success {
    background:rgba(26,122,82,0.10); color:var(--success);
    border:1.5px solid rgba(26,122,82,0.22);
  }
  .btn-success:hover { background:rgba(26,122,82,0.18); }
  .btn-danger {
    background:rgba(192,57,43,0.08); color:var(--danger);
    border:1.5px solid rgba(192,57,43,0.20);
  }
  .btn-danger:hover { background:rgba(192,57,43,0.15); }
  .btn-gold {
    background:linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color:#fff;
    box-shadow:0 4px 14px rgba(201,146,42,0.28);
  }
  .btn-gold:hover { transform:translateY(-1px); box-shadow:0 8px 22px rgba(201,146,42,0.38); }
  .btn-full { width:100%; }
  .btn-sm { padding:7px 12px; font-size:12px; border-radius:7px; }

  /* ═══════════════════════════════════════
     APP SHELL
  ═══════════════════════════════════════ */
  #app { display:none; height:100vh; overflow:hidden; position:relative; }

  /* ── SIDEBAR ── */
  .sidebar {
    position:fixed; top:0; left:0;
    width:var(--sidebar-w); height:100%;
    background: var(--sidebar-bg);
    border-right:1px solid var(--border);
    display:flex; flex-direction:column;
    z-index:300;
    transition:transform .26s cubic-bezier(.4,0,.2,1);
    overflow-y:auto; overflow-x:hidden;
    box-shadow: 2px 0 12px rgba(11,31,58,0.04);
  }

  .sidebar-brand {
    padding:18px 20px;
    border-bottom:1px solid rgba(255,255,255,0.08);
    display:flex; align-items:center; gap:12px; flex-shrink:0;
    background:var(--navy);
  }
  .sidebar-brand img {
    height:36px; width:auto; object-fit:contain;
    flex-shrink:0; filter:brightness(10);
  }
  .brand-text .name {
    display:none;
  }
  .brand-text .tag {
    font-size:17px; font-weight:800; color:var(--gold-light);
    letter-spacing:2px; text-transform:uppercase;
  }

  .nav-section {
    padding:18px 18px 5px;
    font-size:9px; font-weight:700;
    color:rgba(255,255,255,0.34); letter-spacing:2px;
    text-transform:uppercase; flex-shrink:0;
  }

  .nav-item {
    margin:2px 10px; padding:10px 13px;
    cursor:pointer; display:flex; align-items:center; gap:11px;
    color:rgba(255,255,255,0.68); font-size:13.5px; font-weight:500;
    border-radius:9px; transition:all .16s;
    -webkit-tap-highlight-color:transparent; flex-shrink:0;
    position:relative;
  }
  .nav-item:hover { background:rgba(255,255,255,0.07); color:#fff; transform:translateX(2px); }
  .nav-item:hover .nav-icon { transform:scale(1.15); }
  .nav-item.active {
    background:rgba(201,146,42,0.16);
    color:var(--gold-light);
    border:1px solid rgba(201,146,42,0.32);
    font-weight:600;
  }
  .nav-item.active::before {
    content:'';
    position:absolute; left:-10px; top:22%; bottom:22%;
    width:3px; border-radius:0 3px 3px 0;
    background:var(--gold);
    transition:top .18s, bottom .18s;
  }
  .nav-icon { font-size:16px; width:20px; text-align:center; flex-shrink:0; transition:transform .16s; }

  .sidebar-footer {
    margin-top:auto; padding:14px; position:relative;
    border-top:1px solid rgba(255,255,255,0.09); flex-shrink:0;
  }
  .user-pill {
    background:rgba(255,255,255,0.05);
    border:1px solid rgba(255,255,255,0.10);
    border-radius:10px; padding:11px 13px;
    display:flex; align-items:center; gap:10px;
    cursor:pointer; transition:background .15s, border-color .15s;
    -webkit-tap-highlight-color:transparent;
  }
  .user-pill:hover, .user-pill:focus-visible {
    background:rgba(255,255,255,0.09); border-color:rgba(255,255,255,0.18); outline:none;
  }
  .user-pill-caret {
    font-size:10px; color:rgba(255,255,255,0.45); margin-left:auto; flex-shrink:0;
    transition:transform .15s;
  }
  .user-pill[aria-expanded="true"] .user-pill-caret { transform:rotate(180deg); }
  .sidebar-user-menu {
    display:none; position:absolute; left:14px; right:14px; bottom:calc(100% - 2px);
    background:#fff; border:1px solid var(--border); border-radius:10px;
    box-shadow:var(--shadow-lg); padding:6px; z-index:310; margin-bottom:8px;
  }
  .sidebar-user-menu.open { display:block; }
  .sup-item {
    padding:10px 12px; border-radius:8px; font-size:13.5px; color:var(--text-2);
    cursor:pointer; display:flex; align-items:center; gap:9px;
    -webkit-tap-highlight-color:transparent;
  }
  .sup-item:hover { background:#F3F4F8; color:var(--navy); }
  .sup-item.sup-danger { color:var(--danger); }
  .sup-item.sup-danger:hover { background:rgba(192,57,43,0.08); }
  .user-avatar {
    width:33px; height:33px;
    background:linear-gradient(135deg, var(--navy), var(--navy-mid));
    border-radius:50%; display:flex; align-items:center; justify-content:center;
    font-size:13px; font-weight:700; color:#fff; flex-shrink:0;
    overflow:hidden; min-width:0; min-height:0;
  }
  .user-avatar img {
    width:33px; height:33px; max-width:33px; max-height:33px;
    object-fit:cover; display:block; border-radius:50%;
  }
  .user-info .uname { font-size:13px; font-weight:600; color:#fff; }
  .user-info .urole { font-size:11px; color:var(--gold-light); text-transform:capitalize; }

  /* ── MOBILE OVERLAY ── */
  .sidebar-overlay {
    display:none; position:fixed; inset:0;
    background:rgba(11,31,58,0.50); z-index:299;
    backdrop-filter:blur(3px);
  }

  /* ── MAIN ── */
  .main {
    margin-left:var(--sidebar-w);
    flex:1 1 auto; min-width:0;
    height:100vh; overflow-y:auto;
    display:flex; flex-direction:column;
    background: var(--page-bg);
  }

  /* ── TOPBAR ── */
  .hamburger {
    display:none; background:none; border:none;
    color:var(--text-2); font-size:21px; cursor:pointer;
    padding:4px; line-height:1;
    -webkit-tap-highlight-color:transparent;
  }
  .page-title {
    font-family:'Cormorant Garamond', serif;
    font-size:22px; font-weight:700; color:var(--navy);
    animation: slideInLeft .3s cubic-bezier(.4,0,.2,1) both;
  }

  /* ── CONTENT ── */
  .content { padding:24px; flex:1; min-width:0; }

  /* ═══════════════════════════════════════
     CARDS
  ═══════════════════════════════════════ */
  .card {
    background: var(--card-bg);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:20px;
    animation: fadeInUp .32s cubic-bezier(.4,0,.2,1) both;
    transition: box-shadow .2s, border-color .2s;
  }
  .card:hover { box-shadow: var(--shadow-sm); border-color:var(--border-md); }

  /* ═══════════════════════════════════════
     STAT CARDS
  ═══════════════════════════════════════ */
  .stat-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px; margin-bottom:20px;
  }
  .stat-card {
    background: var(--card-bg);
    border:1px solid var(--border);
    border-left:3px solid transparent;
    border-radius:var(--radius);
    padding:18px 18px 16px;
    position:relative; overflow:hidden;
    transition:transform .18s, box-shadow .18s, border-color .18s;
    animation: popIn .36s cubic-bezier(.34,1.3,.64,1) both;
  }
  .stat-card:hover { transform:translateY(-2px); box-shadow: var(--shadow-sm); }
  .stat-card:hover .stat-icon { transform:scale(1.12) rotate(-4deg); opacity:0.22; }
  .stat-card:nth-child(1) { border-left-color:var(--acc-teal);  animation-delay:.02s; }
  .stat-card:nth-child(2) { border-left-color:var(--acc-blue);  animation-delay:.08s; }
  .stat-card:nth-child(3) { border-left-color:var(--acc-amber); animation-delay:.14s; }
  .stat-card:nth-child(4) { border-left-color:var(--acc-green); animation-delay:.20s; }
  .stat-num {
    font-family:'Cormorant Garamond', serif;
    font-size:40px; font-weight:700;
    color:var(--navy); line-height:1;
    animation: countPulse .5s cubic-bezier(.34,1.3,.64,1) both .15s;
  }
  .stat-label {
    font-size:11px; color:var(--text-3); margin-top:4px;
    text-transform:uppercase; letter-spacing:1px; font-weight:600;
  }
  .stat-icon {
    position:absolute; top:16px; right:16px;
    font-size:26px; opacity:0.14;
    transition:transform .25s ease, opacity .25s ease;
  }

  /* ═══════════════════════════════════════
     TABLES
  ═══════════════════════════════════════ */
  .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table { width:100%; border-collapse:collapse; font-size:13px; }
  thead tr { background:#F7F8FB; }
  th {
    padding:10px 15px; text-align:left;
    font-size:10px; font-weight:700; color:var(--text-3);
    text-transform:uppercase; letter-spacing:1.2px;
    border-bottom:1.5px solid var(--border-md); white-space:nowrap;
  }
  td {
    padding:12px 15px;
    border-bottom:1px solid var(--border);
    color:var(--text-2); vertical-align:middle;
    overflow-wrap:break-word; word-break:break-word;
  }
  tr:last-child td { border-bottom:none; }
  tr:hover td { background:#FAFBFD; }
  tbody tr {
    animation: fadeInUp .3s cubic-bezier(.4,0,.2,1) both;
    transition: background .12s;
  }
  /* Stagger the first dozen or so rows; rows beyond that just fade in
     together instantly so a long table doesn't feel slow to settle. */
  tbody tr:nth-child(1)  { animation-delay: .01s; }
  tbody tr:nth-child(2)  { animation-delay: .04s; }
  tbody tr:nth-child(3)  { animation-delay: .07s; }
  tbody tr:nth-child(4)  { animation-delay: .10s; }
  tbody tr:nth-child(5)  { animation-delay: .13s; }
  tbody tr:nth-child(6)  { animation-delay: .16s; }
  tbody tr:nth-child(7)  { animation-delay: .19s; }
  tbody tr:nth-child(8)  { animation-delay: .22s; }
  tbody tr:nth-child(9)  { animation-delay: .25s; }
  tbody tr:nth-child(n+10) { animation-delay: .27s; }
  td strong { color:var(--navy); font-weight:600; }
  td code {
    background:rgba(201,146,42,0.10);
    padding:2px 8px; border-radius:5px;
    font-size:11.5px; color:#A07010; font-family:monospace;
  }
  td small { color:var(--text-3); font-size:11.5px; }

  /* ── Action-button overflow menu ──
     Past the first two buttons in an actions cell, the rest are moved
     (by animations.js) behind a "⋯" trigger instead of piling up as a
     wall of gray boxes. The trigger is a plain .btn-secondary.btn-sm —
     it only needs the glyph's spacing tightened up. The menu itself is
     a floating panel (portal'd to <body> so a scrollable .table-wrap
     can never clip it), styled to match the existing topbar profile
     dropdown rather than look like more buttons. */
  .action-more-btn { font-size:15px !important; letter-spacing:1px; padding:7px 11px !important; }
  .action-menu-portal {
    position:fixed; z-index:600; background:#fff; border:1px solid var(--border);
    border-radius:12px; box-shadow:var(--shadow-lg); padding:6px; min-width:180px;
    max-width:min(260px, calc(100vw - 16px));
    display:flex; flex-direction:column; gap:2px;
    animation:popIn .16s cubic-bezier(.34,1.2,.64,1) both;
  }
  .action-menu-portal .btn {
    width:100%; justify-content:flex-start; text-align:left;
    background:transparent !important; border:none !important; box-shadow:none !important;
    color:var(--text-2); padding:9px 11px; border-radius:8px;
    font-weight:500; font-size:13px; white-space:normal;
  }
  .action-menu-portal .btn:hover { background:#F3F4F8 !important; }
  .action-menu-portal .btn.btn-danger  { color:var(--danger); }
  .action-menu-portal .btn.btn-danger:hover  { background:rgba(192,57,43,0.08) !important; }
  .action-menu-portal .btn.btn-success { color:var(--success); }
  .action-menu-portal .btn.btn-success:hover { background:rgba(26,122,82,0.08) !important; }

  /* ── BADGES ── */
  .badge {
    display:inline-flex; align-items:center;
    padding:3px 9px; border-radius:20px;
    font-size:11px; font-weight:600; letter-spacing:.3px; white-space:nowrap;
  }
  .badge-green { background:rgba(26,122,82,0.10); color:#1A7A52; border:1px solid rgba(26,122,82,0.22); }
  .badge-red   { background:rgba(192,57,43,0.10); color:#C0392B; border:1px solid rgba(192,57,43,0.20); }
  .badge-gold  { background:rgba(201,146,42,0.12); color:#9B6B0F; border:1px solid rgba(201,146,42,0.25); }
  .badge-grey  { background:#F2F3F7; color:var(--text-3); border:1px solid var(--border-md); }

  /* ═══════════════════════════════════════
     MODAL
  ═══════════════════════════════════════ */
  .modal-backdrop {
    position:fixed; inset:0; background:rgba(11,31,58,0.50);
    z-index:400; display:none; align-items:center;
    justify-content:center; padding:16px;
    backdrop-filter:blur(6px);
  }
  .modal-backdrop.open { display:flex; }
  .modal {
    background: var(--modal-bg);
    border:1px solid var(--border);
    border-radius:var(--radius-lg); padding:30px;
    width:100%; max-width:520px; max-height:94vh;
    overflow-y:auto; overflow-x:hidden; position:relative;
    box-shadow: var(--shadow-lg);
    box-sizing:border-box;
    animation: modalPop .24s cubic-bezier(.34,1.2,.64,1) both;
  }
  .modal-title {
    font-family:'Cormorant Garamond', serif;
    font-size:22px; font-weight:700;
    color:var(--navy); margin-bottom:20px; padding-right:36px;
  }
  .modal-close {
    position:absolute; top:18px; right:18px;
    background:#F2F3F7; border:1px solid var(--border-md);
    width:30px; height:30px; border-radius:50%;
    cursor:pointer; font-size:18px;
    display:flex; align-items:center; justify-content:center;
    color:var(--text-2); transition:all .18s;
  }
  .modal-close:hover { background:var(--border-md); color:var(--text-1); }
  .form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

  /* Wider modal variant for data-dense screens (e.g. Performance Review
     Executive Summary, per-employee review readout). Desktop only — on
     smaller screens the mobile media queries below already stretch the
     modal to the available width, so no override is needed there. */
  @media (min-width: 901px) {
    .modal.modal-wide { max-width: 1180px; }
  }

  /* ═══════════════════════════════════════
     ATTENDANCE CLOCK
  ═══════════════════════════════════════ */
  .signin-card {
    text-align:center; padding:40px 28px;
    border-radius:var(--radius-lg);
    background: var(--navy);
    border:1px solid var(--border);
    margin-bottom:20px; position:relative; overflow:hidden;
    box-shadow: var(--shadow-lg);
  }
  .signin-card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:3px;
    background:linear-gradient(90deg, var(--acc-teal), var(--gold), var(--saffron));
  }
  .signin-card::after {
    content:''; position:absolute; bottom:-60px; right:-60px;
    width:200px; height:200px; border-radius:50%;
    background:rgba(255,255,255,0.03);
    pointer-events:none;
  }
  .time-display {
    font-family:'Cormorant Garamond', serif;
    font-size:64px; font-weight:700;
    letter-spacing:-2px; color:#FFFFFF; line-height:1;
  }
  .date-display {
    font-size:13px; color:rgba(255,255,255,0.50); margin:8px 0 28px; letter-spacing:.4px;
  }
  .signin-btn {
    padding:14px 48px; font-size:15px; font-weight:700;
    border-radius:50px; border:none; cursor:pointer; transition:all .28s;
    background:linear-gradient(135deg, var(--gold), var(--gold-light));
    color:#fff; box-shadow:0 8px 22px rgba(201,146,42,0.35);
    font-family:'DM Sans', sans-serif;
    -webkit-tap-highlight-color:transparent;
  }
  .signin-btn:hover { transform:translateY(-2px); box-shadow:0 12px 30px rgba(201,146,42,0.45); }
  .signin-btn:active { transform:translateY(0); }
  .signout-btn {
    background:linear-gradient(135deg, #C0392B, #E05A4B) !important;
    box-shadow:0 8px 22px rgba(192,57,43,0.30) !important;
    color:#fff !important;
  }
  .att-info {
    display:flex; align-items:center; justify-content:center;
    gap:28px; margin-top:24px; flex-wrap:wrap;
  }
  .att-info-item { text-align:center; }
  .att-info-item .val {
    font-size:20px; font-weight:700; color:#FFFFFF;
    font-family:'Cormorant Garamond', serif;
  }
  .att-info-item .lbl {
    font-size:10px; color:rgba(255,255,255,0.45);
    text-transform:uppercase; letter-spacing:1px;
  }

  /* ═══════════════════════════════════════
     SECTION / LAYOUT HELPERS
  ═══════════════════════════════════════ */
  .section-header {
    font-family:'Cormorant Garamond', serif;
    font-size:18px; font-weight:700; color:var(--navy); margin-bottom:14px;
  }
  .flex-between {
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:16px; flex-wrap:wrap; gap:10px;
  }
  .gap-8 { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
  .dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
  /* Grid items default to min-width:auto, which lets a wide table force the
     column (and the page) wider than the screen even though .table-wrap has
     overflow-x:auto. min-width:0 hands the overflow to the scrollable
     wrapper instead of the grid track. */
  .dash-grid > * { min-width:0; }

  /* ═══════════════════════════════════════
     TOAST
  ═══════════════════════════════════════ */
  #toast {
    position:fixed; bottom:20px; right:20px; z-index:999;
    background:var(--navy); border:1px solid rgba(255,255,255,0.1);
    color:#fff; padding:13px 18px; border-radius:10px;
    font-size:13px; font-weight:500;
    transform:translateY(80px); opacity:0;
    transition:all .28s cubic-bezier(.4,0,.2,1);
    max-width:280px; box-shadow: var(--shadow-lg);
    font-family:'DM Sans', sans-serif;
  }
  #toast.show { transform:translateY(0); opacity:1; }
  #toast.success { border-left:3px solid #1A7A52; }
  #toast.error   { border-left:3px solid #C0392B; }

  .hidden { display:none !important; }

  /* ═══════════════════════════════════════
     MOBILE — tablet (≤900px)
  ═══════════════════════════════════════ */
  @media (max-width: 900px) {
    /* Sidebar slides in as drawer */
    .sidebar {
      transform:translateX(-100%);
      box-shadow:none;
      width:260px;
    }
    .sidebar.open {
      transform:translateX(0);
      box-shadow:24px 0 64px rgba(11,31,58,0.22);
    }
    .sidebar-overlay.open { display:block; }
    .hamburger { display:flex; }

    /* Main fills full width */
    .main { margin-left:0 !important; }

    /* Grids stack */
    .stat-grid  { grid-template-columns:repeat(2,1fr); gap:10px; }
    .dash-grid  { grid-template-columns:1fr; }
    .form-row   { grid-template-columns:1fr; }

    /* Spacing */
    .content { padding:14px; }

    /* Attendance clock */
    .time-display { font-size:48px; }
    .signin-card  { padding:28px 16px; }

    /* Tables scroll horizontally — never shrink below content */
    .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
    table { min-width:500px; }

  }

  /* ═══════════════════════════════════════
     MOBILE — phone (≤480px)
  ═══════════════════════════════════════ */
  @media (max-width: 480px) {
    :root { --topbar-h: 52px; }

    /* Login */
    #login-screen { padding:16px; }
    .login-card   { padding:26px 18px; }
    .login-brand img { height:42px; }

    /* Stats: 2 per row, compact */
    .stat-grid { grid-template-columns:1fr 1fr; gap:8px; margin-bottom:14px; }
    .stat-card { padding:12px 14px; }
    .stat-num  { font-size:30px; }
    .stat-icon { font-size:20px; top:10px; right:10px; }

    /* Topbar */

    /* Content */
    .content { padding:12px; }

    /* Cards */
    .card { padding:14px; }

    /* Tables */
    table    { min-width:420px; font-size:12px; }
    th, td   { padding:9px 10px; }

    /* Attendance */
    .signin-card { padding:24px 14px; }
    .time-display { font-size:38px; letter-spacing:-1px; }
    .date-display { font-size:11.5px; margin:6px 0 20px; }
    .signin-btn   { padding:12px 28px; font-size:13.5px; }
    .att-info     { gap:14px; margin-top:18px; }
    .att-info-item .val { font-size:16px; }

    /* Modal */
    .modal         { padding:20px 16px; max-width:100%; }
    .modal-title   { font-size:19px; }

    /* Toast full-width */
    #toast { left:10px; right:10px; bottom:12px; max-width:none; font-size:12.5px; }

    /* Buttons */
    .btn-sm { padding:6px 10px; font-size:11.5px; }
    .btn-full { font-size:14px; }

    /* Sidebar footer on small phones */
    .user-pill { padding:9px 10px; }
    .user-info .uname { font-size:12px; }
  }

  /* ═══════════════════════════════════════
     TINY PHONES (≤360px)
  ═══════════════════════════════════════ */
  @media (max-width: 360px) {
    .stat-grid { grid-template-columns:1fr 1fr; gap:6px; }
    .stat-num  { font-size:26px; }
    .time-display { font-size:32px; }
    .content { padding:10px; }
    table { min-width:360px; font-size:11px; }
    th, td { padding:7px 8px; }
  }

/* ═══════════════════════════════════════
   PHONE DATA TABLES — cards, not sideways scroll
   Below ≤640px a data table renders as one card per row instead of a
   cramped, horizontally-scrolling grid: each cell becomes a label/value
   line, using the data-label attribute animations.js copies from the
   table header onto every cell after render. Opt out with the
   "table-grid" class for anything that's a genuine matrix (rows AND
   columns both carry meaning, e.g. the attendance sheet) rather than a
   list of records — those keep scrolling horizontally instead.
═══════════════════════════════════════ */
@media (max-width:640px) {
  .table-wrap table:not(.table-grid) {
    display:block; width:100%; min-width:0 !important;
  }
  .table-wrap table:not(.table-grid) thead { display:none; }
  .table-wrap table:not(.table-grid) tbody { display:block; width:100%; }
  .table-wrap table:not(.table-grid) tr {
    display:block; width:100%; box-sizing:border-box;
    background:var(--card-bg); border:1px solid var(--border);
    border-radius:12px; padding:2px 14px; margin-bottom:10px;
    box-shadow:var(--shadow-sm);
  }
  .table-wrap table:not(.table-grid) tr:hover td { background:transparent; }
  .table-wrap table:not(.table-grid) td {
    display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
    padding:10px 0; border-bottom:1px solid var(--border);
    text-align:right; white-space:normal;
  }
  .table-wrap table:not(.table-grid) td:last-child { border-bottom:none; }
  .table-wrap table:not(.table-grid) td::before {
    content:attr(data-label); flex:0 0 auto; margin-right:auto; margin-top:1px;
    text-align:left; font-size:10px; font-weight:700; text-transform:uppercase;
    letter-spacing:.6px; color:var(--text-3);
  }
  /* Empty-state rows ("No records found", colspan'd across the header) —
     shown as a plain centered line instead of a lopsided label/value row. */
  .table-wrap table:not(.table-grid) td[colspan] {
    display:block; text-align:center; padding:22px 6px; border-bottom:none;
  }
  .table-wrap table:not(.table-grid) td[colspan]::before { content:none; }
  /* A cell holding several action buttons (Edit / Deactivate / etc.) gets
     its own full-width row underneath the label, so the buttons have room
     to wrap instead of squeezing against it. */
  .table-wrap table:not(.table-grid) td.td-actions {
    display:block; text-align:left; padding-top:12px;
  }
  .table-wrap table:not(.table-grid) td.td-actions::before {
    display:block; margin:0 0 8px;
  }
  .table-wrap table:not(.table-grid) td.td-actions > * { margin:0 6px 6px 0; }
}

/* ═══════════════════════════════════════
   TOPBAR PROFILE (name/photo dropdown)
═══════════════════════════════════════ */
.topbar-right { margin-left:12px; position:relative; flex-shrink:0; }
.topbar-profile {
  display:flex; align-items:center; gap:9px; cursor:pointer;
  padding:6px 12px 6px 6px; border-radius:24px; transition:background .15s;
  -webkit-tap-highlight-color:transparent;
}
.topbar-profile:hover { background:#F3F4F8; }
.topbar-avatar {
  width:34px; height:34px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg, var(--navy), var(--navy-mid));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; overflow:hidden;
}
.topbar-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.topbar-profile-name {
  font-size:13.5px; font-weight:600; color:var(--text-1);
  max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.topbar-profile-caret { font-size:10px; color:var(--text-3); margin-left:-2px; }
.topbar-profile-menu {
  display:none; position:absolute; top:calc(100% + 10px); right:0;
  background:#fff; border:1px solid var(--border); border-radius:12px;
  box-shadow:var(--shadow-lg); min-width:180px; padding:6px; z-index:500;
}
.topbar-profile-menu.open { display:block; }
.tp-menu-item {
  padding:10px 12px; border-radius:8px; font-size:13.5px; color:var(--text-2);
  cursor:pointer; display:flex; align-items:center; gap:9px;
  -webkit-tap-highlight-color:transparent;
}
.tp-menu-item:hover { background:#F3F4F8; color:var(--navy); }
.tp-menu-item.tp-menu-danger { color:var(--danger); }
.tp-menu-item.tp-menu-danger:hover { background:rgba(192,57,43,0.08); }

@media (max-width:640px) {
  .topbar-profile-name { display:none; }
  .topbar-profile { padding:6px; }
  .topbar-right { margin-left:6px; }
}

/* ═══════════════════════════════════════
   MY PROFILE PAGE
═══════════════════════════════════════ */
.profile-hero { display:flex; align-items:center; gap:24px; flex-wrap:wrap; }
.profile-photo-wrap { display:flex; flex-direction:column; align-items:center; gap:8px; flex-shrink:0; }
.profile-photo {
  width:104px; height:104px; border-radius:50%; overflow:hidden;
  background:linear-gradient(135deg, var(--navy), var(--navy-mid));
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:34px; font-weight:700;
  font-family:'Cormorant Garamond', serif;
  border:3px solid var(--border); flex-shrink:0;
}
.profile-photo img { width:100%; height:100%; object-fit:cover; }
.profile-photo-btn { cursor:pointer; }
.profile-hero-meta { flex:1; min-width:180px; }
.profile-name {
  font-family:'Cormorant Garamond', serif;
  font-size:25px; font-weight:700; color:var(--navy);
}
.profile-sub { font-size:13px; color:var(--text-3); margin-top:3px; }

@media (max-width:480px) {
  .profile-hero { flex-direction:column; text-align:center; }
}

/* ═══════════════════════════════════════
   DESKTOP FULL-WIDTH SAFETY
   (ensures the main content area always fills
   the space to the right of the sidebar, with
   no accidental max-width squeezing it in)
═══════════════════════════════════════ */
.main { flex:1 1 auto; min-width:0; }
.content { width:100%; box-sizing:border-box; }
.stat-grid, .dash-grid { width:100%; }

/* ── Print (Performance Review Preview / reports) ──
   Scoped to body.printing-modal, toggled by the beforeprint/afterprint
   listeners in utils.js — deliberately not the CSS :has() selector
   (inconsistent browser support) and not a bare #modal rule (which would
   also fire for ordinary page prints when no modal is open). Every
   box/overflow property that could clip content to the on-screen visible
   height carries !important so print always gets the full content,
   however tall, instead of whatever fit in the scrollable modal area. */
@media print {
  body.printing-modal > *:not(#modal) { display:none !important; }
  body.printing-modal #modal {
    position:static !important; inset:auto !important; background:none !important;
    display:block !important; padding:0 !important; overflow:visible !important;
  }
  body.printing-modal #modal .modal {
    box-shadow:none !important; border:none !important; position:static !important;
    max-width:100% !important; width:100% !important; max-height:none !important;
    height:auto !important; overflow:visible !important; padding:0 !important;
    /* Chrome refuses to paginate (split across printed pages) any element
       that has a CSS transform applied — and .modal's open animation
       leaves one behind permanently via animation-fill-mode:both, even
       though it's visually just scale(1)/translateY(0) by the time you'd
       ever print. Without this override, the entire modal gets forced
       into a single page no matter how tall its content actually is,
       silently cutting off everything past page 1. !important is required
       here because CSS-animation-applied values sit above normal author
       styles in the cascade. */
    animation:none !important; transform:none !important;
  }
  body.printing-modal #modal-body { overflow:visible !important; height:auto !important; }
  body.printing-modal .pr-no-print, body.printing-modal .modal-close { display:none !important; }
  /* Executive Summary report: swap the editable textareas for plain text
     cells so the printed/PDF version reads as a finished report, not a
     form. */
  body.printing-modal .pr-print-only { display:table-cell !important; }
}


/* Leave request opened from an email deep link (see leaves.js) */
tr.leave-row-highlight td { background: rgba(201,146,42,.18) !important; animation: leaveRowPulse 1.6s ease-in-out 3; }
@keyframes leaveRowPulse { 0%,100% { box-shadow: inset 0 0 0 0 rgba(201,146,42,0); } 50% { box-shadow: inset 0 0 0 2px rgba(201,146,42,.75); } }


/* ═══════════════════════════════════════════════════════════════
   APP HEADER — two tiers
   1. .topbar   : menu button · page title · account (always visible)
   2. .toolbar  : company/location filter (left) · this page's actions (right)
   The toolbar hides itself when a screen has neither (syncToolbar in nav.js).
   Desktop: both tiers stay pinned. Tablet/phone: only the title bar is pinned,
   the toolbar scrolls away so it never eats the screen.
═══════════════════════════════════════════════════════════════ */
.topbar {
  background: var(--topbar-bg);
  border-bottom:1px solid var(--border);
  padding:0 24px; height:var(--topbar-h);
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  position:sticky; top:0; z-index:100; flex-shrink:0;
}
.topbar-left { display:flex; align-items:center; gap:13px; min-width:0; flex:1 1 auto; }
.topbar .page-title {
  min-width:0; max-width:100%; line-height:1.15;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; overflow:hidden;
  overflow-wrap:anywhere;
}
.topbar-right { margin-left:0; }

.toolbar {
  background: var(--topbar-bg);
  border-bottom:1px solid var(--border);
  padding:10px 24px;
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px 18px;
  position:sticky; top:var(--topbar-h); z-index:90; flex-shrink:0;
  box-shadow:0 2px 8px rgba(11,31,58,0.04);
}
.toolbar.is-empty { display:none; }

/* — filter group — */
.global-filter-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0; min-width:0; }
.global-filter-bar.hidden { display:none !important; }
.gf-label {
  font-size:10.5px; font-weight:700; letter-spacing:1.3px; text-transform:uppercase;
  color:var(--text-3); margin-right:2px; white-space:nowrap;
}
.gf-select {
  -webkit-appearance:none; appearance:none;
  height:36px; padding:0 32px 0 12px; min-width:170px; max-width:250px;
  font-family:'DM Sans',sans-serif; font-size:13px; font-weight:500; color:var(--text-2);
  border:1.5px solid var(--border-md); border-radius:9px; cursor:pointer;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235B6B85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  text-overflow:ellipsis; transition:border-color .16s, box-shadow .16s, background-color .16s;
}
.gf-select:hover { border-color:var(--navy-mid); }
.gf-select:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,146,42,0.14); }
.gf-select.is-active { border-color:var(--gold); background-color:#FFFBF2; color:var(--navy); font-weight:600; }
.gf-clear { height:36px; padding:0 12px; }

/* — page actions — */
#topbar-actions {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px;
  margin-left:auto; min-width:0;
}
#topbar-actions > div { display:contents !important; }          /* screens wrap buttons in .gap-8 — flatten so ONE flex row wraps cleanly */
#topbar-actions .btn,
#topbar-actions .btn-sm { height:36px; padding:0 14px; font-size:12.5px; border-radius:9px; }
#topbar-actions input[type="month"],
#topbar-actions input[type="date"],
#topbar-actions select {
  height:36px; padding:0 10px !important; font-family:'DM Sans',sans-serif; font-size:13px !important;
  color:var(--text-1); background:#fff; border:1.5px solid var(--border-md) !important; border-radius:9px !important;
}

/* — desktop-only: let the sidebar footer always stay visible, use dynamic viewport height — */
.sidebar-footer { position:sticky; bottom:0; background:var(--navy); z-index:2; }
@supports (height:100dvh) {
  #app, .main { height:100dvh; }
}

/* ── Tablet & phone (≤900px) ── */
@media (max-width:900px) {
  .topbar { padding:0 14px; height:auto; min-height:var(--topbar-h); padding-top:6px; padding-bottom:6px; }
  .toolbar { position:static; padding:10px 14px; box-shadow:none; background:#FBFBFD; }
  .topbar .page-title { -webkit-line-clamp:2; font-size:19px; }
}

/* ── Phone (≤640px): filters become a tidy 2-up grid, actions a full-width button grid ── */
@media (max-width:640px) {
  .toolbar { flex-direction:column; align-items:stretch; gap:10px; padding:10px 12px 12px; }
  .global-filter-bar { display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
  .global-filter-bar .gf-label { display:none; }
  .gf-select { width:100%; min-width:0; max-width:none; height:42px; font-size:16px; }   /* 16px = no iOS focus-zoom */
  .gf-clear { grid-column:1 / -1; justify-self:end; height:34px; }
  #topbar-actions { width:100%; margin-left:0; justify-content:stretch; gap:8px; }
  #topbar-actions .btn,
  #topbar-actions .btn-sm {
    flex:1 1 calc(50% - 4px); min-width:0; height:auto; min-height:42px; padding:8px 10px;
    font-size:13px; white-space:normal; text-align:center; line-height:1.2;
  }
  #topbar-actions input[type="month"],
  #topbar-actions input[type="date"],
  #topbar-actions select { flex:1 1 100%; height:42px; font-size:16px !important; min-width:0; }
  .topbar .page-title { font-size:17px; }
  .topbar-right { margin-left:4px; }
}

/* Phone polish: equal-height action buttons; IDs never break letter-by-letter */
@media (max-width:640px) {
  #topbar-actions { align-items:stretch; }
  #topbar-actions .btn, #topbar-actions .btn-sm { display:flex; align-items:center; justify-content:center; }
}
td code { white-space:nowrap; word-break:normal; overflow-wrap:normal; }

/* ── Leave list filters (search / status / type / dates / sort / paging) ── */
.leave-filters { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; }
.leave-filters .gf-select { min-width:140px; max-width:220px; }
.leave-filters .hidden { display:none !important; }
.lf-input {
  height:36px; padding:0 12px; font-family:'DM Sans',sans-serif; font-size:13px; font-weight:500;
  color:var(--text-1); background:#fff; border:1.5px solid var(--border-md); border-radius:9px;
  transition:border-color .16s, box-shadow .16s, background-color .16s;
}
.lf-input:hover { border-color:var(--navy-mid); }
.lf-input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,146,42,0.14); }
.lf-input.is-active { border-color:var(--gold); background-color:#FFFBF2; color:var(--navy); font-weight:600; }
.lf-search { flex:1 1 240px; min-width:200px; max-width:340px; }
.lf-sep { font-size:12px; color:var(--text-3); }
.lf-clear { height:36px; padding:0 12px; }
.lf-count { margin-left:auto; font-size:12.5px; color:var(--text-3); white-space:nowrap; }
.lf-pager { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:12px; font-size:12.5px; color:var(--text-3); }
.lf-pager .btn[disabled] { opacity:.45; cursor:default; }
@media (max-width:640px) {
  .leave-filters { display:grid; grid-template-columns:1fr 1fr; }
  .leave-filters .gf-select, .lf-input { width:100%; min-width:0; max-width:none; height:42px; font-size:16px; box-sizing:border-box; }
  .lf-search { grid-column:1 / -1; }
  .lf-sep { display:none; }
  .lf-clear { grid-column:1 / -1; justify-self:end; height:34px; }
  .lf-count { grid-column:1 / -1; margin-left:0; }
}


/* ═══════════════════════════════════════════════════════════════
   EXECUTIVE SUMMARY PAGE (performanceReview.js → prOpenExecutiveSummary)
   Hero · stat cards · workflow strip · filter bar · one expandable card
   per employee. Uses the portal's own tokens only.
   ═══════════════════════════════════════════════════════════════ */
.es-page { max-width:1240px; margin:0 auto; }
.es-loading, .es-empty { background:var(--card-bg); border:1px dashed var(--border-md); border-radius:var(--radius); padding:36px 20px; text-align:center; color:var(--text-3); font-size:14px; }

.es-hero {
  display:flex; gap:24px; align-items:stretch; justify-content:space-between; flex-wrap:wrap;
  background:linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius:var(--radius-lg); padding:26px 30px; color:#fff; margin-bottom:16px;
  box-shadow:var(--shadow-md); position:relative; overflow:hidden;
}
.es-hero::after { content:''; position:absolute; right:-60px; top:-60px; width:220px; height:220px; border-radius:50%; background:radial-gradient(circle, rgba(232,184,75,.28), rgba(232,184,75,0) 70%); pointer-events:none; }
.es-hero-main { min-width:0; flex:1 1 320px; position:relative; z-index:1; }
.es-eyebrow { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--gold-light); background:rgba(232,184,75,.14); border:1px solid rgba(232,184,75,.35); padding:4px 10px; border-radius:999px; }
.es-title { font-size:26px; line-height:1.2; margin:12px 0 6px; color:#fff; font-weight:700; letter-spacing:-.01em; }
.es-hero-sub { font-size:13.5px; color:rgba(255,255,255,.75); }
.es-hero-rule { flex:0 1 420px; position:relative; z-index:1; font-size:12.5px; line-height:1.55; color:rgba(255,255,255,.78); background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.14); border-radius:12px; padding:14px 16px; align-self:center; }
.es-hero-rule strong { display:block; color:var(--gold-light); font-size:12px; letter-spacing:.06em; text-transform:uppercase; margin-bottom:4px; }

.es-stats { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.es-stat { display:flex; gap:12px; align-items:flex-start; background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow-sm); min-width:0; }
.es-stat-ic { width:38px; height:38px; flex:0 0 38px; display:flex; align-items:center; justify-content:center; font-size:18px; border-radius:10px; background:var(--input-bg); }
.es-stat-body { min-width:0; flex:1; }
.es-stat-label { font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--text-3); }
.es-stat-val { font-size:26px; font-weight:700; color:var(--navy); line-height:1.15; margin-top:2px; }
.es-stat-val small { font-size:14px; font-weight:600; color:var(--text-3); }
.es-stat-sub { font-size:12px; color:var(--text-3); margin-top:3px; }
.es-bar { height:6px; border-radius:99px; background:var(--border); overflow:hidden; margin-top:7px; }
.es-bar i { display:block; height:100%; border-radius:99px; }
.es-bar i.ok { background:var(--success); }
.es-bar i.ai { background:var(--acc-blue); }

.es-flow { display:flex; align-items:stretch; gap:8px; background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; margin-bottom:16px; box-shadow:var(--shadow-sm); }
.es-flow-step { display:flex; gap:10px; flex:1 1 0; min-width:0; font-size:12px; line-height:1.45; color:var(--text-3); align-items:flex-start; }
.es-flow-step span { flex:0 0 24px; height:24px; border-radius:50%; background:var(--navy); color:#fff; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; margin-top:1px; }
.es-flow-step b { display:block; color:var(--navy); font-size:13px; margin-bottom:1px; }
.es-flow-arrow { align-self:center; color:var(--border-md); font-size:22px; }

.es-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.es-search { display:flex; align-items:center; gap:8px; background:var(--card-bg); border:1px solid var(--border-md); border-radius:9px; padding:0 12px; height:38px; flex:0 1 280px; min-width:200px; }
.es-search input { border:0; outline:0; background:transparent; flex:1; font-size:13px; color:var(--text-1); min-width:0; padding:0; box-shadow:none; }
.es-chips { display:flex; gap:6px; flex-wrap:wrap; flex:1 1 auto; }
.es-chip { border:1px solid var(--border-md); background:var(--card-bg); color:var(--text-2); border-radius:999px; padding:7px 13px; font-size:12.5px; font-weight:600; cursor:pointer; transition:all .15s; }
.es-chip b { margin-left:4px; font-size:11.5px; background:var(--input-bg); color:var(--text-3); border-radius:99px; padding:1px 7px; }
.es-chip:hover { border-color:var(--navy-mid); }
.es-chip.on { background:var(--navy); border-color:var(--navy); color:#fff; }
.es-chip.on b { background:rgba(255,255,255,.18); color:#fff; }
.es-toolbar-btns { display:flex; gap:6px; margin-left:auto; }

/* Employee card */
.es-card { background:var(--card-bg); border:1px solid var(--border); border-left:4px solid var(--border-md); border-radius:var(--radius); margin-bottom:10px; box-shadow:var(--shadow-sm); overflow:hidden; transition:box-shadow .15s; }
.es-card:hover { box-shadow:var(--shadow-md); }
.es-card.es-s-pending { border-left-color:var(--acc-amber); }
.es-card.es-s-ready   { border-left-color:var(--acc-blue); }
.es-card.es-s-done    { border-left-color:var(--success); }

.es-head { display:grid; grid-template-columns:44px minmax(160px,1.4fr) 110px auto minmax(130px,1fr) auto 22px; align-items:center; gap:14px; padding:14px 16px; cursor:pointer; }
.es-avatar { width:44px; height:44px; border-radius:50%; background:linear-gradient(135deg, var(--navy), var(--navy-mid)); color:var(--gold-light); font-weight:700; font-size:15px; display:flex; align-items:center; justify-content:center; letter-spacing:.02em; }
.es-who { min-width:0; }
.es-name { font-weight:700; font-size:14.5px; color:var(--navy); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.es-desg { font-size:12.5px; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.es-tenure { font-size:13px; color:var(--text-2); font-weight:600; }
.es-tenure i { display:block; font-style:normal; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-3); margin-bottom:1px; }
.es-rates { display:flex; gap:8px; }
.es-rate { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; min-width:74px; padding:6px 10px; border-radius:10px; border:1px solid; line-height:1.1; }
.es-rate b { font-size:17px; font-weight:700; }
.es-rate i { font-style:normal; font-size:10px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; margin-top:3px; opacity:.85; }
.es-r1 { color:#C0392B; background:#FDECEA; border-color:#F4C7C1; }
.es-r2 { color:#B45309; background:#FEF3E2; border-color:#F6D9A8; }
.es-r3 { color:#2563EB; background:#E8F0FE; border-color:#C3D5FA; }
.es-r4 { color:#0D9488; background:#E3F5F3; border-color:#B4E3DD; }
.es-r5 { color:#1A7A52; background:#E7F4EE; border-color:#B9E0CC; }
.es-r-na { color:var(--text-3); background:var(--input-bg); border-color:var(--border); }
/* rating colour on a stat-card number: keep only the text colour of the pill palette */
.es-stat-val.es-r1, .es-stat-val.es-r2, .es-stat-val.es-r3, .es-stat-val.es-r4, .es-stat-val.es-r5, .es-stat-val.es-r-na { background:none; border:0; padding:0; }
.es-fb { font-size:12px; color:var(--text-3); line-height:1.35; }
.es-stage { font-size:11.5px; font-weight:700; padding:5px 11px; border-radius:999px; white-space:nowrap; }
.es-stage-pending { color:#B45309; background:#FEF3E2; }
.es-stage-ready   { color:#2563EB; background:#E8F0FE; }
.es-stage-done    { color:#1A7A52; background:#E7F4EE; }
.es-chev { color:var(--text-3); font-size:20px; line-height:1; transition:transform .2s; text-align:center; }
.es-card.open .es-chev { transform:rotate(180deg); }

.es-body { display:none; border-top:1px solid var(--border); background:#FBFCFE; padding:16px; }
.es-card.open .es-body { display:block; }

.es-steps { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.es-step { background:var(--card-bg); border:1px solid var(--border); border-radius:10px; padding:12px 14px; display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.es-step.is-locked { opacity:.7; }
.es-step-t { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--navy); }
.es-step-t span { width:20px; height:20px; border-radius:50%; background:var(--navy); color:#fff; font-size:11px; display:flex; align-items:center; justify-content:center; letter-spacing:0; }
.es-step-s { font-size:12.5px; color:var(--text-3); line-height:1.4; flex:1; }
.es-step-s.ok { color:var(--success); font-weight:600; }
.es-links { display:flex; flex-direction:column; gap:6px; font-size:13px; }
.es-links a { color:var(--acc-blue); text-decoration:none; font-weight:600; }
.es-links a:hover { text-decoration:underline; }

.es-sums { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.es-sum { background:var(--card-bg); border:1px solid var(--border); border-top:3px solid var(--border-md); border-radius:10px; padding:12px 14px; min-width:0; }
.es-sum.pos { border-top-color:var(--success); }
.es-sum.neg { border-top-color:var(--acc-amber); }
.es-sum.all { border-top-color:var(--navy); }
.es-sum h5 { margin:0 0 8px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--navy); display:flex; align-items:center; gap:6px; }
.es-sum p { margin:0; font-size:13px; line-height:1.6; color:var(--text-2); white-space:pre-wrap; word-wrap:break-word; }
.es-sum p.es-none { color:var(--text-3); font-style:italic; }
.es-skel { height:10px; border-radius:6px; margin-bottom:9px; background:linear-gradient(90deg, var(--border) 25%, #F3F4F8 50%, var(--border) 75%); background-size:200% 100%; animation:esShimmer 1.2s linear infinite; }
.es-skel.s2 { width:85%; } .es-skel.s3 { width:60%; }
@keyframes esShimmer { to { background-position:-200% 0; } }

.es-notes { display:grid; grid-template-columns:1fr 1fr auto; gap:12px; align-items:end; }
.es-notes .field { margin:0; }
.es-notes .field label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-3); }
.es-notes textarea { width:100%; resize:vertical; font-size:13px; }
.es-notes-print { display:none; grid-column:1 / -1; font-size:12.5px; line-height:1.6; }

@media (max-width:1100px) {
  .es-stats { grid-template-columns:repeat(3, minmax(0,1fr)); }
  .es-head { grid-template-columns:44px minmax(0,1fr) auto 22px; row-gap:10px; }
  .es-tenure, .es-fb { display:none; }
  .es-rates { grid-column:2 / 3; }
}
@media (max-width:820px) {
  .es-hero { padding:20px; } .es-title { font-size:21px; }
  .es-stats { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .es-flow { flex-direction:column; } .es-flow-arrow { display:none; }
  .es-steps, .es-sums, .es-notes { grid-template-columns:1fr; }
  .es-head { grid-template-columns:44px minmax(0,1fr) 22px; }
  .es-stage { grid-column:2 / 3; justify-self:start; }
  .es-toolbar-btns { margin-left:0; }
}

/* Print / Save as PDF of the page (prEsPrint → body.printing-exec): sidebar and controls hidden, every card open. */
@media print {
  body.printing-exec .sidebar, body.printing-exec .topbar, body.printing-exec #page-toolbar, body.printing-exec .sidebar-overlay,
  body.printing-exec .es-noprint, body.printing-exec .es-flow, body.printing-exec .es-chev { display:none !important; }
  body.printing-exec .main { margin-left:0 !important; height:auto !important; overflow:visible !important; display:block !important; }
  body.printing-exec .content { padding:0 !important; }
  body.printing-exec .es-card { break-inside:avoid; box-shadow:none !important; }
  body.printing-exec .es-body { display:block !important; }
  body.printing-exec .es-head { grid-template-columns:44px minmax(160px,1.4fr) 110px auto minmax(130px,1fr) auto; }
  body.printing-exec .es-hero { box-shadow:none; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  body.printing-exec .es-notes { grid-template-columns:1fr; }
  body.printing-exec .es-notes .field { display:none; }
  body.printing-exec .es-notes-print { display:block; }
  body.printing-exec * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* ═══════════════════════════════════════════════════════════════
   REVIEW CYCLES LIST (performanceReview.js → renderReviewCycles)
   Search + status chips (reuses .es-toolbar/.es-search/.es-chip), cycles
   grouped by period, one card per cycle, "⋯" menu (.action-menu-portal).
   ═══════════════════════════════════════════════════════════════ */
.prc-page { max-width:1240px; margin:0 auto; }
.prc-toolbar { margin-bottom:18px; }
.prc-group { margin-bottom:26px; }
.prc-group-head { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin:0 2px 4px; }
.prc-group-title { font-size:16px; font-weight:700; color:var(--navy); margin:0; }
.prc-group-meta { font-size:12.5px; color:var(--text-3); }
.prc-group-note { margin:0 2px 10px; font-size:12.5px; color:var(--text-3); }
.prc-group-head + .prc-row { margin-top:10px; }

.prc-row {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px 24px; align-items:center;
  background:var(--card-bg); border:1px solid var(--border); border-left:4px solid var(--border-md);
  border-radius:var(--radius); padding:16px 20px; margin-bottom:10px; box-shadow:var(--shadow-sm);
  transition:box-shadow .15s;
}
.prc-row:hover { box-shadow:var(--shadow-md); }
.prc-row.is-active { border-left-color:var(--success); }
.prc-row.is-draft  { border-left-color:var(--acc-amber); }
.prc-row.is-closed { border-left-color:var(--border-md); }

.prc-main { min-width:0; }
.prc-name-line { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.prc-name { font-size:15px; font-weight:700; color:var(--navy); overflow-wrap:anywhere; }
.prc-meta { display:flex; flex-wrap:wrap; gap:4px 18px; margin-top:5px; font-size:12.5px; color:var(--text-3); }
.prc-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.prc-more { font-size:16px; line-height:1; letter-spacing:1px; padding:7px 12px; }

.prc-empty { padding:40px 20px; }
.prc-empty b { display:block; font-size:16px; color:var(--navy); margin-bottom:4px; }
.prc-empty p { margin:0 0 16px; }

.prc-menu .prc-menu-sep { height:1px; background:var(--border); margin:4px 2px; }
.prc-row .btn:focus-visible, .prc-menu .btn:focus-visible, .prc-toolbar .es-chip:focus-visible {
  outline:2px solid var(--acc-blue); outline-offset:2px;
}

@media (max-width:820px) {
  .prc-row { grid-template-columns:1fr; padding:14px 16px; }
  .prc-actions { justify-content:flex-start; }
}
