:root{
  --primary:#2f9e44; --primary-dark:#23792f; --primary-light:#e3f6e5;
  --primary-grad-start:#5cbf5f; --primary-grad-end:#1f6b2c;
  --bg:#f4f9f6; --card:#ffffff; --border:#dde8e1;
  --text:#1f2b24; --text-muted:#6b7d72;
  --green:#23792f; --green-bg:#d9f2dc;
  --amber:#c8850f; --amber-bg:#fdf2e0;
  --blue:#2d6ae0; --blue-bg:#e8f0fe;
  --red:#d34a4a; --red-bg:#fbe9e9;
  --purple:#7c5cd4; --purple-bg:#ede8fb;
  --surface:#eaf4ee;
  --radius:10px;
}
:root[data-theme="dark"]{
  --primary:#4fd868; --primary-dark:#8aeea0; --primary-light:#123b1c;
  --primary-grad-start:#2f6b38; --primary-grad-end:#0e2b13;
  --bg:#121814; --card:#1a231d; --border:#2c3a30;
  --text:#e8f2ec; --text-muted:#94a89c;
  --green:#3ecf5a; --green-bg:#0f2e18;
  --amber:#e0a83d; --amber-bg:#3a2c0e;
  --blue:#6c9bf0; --blue-bg:#17233d;
  --red:#e5716f; --red-bg:#3a1c1c;
  --purple:#a68cf0; --purple-bg:#241c3d;
  --surface:#1f2a23;
}
*{box-sizing:border-box;}
body{margin:0;font-family:'Poppins',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text);transition:background-color .15s,color .15s;}
h1,h2,h3,h4,.pagetitle{font-weight:800;}
#app{height:100vh;display:flex;flex-direction:column;}

#topload-bar{position:fixed;top:0;left:0;height:3px;width:0;background:var(--primary);z-index:9999;transition:width .25s ease,opacity .2s ease;opacity:0;pointer-events:none;}
#topload-bar.active{opacity:1;width:70%;}
#topload-bar.done{opacity:0;width:100%;}
nav.sidebar button.pending{opacity:.6;}

#alarm-banner{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:9998;animation:alarm-drop .25s ease;}
.alarm-banner-card{display:flex;align-items:center;gap:14px;background:var(--card);border:1px solid var(--primary);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:12px 16px;font-size:13px;font-weight:600;max-width:90vw;}
@keyframes alarm-drop{from{opacity:0;transform:translate(-50%,-12px);}to{opacity:1;transform:translate(-50%,0);}}
@media(max-width:700px){#alarm-banner{top:auto;bottom:16px;width:92vw;}.alarm-banner-card{max-width:100%;}}

.brand{display:flex;align-items:center;gap:10px;}
.brand-link{background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left;border-radius:6px;transition:opacity .12s;}
.brand-link:hover{opacity:.75;}
.brand-title{font-weight:700;font-size:15px;color:var(--text);line-height:1.25;}
.brand-subtitle{font-weight:500;font-size:10px;color:var(--text-muted);letter-spacing:.03em;line-height:1.25;}
.brand-logo{height:20px;width:auto;object-fit:contain;flex-shrink:0;}
.login-hero .brand-logo{height:52px;filter:brightness(0) invert(1);}
:root[data-theme="dark"] .sidebar-brand .brand-logo{filter:brightness(0) invert(1);}
.offline-pill{font-size:11px;font-weight:600;color:var(--red);background:var(--red-bg);padding:4px 8px;border-radius:20px;white-space:nowrap;display:inline-flex;align-items:center;gap:4px;}
.ico{width:17px;height:17px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px;}
.topbar-datetime{font-size:13px;color:var(--text-muted);white-space:nowrap;display:flex;align-items:center;gap:6px;flex-shrink:0;}
.topbar-datetime .ico{width:14px;height:14px;vertical-align:0;}
.topbar-search{position:relative;width:220px;flex-shrink:0;}
.topbar-search input{font-size:13px;background:var(--surface);border-color:transparent;}
.search-results{position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--card);border:1px solid var(--border);border-radius:8px;max-height:320px;overflow-y:auto;z-index:50;box-shadow:0 6px 18px rgba(0,0,0,.12);}
.search-group-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--text-muted);padding:8px 12px 4px 12px;}
.search-item{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:13px;cursor:pointer;}
.search-item:hover{background:var(--surface);}
.search-item .avatar{flex-shrink:0;}
.search-empty{padding:12px;font-size:13px;color:var(--text-muted);text-align:center;}
.who{display:flex;align-items:center;gap:10px;font-size:14px;flex-shrink:0;margin-left:auto;}
.content-topbar{display:flex;align-items:center;gap:14px;padding-bottom:18px;}
.notif-wrap{position:relative;}
.notif-bell{position:relative;}
.notif-badge{position:absolute;top:2px;right:2px;background:var(--red);color:#fff;font-size:10px;font-weight:700;line-height:1;min-width:15px;height:15px;border-radius:20px;display:flex;align-items:center;justify-content:center;padding:0 3px;}
.notif-panel{position:absolute;top:calc(100% + 8px);right:0;width:320px;max-width:calc(100vw - 24px);max-height:400px;overflow-y:auto;background:var(--card);border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.14);z-index:60;}
/* On mobile the bell ends up near the left of a wrapped topbar row (see
   .who below), so anchoring the panel to the bell's right edge pushes
   most of it off-screen to the left. Detach it from the bell entirely
   and pin it to the viewport instead. */
