/* OfficeHQ — styles */
:root {
  --brand: #6366f1; --brand-2: #06b6d4; --brand-grad: linear-gradient(135deg, #6366f1, #06b6d4);
  --pos: #22c55e; --amber: #f59e0b; --neg: #ef4444;
  --radius: 16px; --radius-sm: 11px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg: #0c1018; --surface: #141a26; --surface-2: #1c2433; --surface-3: #232d40;
  --text: #eef2f9; --muted: #94a3b8; --border: #25303f; --card: #131927;
}
[data-theme="light"] {
  --bg: #f1f4f9; --surface: #ffffff; --surface-2: #f1f4f9; --surface-3: #e7ecf3;
  --text: #0f172a; --muted: #64748b; --border: #e2e8f0; --card: #ffffff;
  --shadow: 0 10px 30px -14px rgba(15, 23, 42, .18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; }

.app { display: flex; min-height: 100vh; }

/* sidebar */
.sidebar { width: 248px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 1.35rem; font-weight: 900; letter-spacing: -.5px; padding: 6px 10px 18px; display: flex; align-items: center; gap: 6px; }
.brand-mark { font-size: 1.5rem; }
.brand-accent { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: none; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .95rem; border-radius: var(--radius-sm); cursor: pointer; text-align: left; transition: .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px var(--brand); }
.ni-ic { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; display: flex; flex-direction: column; gap: 10px; font-size: .8rem; }
.priv { color: var(--muted); }
.ghost-link { color: var(--brand); text-decoration: none; font-weight: 700; }
.ghost-link:hover { text-decoration: underline; }

/* main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 26px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-title { font-size: 1.3rem; font-weight: 800; margin-right: auto; letter-spacing: -.4px; }
.menu-btn { display: none; }
.view { padding: 26px; flex: 1; max-width: 1180px; width: 100%; }

/* buttons */
.btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.btn.sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-primary { background: var(--brand-grad); border: none; color: #fff; box-shadow: 0 8px 18px -10px var(--brand); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn.ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--neg); border-color: color-mix(in srgb, var(--neg) 45%, var(--border)); }
.btn-danger:hover { background: var(--neg); color: #fff; border-color: var(--neg); }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.05rem; color: var(--text); display: inline-flex; align-items: center; justify-content: center; transition: .15s; }
.icon-btn:hover { border-color: var(--brand); }
.icon-btn.sm { width: 30px; height: 30px; font-size: .85rem; border-radius: 8px; }
.link-btn { background: none; border: none; color: var(--brand); font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { font-size: 1.02rem; font-weight: 800; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.stats { grid-template-columns: repeat(5, 1fr); }
.grid.two { grid-template-columns: 1fr 1fr; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.stat-k { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat b { font-size: 1.9rem; font-weight: 900; letter-spacing: -1px; }
.stat .pos { color: var(--pos); } .stat .amber { color: var(--amber); }
.muted-text { color: var(--muted); }

/* donut + legend */
.donut-row { display: flex; align-items: center; gap: 18px; }
.chart-donut { width: 120px; height: 120px; flex-shrink: 0; }
.chart-bars { width: 100%; height: auto; }
.legend { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: .88rem; }
.legend li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.legend i { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

/* mini-list */
.mini-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.mini-list li { display: flex; align-items: center; gap: 11px; padding: 9px 6px; border-bottom: 1px solid var(--border); }
.mini-list li:last-child { border-bottom: none; }
.mini-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.mini-main b { font-size: .9rem; font-weight: 700; }
.mini-main small { color: var(--muted); font-size: .78rem; }
.mini-btn { border: 1px solid var(--border); background: var(--surface-2); width: 28px; height: 28px; border-radius: 7px; cursor: pointer; font-weight: 800; }
.mini-btn.ok { color: var(--pos); } .mini-btn.no { color: var(--neg); }
.mini-btn.ok:hover { background: var(--pos); color: #fff; } .mini-btn.no:hover { background: var(--neg); color: #fff; }
.lv-acts { display: flex; gap: 6px; }

/* avatar / badges */
.avatar { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; flex-shrink: 0; }
.badge { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 16%, transparent); text-transform: capitalize; }

/* toolbar */
.toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.search, .select { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 10px; font: inherit; }
.search { flex: 1; min-width: 200px; }
.select.sm { padding: 6px 8px; font-size: .82rem; }
.search:focus, .select:focus { outline: none; border-color: var(--brand); }

/* people grid */
.grid.people { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.person { display: flex; flex-direction: column; gap: 5px; }
.person-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.person-acts { display: flex; gap: 4px; opacity: 0; transition: .15s; }
.person:hover .person-acts { opacity: 1; }
.person h3 { font-size: 1.02rem; font-weight: 800; }
.person-role { color: var(--muted); font-size: .85rem; }
.person-meta { display: flex; gap: 7px; flex-wrap: wrap; margin: 6px 0 2px; }
.dept { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.person-mail { color: var(--brand); font-size: .8rem; text-decoration: none; word-break: break-all; }
.person-mail:hover { text-decoration: underline; }

/* attendance */
.att-head { margin-bottom: 16px; font-size: 1.05rem; }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow); }
.att-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-main b { font-weight: 700; }
.att-main small { color: var(--muted); font-size: .8rem; }
.att-times { display: flex; align-items: center; gap: 8px; }
.att-times small { color: var(--muted); font-size: .76rem; font-family: var(--mono); }
.att-acts { display: flex; gap: 7px; align-items: center; }

/* leave */
.section-h { font-size: 1.05rem; font-weight: 800; margin: 8px 0 12px; display: flex; align-items: center; gap: 9px; }
.count { background: var(--surface-3); color: var(--muted); font-size: .78rem; padding: 2px 9px; border-radius: 99px; }
.lv-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.lv { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow); }
.lv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lv-main b { font-weight: 700; }
.lv-main small { color: var(--muted); font-size: .8rem; }
.lv-badge.pending { --c: var(--amber); color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.lv-badge.approved { --c: var(--pos); color: var(--pos); background: color-mix(in srgb, var(--pos) 16%, transparent); }
.lv-badge.rejected { --c: var(--neg); color: var(--neg); background: color-mix(in srgb, var(--neg) 16%, transparent); }

/* tasks */
.chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 7px 15px; border-radius: 99px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.task-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow); }
.task-check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid; cursor: pointer; color: #fff; font-weight: 900; font-size: .8rem; flex-shrink: 0; }
.task-main { flex: 1; min-width: 0; }
.task-main b { font-weight: 700; }
.task-main b.done { text-decoration: line-through; color: var(--muted); }
.task-main small { display: block; color: var(--muted); font-size: .8rem; }
.prio-dot { width: 11px; height: 11px; border-radius: 99px; flex-shrink: 0; }
.neg { color: var(--neg); } .pos { color: var(--pos); }

/* announcements */
.ann-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ann { display: flex; flex-direction: column; gap: 9px; }
.ann.pinned { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.ann-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ann-top h3 { font-size: 1.02rem; font-weight: 800; }
.ann-acts { display: flex; gap: 3px; opacity: 0; transition: .15s; }
.ann:hover .ann-acts { opacity: 1; }
.ann p { color: var(--muted); font-size: .9rem; white-space: pre-wrap; flex: 1; }

/* fields / forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 10px 13px; border-radius: 10px; font: inherit; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 600; cursor: pointer; margin-bottom: 13px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; } .row.wrap { flex-wrap: wrap; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .btn-danger { margin-right: auto; }

/* empty */
.empty { text-align: center; padding: 60px 20px; max-width: 480px; margin: 30px auto; }
.empty-ic { font-size: 3.4rem; margin-bottom: 14px; }
.empty h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 20px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(4, 7, 13, .62); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6); animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-head h2 { font-size: 1.15rem; font-weight: 800; }
.modal-body { padding: 20px; }

/* toast */
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); padding: 11px 20px; border-radius: 11px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); animation: slideup .25s ease; }
.toast.ok { border-left: 4px solid var(--pos); } .toast.err { border-left: 4px solid var(--neg); }
.toast.hide { opacity: 0; transition: .3s; }
@keyframes slideup { from { transform: translateY(14px); opacity: 0; } }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 18px 26px; margin-top: auto; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; max-width: 1180px; margin: 0 auto; }
.foot-socials { display: flex; gap: 8px; }
.foot-socials a { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: .15s; }
.foot-socials a:hover { color: #fff; background: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.footer-bottom { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); max-width: 1180px; margin-left: auto; margin-right: auto; }

/* responsive */
@media (max-width: 900px) {
  .grid.stats { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .view { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .att-row { flex-wrap: wrap; }
  .att-acts { width: 100%; justify-content: flex-start; }
  .row2 { grid-template-columns: 1fr; }
}