@media(max-width:700px){
  .notif-panel{position:fixed;top:145px;left:12px;right:12px;width:auto;max-width:none;}
}
.notif-panel-title{font-weight:700;font-size:13px;padding:12px 14px 8px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.03em;}
.notif-item{display:flex;align-items:flex-start;gap:10px;padding:10px 14px;cursor:pointer;border-top:1px solid var(--border);}
.notif-item:hover{background:var(--bg);}
.notif-item .ico{margin-top:2px;color:var(--primary);}
.notif-text{font-size:13px;font-weight:600;line-height:1.35;}
.notif-time{font-size:11px;color:var(--text-muted);margin-top:2px;}
.notif-empty{padding:16px 14px;font-size:13px;color:var(--text-muted);text-align:center;}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex-shrink:0;}
.btn{display:inline-flex;align-items:center;gap:6px;border:none;border-radius:8px;padding:8px 14px;font-size:14px;font-weight:600;cursor:pointer;transition:.15s;}
.btn:disabled{opacity:.75;cursor:not-allowed;}
.btn-spinner{display:inline-block;width:14px;height:14px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;vertical-align:-2px;margin-right:2px;animation:btn-spin .7s linear infinite;}
.btn-outline .btn-spinner{border-color:rgba(35,121,47,.3);border-top-color:var(--primary-dark);}
@keyframes btn-spin{to{transform:rotate(360deg);}}
.btn-primary{background:var(--primary);color:#fff;}
.btn-primary:hover{background:var(--primary-dark);}
.btn-ghost{background:transparent;color:var(--text-muted);border:1px solid var(--border);}
.btn-ghost:hover{background:var(--bg);}
.btn-outline{background:transparent;color:var(--primary-dark);border:1px solid var(--primary);}
.btn-outline:hover{background:var(--primary-light);}
.btn-sm{padding:5px 10px;font-size:12px;}
.btn-green{background:var(--green);color:#fff;}
.btn-red{background:var(--red);color:#fff;}
.btn-amber{background:var(--amber);color:#fff;}
.btn:disabled{opacity:.5;cursor:not-allowed;}

.shell{display:flex;flex:1;min-height:0;}
nav.sidebar{width:236px;background:linear-gradient(165deg, var(--primary-grad-start), var(--primary-grad-end));padding:18px 14px 28px;flex-shrink:0;display:flex;flex-direction:column;overflow-y:auto;}
.sidebar-brand{display:flex;align-items:center;gap:10px;padding:4px 10px 20px;}
.sidebar-brand .brand-logo{height:26px;filter:brightness(0) invert(1);}
.sidebar-brand .brand-title{font-size:16px;color:#fff;}
nav.sidebar .nav-list{flex:1;display:flex;flex-direction:column;}
nav.sidebar .nav-settings{border-top:1px solid rgba(255,255,255,.2);padding-top:10px;margin-top:auto;flex-shrink:0;}
nav.sidebar button{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:none;border:none;padding:11px 12px;border-radius:10px;font-size:14px;font-weight:600;color:rgba(255,255,255,.8);cursor:pointer;margin-bottom:2px;transition:background-color .12s,color .12s;}
nav.sidebar button:hover{background:rgba(255,255,255,.12);color:#fff;}
nav.sidebar .nav-section-label{display:flex;align-items:center;justify-content:space-between;width:100%;background:none;border:none;cursor:pointer;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:rgba(255,255,255,.5);padding:14px 12px 6px;margin-bottom:0;font-family:inherit;}
nav.sidebar .nav-section-label:hover{background:none;color:rgba(255,255,255,.85);}
.nav-main .nav-section-label:first-child{padding-top:2px;}
.nav-section-chevron{transition:transform .15s ease;flex-shrink:0;}
.nav-section-chevron.collapsed{transform:rotate(-90deg);}
.nav-section-group.collapsed{display:none;}
nav.sidebar button.active{background:#fff;color:var(--primary-dark);}
.sidebar-support-card{background:rgba(255,255,255,.14);border-radius:14px;padding:16px;margin-top:14px;font-size:12px;color:#fff;line-height:1.4;}
main.content{flex:1;min-width:0;padding:22px 26px;overflow-y:auto;overflow-x:hidden;}

h1.pagetitle{font-size:26px;margin:0 0 4px 0;}
p.pagesub{color:var(--text-muted);font-size:13px;margin:0 0 18px 0;}

.card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:16px 18px;margin-bottom:16px;}
.stat-card{cursor:pointer;transition:transform .12s,box-shadow .12s;position:relative;padding-left:58px;min-height:36px;}
.stat-card:hover{transform:translateY(-2px);box-shadow:0 4px 14px rgba(0,0,0,.08);}
.stat-card-icon{position:absolute;top:16px;left:16px;width:38px;height:38px;border-radius:50%;background:var(--primary-light);display:flex;align-items:center;justify-content:center;}
.stat-card-icon .ico{width:19px;height:19px;stroke:var(--primary-dark);}
.stat-card-icon.amber{background:var(--amber-bg);}
.stat-card-icon.amber .ico{stroke:var(--amber);}
.card h3{margin:0 0 10px 0;font-size:15px;}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
.grid3 > *{min-width:0;}
/* Home page rows — first column (My Work Today / Upcoming Deadlines) is
   meant to run roughly twice as wide as the other two, per the reference
   mockup; equal thirds crushed the task table and mini-stat labels. */
.grid-home3{display:grid;grid-template-columns:2fr 1fr 1fr;gap:16px;}
.grid-home3 > *{min-width:0;}
/* Row 1 (My Work Today / Attendance / Upcoming Schedule) — My Work Today's
   task table earns still more room than the plain 2:1:1 split, taken from
   Upcoming Schedule specifically since its rows need the least width. */
.grid-home3-lead{grid-template-columns:2.6fr 1.1fr 0.9fr;}
@media(max-width:900px){.grid-home3,.grid-home3-lead{grid-template-columns:1fr;}}
.grid-home{display:grid;grid-template-columns:2fr 1fr;gap:16px;align-items:start;}
.grid-home > *{min-width:0;}
@media(max-width:900px){.grid2,.grid3,.grid-home{grid-template-columns:1fr;}}
.progress-bar-wrap{background:var(--surface);border-radius:10px;height:10px;overflow:hidden;}
.progress-bar-fill{height:100%;background:var(--primary);border-radius:10px;transition:width .2s;}
.board-tabs{display:flex;gap:18px;flex-wrap:wrap;}
.board-tab{background:none;border:none;padding:4px 0;font-size:13px;font-weight:600;color:var(--text-muted);cursor:pointer;border-bottom:2px solid transparent;}
.board-tab:hover{color:var(--text);}
.board-tab.active{color:var(--primary-dark);border-bottom-color:var(--primary);}

.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;}
.cal-weekday{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;text-align:center;padding:4px 0;}
.cal-cell{position:relative;border:1px solid var(--border);border-radius:8px;min-height:64px;padding:6px;background:var(--surface);}
.cal-cell.outside{opacity:.4;background:transparent;border-color:transparent;}
.cal-cell.is-today{border-color:var(--primary);border-width:2px;}
.cal-daynum{font-size:12px;font-weight:700;}
.cal-tag{font-size:9px;font-weight:700;border-radius:5px;padding:2px 5px;display:inline-block;margin-top:4px;}
.cal-tag-work{background:var(--green-bg);color:var(--green);}
.cal-tag-rest{background:var(--surface);color:var(--text-muted);border:1px solid var(--border);}
.cal-tag-leave{background:var(--purple-bg);color:var(--purple);}
.cal-tag-overtime{background:var(--amber-bg);color:var(--amber);}
.cal-tag-activity{background:var(--blue-bg);color:var(--blue);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.cal-dot{position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--amber);}
.cal-dot-wrap{position:absolute;top:6px;right:6px;display:flex;gap:3px;}
.cal-dot-mini{width:6px;height:6px;border-radius:50%;}
.cal-dot-mini.task{background:var(--red);}
.cal-dot-mini.project{background:var(--blue);}
.cal-cell.selected{border-color:var(--primary);border-width:2px;background:var(--green-bg);}
.cal-quarter{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;}
@media(max-width:900px){
  .cal-quarter{grid-template-columns:1fr;}
  .clocktime-lg{font-size:30px;}
  .clock-action-btn{padding:14px 20px;font-size:14px;}
}
@media(max-width:700px){
  .cal-cell{min-height:40px;padding:4px;}
  .cal-tag{font-size:7px;padding:1px 3px;}
}
.rate-bar-wrap{position:relative;background:var(--bg);border-radius:6px;height:20px;min-width:100px;overflow:hidden;}
.rate-bar{position:absolute;inset:0 auto 0 0;background:var(--primary-light);border-radius:6px;}
.rate-bar-label{position:relative;display:block;font-size:11px;font-weight:700;line-height:20px;padding:0 8px;color:var(--text);}

table{width:100%;border-collapse:collapse;font-size:13px;}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--border);vertical-align:middle;}
th{color:var(--text-muted);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.03em;}

.badge{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11px;font-weight:700;}
.badge-green{background:var(--green-bg);color:var(--green);}
.badge-amber{background:var(--amber-bg);color:var(--amber);}
.badge-blue{background:var(--blue-bg);color:var(--blue);}
.badge-red{background:var(--red-bg);color:var(--red);}
.badge-gray{background:var(--surface);color:var(--text-muted);}

input,select,textarea{font-family:inherit;font-size:13px;padding:8px 10px;border:1px solid var(--border);border-radius:7px;background:var(--card);color:var(--text);width:100%;box-sizing:border-box;}
input[type="checkbox"],input[type="radio"]{accent-color:var(--primary);}
input:disabled,select:disabled,textarea:disabled{background:var(--surface);color:var(--text-muted);cursor:not-allowed;}
/* Native select chrome (the OS-drawn arrow) renders with slightly
   different vertical metrics than a text input even with identical
   padding/border, so a select next to an input in the same row never
   quite lines up — replace it with a hand-drawn arrow so the box model
   is 100% identical to input/textarea. */
select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7d72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:32px;}
:root[data-theme="dark"] select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2394a89c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}
label{font-size:12px;font-weight:600;color:var(--text-muted);display:block;margin-bottom:4px;}
.field{margin-bottom:12px;}
.quick-day-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border:1px solid var(--border);border-radius:20px;cursor:pointer;font-size:13px;font-weight:600;background:var(--surface);user-select:none;}
.quick-day-chip:has(input:checked){background:var(--primary-light);border-color:var(--primary);color:var(--primary-dark);}
.quick-day-chip input{accent-color:var(--primary);margin:0;}
.password-field-wrap{position:relative;}
.password-field-wrap input{padding-right:38px;width:100%;}
.password-toggle-btn{position:absolute;top:50%;right:6px;transform:translateY(-50%);background:none;border:none;padding:4px;cursor:pointer;color:var(--text-muted);display:flex;align-items:center;}
.password-toggle-btn:hover{color:var(--text);}
.password-toggle-btn .ico{width:17px;height:17px;}
.info-icon-wrap{position:relative;display:inline-flex;}
.info-icon-btn{background:none;border:none;padding:0;margin:0;cursor:pointer;color:var(--text-muted);display:flex;}
.info-icon-btn:hover{color:var(--primary);}
.info-icon-btn .ico{width:15px;height:15px;}
.info-tooltip{position:absolute;left:50%;bottom:calc(100% + 9px);transform:translateX(-50%);background:var(--text);color:var(--card);font-size:12px;font-weight:400;line-height:1.4;padding:8px 12px;border-radius:8px;white-space:nowrap;box-shadow:0 6px 16px rgba(0,0,0,.18);z-index:20;}
.info-tooltip::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:5px solid transparent;border-top-color:var(--text);}
.team-checkbox-list{max-height:160px;overflow-y:auto;border:1px solid var(--border);border-radius:8px;padding:6px 10px;}
.avatar-stack{display:flex;align-items:center;}
.avatar-stack .avatar{margin-left:-8px;border:2px solid var(--card);}
.avatar-stack .avatar:first-child{margin-left:0;}
.status-dist-bar{display:flex;height:10px;border-radius:6px;overflow:hidden;background:var(--bg);width:100%;min-width:80px;}
.status-dist-bar > div{height:100%;}
.status-legend{display:flex;flex-wrap:wrap;gap:12px;margin-top:10px;font-size:12px;color:var(--text-muted);}
.status-legend span{display:inline-flex;align-items:center;gap:5px;}
.status-legend i{width:9px;height:9px;border-radius:3px;display:inline-block;}
.row{display:flex;gap:10px;}
.row > *{flex:1;}
/* Its own class, not .row — .row's mobile rule below forces every child to
   min-width:140px, which would blow up the small icon buttons here into
   half-width boxes and wrap the composer onto multiple lines on a phone. */
.chat-composer-row{display:flex;gap:8px;align-items:center;}
.chat-composer-row > button{flex:0 0 auto;}
.chat-composer-input{flex:1;min-width:0;}
.attendance-schedule-row > *{min-width:0;}
.clocktime-lg{font-size:38px;font-weight:800;color:var(--primary-dark);line-height:1.15;white-space:nowrap;}
.clock-action-btn{flex:0 0 auto;padding:18px 26px;font-size:15px;border-radius:14px;}
.attendance-card-header{display:flex;align-items:center;gap:10px;margin-bottom:14px;}
.attendance-card-body{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;}
@media(max-width:900px){
  .attendance-card-header{justify-content:center;text-align:center;}
  .attendance-card-body{flex-direction:column;justify-content:center;text-align:center;}
  .attendance-card-body .clocktime-lg{white-space:normal;}
}
.stat-mini{background:var(--surface);border-radius:var(--radius);padding:12px 14px;text-align:center;}
.stat-mini-num{font-size:24px;font-weight:800;color:var(--primary);margin-top:2px;}

/* Home page (employee) — My Work Today mini stats, Attendance banner/
   mini-stats, Upcoming Schedule/Deadlines week strip. */
.mini-stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px;}
.mini-stat-box{display:flex;align-items:center;gap:9px;padding:10px 8px;border:1px solid var(--border);border-radius:12px;background:var(--surface);min-width:0;cursor:pointer;transition:transform .12s,box-shadow .12s;}
.mini-stat-box:hover{transform:translateY(-2px);box-shadow:0 4px 14px rgba(0,0,0,.08);}
.mini-stat-icon{width:34px;height:34px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:var(--green-bg);}
.mini-stat-icon .ico{width:16px;height:16px;stroke:var(--green);}
.mini-stat-icon.amber{background:var(--amber-bg);}
.mini-stat-icon.amber .ico{stroke:var(--amber);}
.mini-stat-icon.blue{background:var(--blue-bg);}
.mini-stat-icon.blue .ico{stroke:var(--blue);}
.mini-stat-icon.red{background:var(--red-bg);}
.mini-stat-icon.red .ico{stroke:var(--red);}
.mini-stat-box.static{cursor:default;}
.mini-stat-box.static:hover{transform:none;box-shadow:none;}
.mini-stat-box > div:last-child{min-width:0;}
.mini-stat-num{font-size:18px;font-weight:800;line-height:1.15;}
.mini-stat-label{font-size:10.5px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media(max-width:700px){.mini-stat-row{grid-template-columns:repeat(2,1fr);}}

.info-banner{display:flex;align-items:flex-start;gap:8px;background:var(--green-bg);border-radius:10px;padding:10px 12px;font-size:12.5px;margin:12px 0;}
.info-banner .ico{width:16px;height:16px;stroke:var(--green);flex-shrink:0;margin-top:1px;}

.attendance-ministat-row{display:flex;justify-content:space-between;gap:6px;margin-top:14px;padding-top:14px;border-top:1px solid var(--border);}
.attendance-ministat-row > div{text-align:center;flex:1;min-width:0;}
.attendance-ministat-row .ms-label{font-size:10.5px;color:var(--text-muted);margin-bottom:2px;}
.attendance-ministat-row .ms-value{font-size:13px;font-weight:700;white-space:nowrap;}

.week-nav-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;}
.week-nav-btn{background:var(--surface);border:1px solid var(--border);border-radius:8px;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text-muted);flex-shrink:0;}
.week-nav-btn:hover{background:var(--bg);}
.week-daypicker{display:flex;align-items:stretch;gap:4px;margin-bottom:10px;flex:1;min-width:0;}
.week-day-btn{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 2px;border-radius:10px;cursor:pointer;border:none;background:transparent;font-family:inherit;min-width:0;}
.week-day-btn:hover{background:var(--surface);}
.week-day-btn .wd-label{font-size:11.5px;color:var(--text-muted);font-weight:600;}
.week-day-btn .wd-date{font-size:12px;color:var(--text);font-weight:700;}
.week-day-btn .wd-count{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:700;background:var(--surface);color:var(--text-muted);}
.week-day-btn.selected .wd-label,.week-day-btn.selected .wd-date{color:var(--amber);}
.week-day-btn.selected .wd-count{background:var(--amber);color:#fff;}

.sched-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--border);}
.sched-row:last-of-type{border-bottom:none;}
.sched-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;}
.sched-dot.work{background:var(--green);}
.sched-dot.rest{background:var(--text-muted);opacity:.5;}

.deadline-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border);}
.deadline-row:last-child{border-bottom:none;}
.deadline-row .ico{width:16px;height:16px;flex-shrink:0;}

/* My Schedule page — compact attendance bar, Month/Week/List segment
   toggle, and the day's-agenda timeline. */
.attendance-bar{display:flex;align-items:center;gap:20px;flex-wrap:wrap;}
.attendance-bar > .ab-block{display:flex;align-items:center;gap:12px;}
.attendance-bar > .ab-divider{width:1px;align-self:stretch;background:var(--border);}
.attendance-bar > .ab-actions{margin-left:auto;text-align:center;}
@media(max-width:900px){
  .attendance-bar{justify-content:center;text-align:center;}
  .attendance-bar > .ab-divider{display:none;}
  .attendance-bar > .ab-actions{margin-left:0;width:100%;}
}

.segment-toggle{display:inline-flex;background:var(--surface);border-radius:10px;padding:3px;gap:3px;}
.segment-btn{border:none;background:transparent;padding:7px 16px;border-radius:8px;font-size:13px;font-weight:600;color:var(--text-muted);cursor:pointer;font-family:inherit;}
.segment-btn:hover{color:var(--text);}
.segment-btn.active{background:var(--primary-dark);color:#fff;}

.timeline{position:relative;}
.timeline-item{position:relative;display:flex;gap:14px;padding-bottom:22px;}
.timeline-item:last-child{padding-bottom:0;}
.timeline-item .tl-time{width:64px;flex-shrink:0;font-size:12px;font-weight:700;color:var(--text-muted);padding-top:7px;}
.timeline-item .tl-rail{position:relative;display:flex;flex-direction:column;align-items:center;flex-shrink:0;}
.timeline-item .tl-dot{width:34px;height:34px;border-radius:50%;background:var(--green-bg);display:flex;align-items:center;justify-content:center;flex-shrink:0;z-index:1;}
.timeline-item .tl-dot .ico{width:16px;height:16px;stroke:var(--green);}
.timeline-item .tl-dot.pending{background:var(--surface);}
.timeline-item .tl-dot.pending .ico{stroke:var(--text-muted);}
.timeline-item .tl-dot.alert{background:var(--red-bg);}
.timeline-item .tl-dot.alert .ico{stroke:var(--red);}
.timeline-item .tl-line{position:absolute;top:34px;bottom:-22px;width:2px;background:var(--border);}
.timeline-item:last-child .tl-line{display:none;}
.timeline-item .tl-label{padding-top:7px;font-size:13.5px;font-weight:700;}
.timeline-item .tl-label.alert{color:var(--red);}

.clockbox{text-align:center;padding:26px;}
.clocktime{font-size:38px;font-weight:800;color:var(--primary-dark);letter-spacing:.02em;}
.clockdate{color:var(--text-muted);font-size:13px;margin-bottom:14px;}
.clockstatus{margin:10px 0 18px 0;}

.board{display:flex;gap:14px;overflow-x:auto;padding-bottom:6px;align-items:start;}
.col{background:var(--surface);border-radius:14px;min-width:250px;flex:1;padding:12px;display:flex;flex-direction:column;max-height:70vh;}
.col h4{margin:4px 6px 12px 6px;font-size:13px;display:flex;justify-content:space-between;color:var(--text-muted);text-transform:uppercase;letter-spacing:.03em;flex-shrink:0;}
.col-cards{overflow-y:auto;min-height:0;flex:1;padding-right:2px;}
.task-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:12px;margin-bottom:8px;cursor:grab;box-shadow:0 1px 2px rgba(0,0,0,.03);}
.task-preview-tip{width:280px;max-width:90vw;max-height:300px;overflow-y:auto;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:10px;box-shadow:0 4px 16px rgba(0,0,0,.15);z-index:150;pointer-events:none;}
.task-preview-desc{font-size:12px;white-space:pre-wrap;color:var(--text);}
.task-preview-notes{margin-top:8px;border-top:1px solid var(--border);padding-top:6px;}
.task-preview-note{font-size:12px;white-space:pre-wrap;margin-bottom:6px;color:var(--text);}
.task-preview-note strong{font-size:11px;}
.task-card:hover{box-shadow:0 3px 10px rgba(0,0,0,.06);}
.task-card:active{cursor:grabbing;}
.task-card.dragging{opacity:.4;}
.task-card .t-title{font-weight:700;font-size:13px;margin-bottom:4px;}
.task-card .t-meta{font-size:11px;color:var(--text-muted);margin-bottom:6px;}
.task-card .t-notes{font-size:11px;color:var(--text-muted);border-top:1px dashed var(--border);margin-top:6px;padding-top:6px;}
.col.dragover{outline:2px dashed var(--primary);outline-offset:-4px;}

.chatlist{height:340px;overflow-y:auto;border:1px solid var(--border);border-radius:8px;padding:10px;background:var(--surface);margin-bottom:10px;}
.msg{margin-bottom:10px;}
.msg .m-head{font-size:12px;font-weight:700;color:var(--primary-dark);}
.msg .m-time{font-size:10px;color:var(--text-muted);font-weight:400;margin-left:6px;}
.msg .m-body{font-size:13px;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:7px 10px;display:inline-block;margin-top:2px;}
.chat-attach-img{max-width:220px;max-height:220px;border-radius:8px;cursor:pointer;display:block;}
.chat-attach-file{font-size:13px;color:var(--primary-dark);text-decoration:underline;}

.announcement{border-left:3px solid var(--primary);padding:12px 16px;background:var(--primary-light);border-radius:0 12px 12px 0;margin-bottom:10px;}
.announcement .a-head{font-size:12px;font-weight:700;color:var(--primary-dark);margin-bottom:2px;}
.announcement .a-time{font-size:11px;color:var(--text-muted);font-weight:400;}
/* Preserves the line breaks/spacing/tabs someone actually typed — plain
   HTML collapses all of that by default, which flattened multi-paragraph
   announcements into one wall of text. */
.announcement-body{white-space:pre-wrap;}
/* Poster-style attachments read as posters, not as tiny cropped squares —
   same size/no-crop treatment as before, arranged 2-up so several posters
   fill the row instead of stacking into a long single column; wraps into
   more rows automatically for more images, and a lone image gets the full
   row to itself instead of sitting next to empty space. */
.ann-thumbs{display:grid;grid-template-columns:repeat(2,minmax(0,340px));justify-content:start;gap:12px;margin-top:10px;}
.ann-thumbs.ann-thumbs-single{grid-template-columns:minmax(0,340px);}
.ann-thumb{width:100%;height:auto;object-fit:contain;border-radius:12px;border:1px solid var(--border);cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.08);}
.ann-thumb:hover{opacity:.92;}
@media(max-width:740px){.ann-thumbs{grid-template-columns:minmax(0,340px);}}

.login-wrap{max-width:920px;margin:60px auto;padding:0 20px;position:relative;}
.login-wrap h1{text-align:center;color:var(--primary-dark);}
.login-wrap p.lead{text-align:center;color:var(--text-muted);margin-bottom:30px;}
.login-hero{background:linear-gradient(135deg, var(--primary-grad-start), var(--primary-grad-end));border-radius:24px;padding:44px 32px 32px;box-shadow:0 24px 60px rgba(20,60,25,.28);position:relative;overflow:hidden;}
.login-hero-art{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;}
.login-hero > *:not(.login-hero-art){position:relative;z-index:1;}
.login-hero h1{color:#fff;text-align:center;margin-top:0;}
.login-brand-row{display:flex;align-items:center;justify-content:center;gap:12px;}
.login-hero .lead{color:rgba(255,255,255,.88) !important;}
.login-continue-heading{text-align:center;margin:0 0 16px;font-size:19px;}
.login-side-deco{position:fixed;bottom:0;width:380px;pointer-events:none;display:none;}
.login-side-deco-left{left:2%;}
.login-side-deco-right{right:2%;}
/* A pixel-level cutout of these PNGs looked ragged — their own soft backdrop
   shape is nearly the same pale tone as the page background, so no color
   threshold can cut it cleanly. A vignette mask reads as intentional instead:
   full strength over the illustration, feathering to nothing at the edges so
   the rectangle disappears into the page rather than being pixel-cut. */
.login-side-deco img{
  display:block;width:100%;height:auto;
  -webkit-mask-image:radial-gradient(ellipse 72% 68% at 50% 58%, #000 55%, transparent 100%);
  mask-image:radial-gradient(ellipse 72% 68% at 50% 58%, #000 55%, transparent 100%);
}
.login-side-deco svg{display:none;width:100%;height:auto;}
/* The client's source art is flat and can't re-tint itself, so it's shown
   in light mode only; dark mode falls back to the hand-drawn, theme-colored
   recreation so the corner art still adapts. */
:root[data-theme="dark"] .login-side-deco img{display:none;}
:root[data-theme="dark"] .login-side-deco svg{display:block;}
@media(min-width:1360px){.login-side-deco{display:block;}}
.login-hero .theme-toggle-btn{background:rgba(255,255,255,.18);color:#fff;border:1px solid rgba(255,255,255,.35);}
.login-hero .theme-toggle-btn:hover{background:rgba(255,255,255,.28);}
.login-card-inset{background:var(--card);border-radius:16px;padding:22px 20px 14px;box-shadow:0 10px 28px rgba(0,0,0,.14);}
.login-card-inset .card{box-shadow:none;border:none;padding:0;margin:0;}
.tabs-switch{display:flex;justify-content:center;gap:8px;margin-bottom:20px;}
.tabs-switch button{padding:8px 18px;border-radius:20px;border:1px solid var(--border);background:var(--surface);font-weight:600;font-size:13px;cursor:pointer;color:var(--text-muted);}
.tabs-switch button.active{background:var(--primary);color:#fff;border-color:var(--primary);}
.error-msg{background:var(--red-bg);color:var(--red);border-radius:8px;padding:8px 12px;font-size:13px;margin-bottom:12px;}
.success-msg{background:var(--green-bg);color:var(--green);border-radius:8px;padding:8px 12px;font-size:13px;margin-bottom:12px;}
.hint-list{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 18px;margin-top:20px;font-size:12px;color:var(--text-muted);}
.hint-list b{color:var(--text);}
.login-footer{text-align:center;font-size:11px;color:var(--text-muted);margin-top:24px;}

.small-note{font-size:12px;color:var(--text-muted);}
.flex-between{display:flex;justify-content:space-between;align-items:center;}
.tag{display:inline-block;background:var(--surface);color:var(--text-muted);border-radius:6px;padding:2px 7px;font-size:11px;margin-right:4px;}
.empty{color:var(--text-muted);font-size:13px;padding:14px;text-align:center;}
.print-only{display:none;}

@media print{
  nav.sidebar,.content-topbar,.no-print{display:none !important;}
  .print-only{display:block !important;}
  #app,main.content{padding:0 !important;overflow:visible !important;}
  body{background:#fff;color:#000;}
  .card{border:1px solid #ccc;box-shadow:none;break-inside:avoid;}
  .badge,.tag{border:1px solid #ccc;}
}

.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -2px;}
.table-scroll table{min-width:520px;}
/* Long, unbroken cell content (department names, ids) reads better as a
   horizontal scroll than as a multi-line wrap that gets clipped at the
   viewport edge on narrow screens. */
.nowrap-table th,.nowrap-table td{white-space:nowrap;}
/* Fixed, evenly-proportioned columns (via a colgroup) instead of
   auto-layout, which sizes each column to its widest cell and produces
   wildly uneven column widths across rows. Overflowing text truncates
   with an ellipsis rather than forcing the whole table wider. */
.table-scroll .fixed-cols{table-layout:fixed;min-width:900px;}
.fixed-cols td,.fixed-cols th{overflow:hidden;text-overflow:ellipsis;}

.table-scroll .board-table{table-layout:fixed;min-width:680px;}
.board-table th{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.board-table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.board-table td:first-child{white-space:normal;}

/* Name column stays fully visible and pinned on the left; the rest of a
   wide row (Position, Department, Employee #, etc.) scrolls horizontally
   under it instead of truncating with an ellipsis. */
.emp-table{table-layout:auto;}
.emp-table td:first-child,.emp-table th:first-child{position:sticky;left:0;background:var(--card);z-index:1;box-shadow:2px 0 4px -2px rgba(0,0,0,.08);}
.team-sched-table td:first-child,.team-sched-table th:first-child{position:sticky;left:0;background:var(--card);z-index:1;box-shadow:2px 0 4px -2px rgba(0,0,0,.08);}
.team-sched-table th.today-col,.team-sched-table td.today-col{background:var(--primary-light);}
.team-sched-table.team-sched-editable tbody tr{cursor:pointer;}
.team-sched-table.team-sched-editable tbody tr:hover td{background:var(--surface);}
.team-sched-table.team-sched-editable tbody tr:hover td.today-col{background:var(--primary-light);}
.team-sched-table.team-sched-editable tbody tr:hover td:first-child{background:var(--surface);}
.emp-search-input{max-width:340px;margin-bottom:14px;}
.board-filter-select{flex:0 0 150px;}
@media(max-width:700px){.board-filter-select{flex:1 1 45%;min-width:140px;}}

.payslip-header{display:flex;align-items:center;flex-wrap:wrap;gap:24px;}
.payslip-divider{width:1px;height:86px;flex-shrink:0;background:var(--border);}
.payslip-info-grid{display:grid;grid-template-columns:repeat(3,1fr);flex:1;min-width:280px;gap:20px 32px;font-size:12px;padding-right:24px;}
.payslip-body-grid{display:grid;grid-template-columns:1fr 1fr 0.9fr;}
@media(max-width:900px){
  .payslip-body-grid{grid-template-columns:1fr 1fr;}
  .payslip-body-grid > :last-child{grid-column:1 / -1;}
}
@media(max-width:700px){
  .payslip-divider{display:none;}
  /* flex-basis:100% forces this onto its own line below the logo/name
     block — without it, flex-wrap only wraps when content truly can't
     shrink further, so min-width:0 let this get squeezed to a sliver
     next to its sibling instead of wrapping, clipping every field. */
  .payslip-info-grid{grid-template-columns:repeat(2,1fr);flex-basis:100%;min-width:0;padding-right:0;}
  .payslip-body-grid{grid-template-columns:1fr;}
  .payslip-body-grid > :last-child{grid-column:auto;}
}
@media(max-width:420px){
  .payslip-info-grid{grid-template-columns:1fr;}
}

/* Every modal's card has to fit within the viewport height, not just
   width — long content (e.g. many deduction rows, a long task
   description) shouldn't be able to push action buttons below the fold
   on short/landscape-mobile screens. */
[id$="-backdrop"] > .card{max-height:90vh;overflow-y:auto;}

@media(max-width:1000px){
  .topbar-datetime{font-size:11px;}
  .topbar-search{width:140px;}
  .who > div > div.small-note{display:none;}
}
@media(max-width:700px){
  .content-topbar{flex-wrap:wrap;gap:8px;}
  .topbar-search{display:none;}
  .row{flex-wrap:wrap;}
  .row > *{flex:1 1 45%;min-width:140px;}
  /* Attendance Today / Today's Schedule carry a big clock readout and a
     large button — 45% each clips text at phone widths. Stack full-width
     instead of squeezing side by side. */
  .attendance-schedule-row > *{flex:1 1 100%;}
  .clocktime-lg{font-size:26px;}
  .clock-action-btn{padding:12px 18px;font-size:13px;}
  .topbar-datetime{font-size:10px;}
  .who{gap:8px;}
  .who > div > div.small-note{display:none;}
  .shell{flex-direction:column;}
  nav.sidebar{width:100%;max-width:100%;flex-direction:column;border-bottom:1px solid var(--border);padding:8px 10px;gap:6px;}
  .sidebar-brand{width:100%;justify-content:center;padding:6px 4px;}
  /* nav-main uses display:contents so its buttons become direct flex
     items of nav-list, giving one continuous scrollable row instead of
     two separate rows (main nav + Settings). */
  nav.sidebar .nav-list{width:100%;max-width:100%;min-width:0;display:flex;flex-direction:row;gap:2px;overflow-x:auto;-webkit-overflow-scrolling:touch;}
  nav.sidebar .nav-main{display:contents;}
  nav.sidebar .nav-section-label{display:none;}
  nav.sidebar .nav-section-group{display:contents;}
  nav.sidebar .nav-settings{flex-shrink:0;margin:0 0 0 6px;margin-top:0;padding:11px 12px 11px 14px;border-top:none;border-left:1px solid rgba(255,255,255,.2);}
  .sidebar-support-card{display:none;}
  nav.sidebar button{width:auto;white-space:nowrap;margin-bottom:0;flex-shrink:0;}
  main.content{padding:16px;}
  .grid3{grid-template-columns:1fr;}
  .login-hero{padding:36px 22px 26px;}
  .login-hero .brand-logo{height:34px;}
  .login-brand-row{gap:8px;}
  .login-hero h1.login-brand-row{font-size:23px;white-space:nowrap;}
}

.note-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:6px;margin-top:6px;}
.note-thumbs img{width:100%;height:84px;object-fit:cover;border-radius:8px;border:1px solid var(--border);cursor:pointer;}
.note-dropzone{border:2px dashed var(--border);border-radius:10px;padding:14px;text-align:center;font-size:13px;color:var(--text-muted);cursor:pointer;transition:background .12s,border-color .12s;}
.note-dropzone.dragover,.note-dropzone:hover{border-color:var(--primary);background:var(--primary-light);}
.note-previews{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px;margin-top:8px;}
.note-preview{position:relative;}
.note-preview img{width:100%;height:64px;object-fit:cover;border-radius:8px;border:1px solid var(--border);display:block;}
.note-preview button{position:absolute;top:2px;right:2px;width:18px;height:18px;border-radius:50%;border:none;background:rgba(0,0,0,.65);color:#fff;font-size:10px;line-height:1;cursor:pointer;padding:0;}

.sched-cal-table{width:100%;border-collapse:collapse;table-layout:fixed;}
.sched-cal-table th{font-size:11px;font-weight:600;color:var(--text-muted);padding:4px 0;text-align:center;}
.sched-cal-table td{height:38px;text-align:center;font-size:13px;border:1px solid var(--border);border-radius:6px;position:relative;}
.sched-cal-table td.cal-day{cursor:pointer;transition:background .12s;}
.sched-cal-table td.cal-day:hover{background:var(--primary-light);}
.sched-cal-table td.cal-day-past{color:var(--text-muted);opacity:.4;cursor:not-allowed;}
.sched-cal-table td.cal-day-today{font-weight:700;box-shadow:inset 0 0 0 1.5px var(--primary);}
.sched-cal-table td.cal-day-template-off{background:var(--amber-bg);}
.sched-cal-table td.cal-day-template-off:hover{background:var(--amber-bg);filter:brightness(.95);}
.sched-cal-table td.cal-day-selected{background:var(--primary);color:#fff;font-weight:700;}
.sched-cal-table td.cal-day-selected:hover{background:var(--primary-dark);}
.cal-day-dot{position:absolute;bottom:3px;left:50%;transform:translateX(-50%);width:5px;height:5px;border-radius:50%;background:var(--blue);}
.sched-cal-table td.cal-day-selected .cal-day-dot{background:#fff;}
.sched-date-chip{display:inline-flex;align-items:center;gap:4px;}
.sched-date-chip button{border:none;background:none;cursor:pointer;font-weight:700;color:inherit;font-size:13px;line-height:1;padding:0;}
