/* ===========================================================
   Sungwoo Hitech HR Portal v2
   Brand colours from the logo:
     deep blue #0074bb, blue #009de0, red #c20016
   =========================================================== */
:root {
  --bg: #f4f7fa;
  --surface: #ffffff;
  --ink: #0f2438;
  --ink-2: #33475b;
  --muted: #64768a;
  --line: #e1e8ef;
  --line-strong: #cbd6e1;

  --primary: #0074bb;
  --primary-dark: #005a92;
  --primary-soft: #e6f2fa;
  --sky: #009de0;
  --sky-soft: #e3f5fd;
  --red: #c20016;
  --red-dark: #9e0012;
  --red-soft: #fcebed;

  --green: #13804f;
  --green-soft: #e3f4eb;
  --amber: #9a5b00;
  --amber-soft: #fff2db;

  --r-lg: 12px;
  --r: 8px;
  --r-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 36, 56, .06);
  --shadow: 0 1px 3px rgba(15, 36, 56, .06), 0 1px 2px rgba(15, 36, 56, .04);
  --shadow-lg: 0 12px 32px rgba(15, 36, 56, .14);
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --side-w: 256px;
  --top-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.icon { flex-shrink: 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--r); }
.skip-link:focus { left: 8px; }

/* ================= Shell ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w); position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  transition: transform .25s ease;
}
.brand { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: calc(var(--top-h) + 22px); padding: 0 22px; border-bottom: 1px solid var(--line); position: relative; }
.brand::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--primary) 0 72%, var(--sky) 72% 90%, var(--red) 90%); }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 100%; max-width: 196px; height: auto; }
.brand span { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .2px; }

.sidebar nav { flex: 1; padding: 10px 12px 16px; overflow-y: auto; }
.nav-label { font-size: 12px; font-weight: 700; color: #8a9aab; padding: 16px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px; border-radius: var(--r);
  color: var(--ink-2); font-weight: 600; position: relative;
}
.nav-link .icon { color: #7b8ea2; }
.nav-link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.nav-link.active .icon { color: var(--primary); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-link .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800; border-radius: 20px; padding: 0 7px; min-width: 20px; text-align: center; line-height: 19px; }
.sidebar-foot { padding: 14px 24px; border-top: 1px solid var(--line); }
.version { font-size: 12px; color: #8a9aab; font-weight: 600; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .menu-btn, .topbar-logo { display: none; }
.topbar-spacer { flex: 1; }
.global-search { flex: 1; max-width: 460px; position: relative; display: flex; align-items: center; }
.global-search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.global-search input { padding: 9px 12px 9px 38px; background: var(--bg); border-color: transparent; font-size: 14px; }
.global-search input:focus { background: #fff; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.bell { position: relative; color: var(--ink-2); width: 40px; height: 40px; }
.bell .dot { position: absolute; top: 4px; right: 3px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 10px; min-width: 17px; height: 17px; line-height: 17px; text-align: center; padding: 0 4px; box-shadow: 0 0 0 2px #fff; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: var(--r); padding: 4px 8px 4px 4px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.user-btn:hover { background: var(--bg); }
.user-btn > .icon { transform: rotate(90deg); color: var(--muted); }
.user-meta strong { display: block; font-size: 13.5px; line-height: 1.2; }
.user-meta small { color: var(--muted); font-size: 12px; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 320px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dropdown-head { padding: 12px 16px; font-weight: 800; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.dropdown-empty { padding: 22px 16px; margin: 0; color: var(--muted); text-align: center; }
.dropdown-foot { display: block; padding: 10px 16px; text-align: center; font-weight: 700; font-size: 13px; border-top: 1px solid var(--line); background: #fafcfd; }
.notif { display: flex; gap: 11px; align-items: flex-start; padding: 11px 16px; color: var(--ink); font-size: 13.5px; border-bottom: 1px solid var(--line); }
.notif:last-of-type { border-bottom: 0; }
.notif:hover { background: var(--bg); text-decoration: none; }
.notif small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.notif-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.notif-ico.tone-approved { background: var(--green-soft); color: var(--green); }
.notif-ico.tone-rejected { background: var(--red-soft); color: var(--red); }
.user-menu { width: 270px; }
.user-head { display: flex; gap: 12px; align-items: center; font-weight: 400; }
.user-head strong { display: block; font-size: 14px; }
.user-head small { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.user-menu a { display: flex; gap: 10px; align-items: center; padding: 10px 16px; color: var(--ink-2); font-weight: 600; }
.user-menu a:hover { background: var(--bg); text-decoration: none; }
.user-menu .signout { color: var(--red); border-top: 1px solid var(--line); }
.last-login { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--muted); background: #fafcfd; border-top: 1px solid var(--line); }

/* ---------- Page header ---------- */
.page-head { padding: 22px 28px 0; max-width: 1360px; width: 100%; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); font-weight: 600; }
.crumbs a:hover { color: var(--primary); }
.crumbs [aria-current] { color: var(--ink-2); font-weight: 600; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { margin: 3px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.content { padding: 20px 28px 36px; max-width: 1360px; width: 100%; flex: 1; }
.overlay { display: none; }

.app-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 28px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: #fff; }

/* ================= Avatars ================= */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: var(--primary); color: #fff;
  display: inline-grid; place-items: center; font-weight: 800; font-size: 13px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 11.5px; }
span.avatar.sm { background: var(--primary-soft); color: var(--primary-dark); }
.avatar.lg { width: 64px; height: 64px; font-size: 21px; }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; }
img.avatar { background: var(--line); }

/* ================= Layout helpers ================= */
.grid { display: grid; gap: 20px; align-content: start; }
.stats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.two-col { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.mb { margin-bottom: 20px; }
.mb-sm { margin-bottom: 14px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; justify-content: flex-end; }

/* ================= Cards ================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 15px 20px; border-bottom: 1px solid var(--line); min-height: 58px; }
.card-head h2 { font-size: 15px; font-weight: 800; }
.card-sub { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.card-body { padding: 20px; }
.card-body + .card-head { border-top: 1px solid var(--line); }
.border-top { border-top: 1px solid var(--line); }
.card-note { margin: 0; padding: 12px 20px 16px; font-size: 12.5px; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; font-weight: 800; }
.section-title { font-size: 16px; font-weight: 800; margin: 0 0 12px; }

/* Stat cards */
.stat { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; color: var(--ink); }
a.stat:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(15, 36, 56, .08); }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.stat-icon.sky { background: var(--sky-soft); color: var(--sky); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-label { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-value { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px; margin: 2px 0; }
.stat-value small { font-size: 16px; color: var(--muted); margin-left: 1px; }
.stat-value.sm { font-size: 17px; letter-spacing: 0; line-height: 1.35; margin: 6px 0 4px; }
.stat-foot { display: block; font-size: 12.5px; color: var(--muted); }

/* ================= Charts ================= */
.colchart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 220px; align-items: end; }
.colchart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.col-bar { width: 100%; max-width: 30px; background: #c7dff0; border-radius: 5px 5px 2px 2px; transition: background .15s; }
.col:hover .col-bar { background: var(--sky); }
.col.now .col-bar { background: var(--primary); }
.col-val { font-size: 11.5px; font-weight: 700; color: var(--ink-2); min-height: 16px; }
.col-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.col.now .col-lbl { color: var(--primary); font-weight: 800; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hbars li { display: grid; grid-template-columns: 150px 1fr 32px; align-items: center; gap: 12px; font-size: 13.5px; }
.hbars a { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars strong { text-align: right; }
.hbar { height: 10px; background: #edf2f6; border-radius: 6px; overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--sky)); }

.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.donut span { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.2; }
.donut strong { font-size: 24px; color: var(--ink); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 160px; }
.donut-legend li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ================= Employee home ================= */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 24px 26px; border-radius: var(--r-lg); background: var(--primary); color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; right: -40px; top: -90px; width: 420px; height: 200px; border: 4px solid var(--red); border-color: var(--red) transparent transparent transparent; border-radius: 50%; transform: rotate(-10deg); opacity: .9; pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 40%, rgba(0, 157, 224, .55)); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-main { display: flex; gap: 18px; align-items: center; }
.hero-main .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); background: #fff; color: var(--primary); }
.hero h2 { font-size: 21px; font-weight: 800; }
.hero p { margin: 2px 0 0; opacity: .92; }
.hero .hero-meta { font-size: 13px; opacity: .78; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 0; margin: 0; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--r-lg); }
.hero-stats div { padding: 12px 20px; border-left: 1px solid rgba(255, 255, 255, .2); }
.hero-stats div:first-child { border-left: 0; }
.hero-stats dt { font-size: 12px; opacity: .85; font-weight: 600; white-space: nowrap; }
.hero-stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; }
.hero-stats dd.sm { font-size: 14.5px; line-height: 1.3; max-width: 160px; }
.hero-stats dd small { display: block; font-size: 12px; font-weight: 600; opacity: .85; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick-tile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.quick-tile:hover { text-decoration: none; border-color: var(--sky); box-shadow: 0 4px 14px rgba(0, 157, 224, .12); }
.qt-ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.quick-tile:first-child .qt-ico { background: var(--red); color: #fff; }
.quick-tile strong { display: block; font-size: 14.5px; }
.quick-tile small { color: var(--muted); font-size: 12.5px; }

/* ================= Tables ================= */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 12.5px; font-weight: 700; color: var(--muted); background: #f8fafc; }
th.right, td.right { text-align: right; }
.th-sort { color: inherit; display: inline-flex; gap: 2px; }
.th-sort:hover { color: var(--primary); text-decoration: none; }
th[aria-sort] .th-sort { color: var(--primary); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbfd; }
tr.is-past td { color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.wrap { white-space: normal; min-width: 180px; }
.mono { font-weight: 700; color: var(--ink-2); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); margin: 0; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state .icon { color: var(--line-strong); }
.empty-state h3 { color: var(--ink); font-size: 16px; margin: 10px 0 4px; }
.empty-state p { margin: 0 0 16px; }
.person { display: flex; align-items: center; gap: 11px; color: var(--ink); }
a.person:hover { text-decoration: none; }
a.person:hover .person-name { color: var(--primary); text-decoration: underline; }
.person-name { font-weight: 700; }
.strong-link { font-weight: 700; color: var(--ink); }
.text-red { color: var(--red) !important; }
.num-input { width: 90px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span { min-width: 32px; height: 32px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--r-sm); font-weight: 700; color: var(--ink-2); border: 1px solid var(--line); background: #fff; }
.pager-links a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pager-links .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-links .disabled { opacity: .4; }
.pager-links .gap { border: 0; background: none; }

/* ================= Badges ================= */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--amber-soft); color: var(--amber); }
.badge-approved, .badge-active { background: var(--green-soft); color: var(--green); }
.badge-rejected, .badge-inactive { background: var(--red-soft); color: var(--red); }
.badge-government { background: var(--primary-soft); color: var(--primary); }
.badge-company { background: var(--red-soft); color: var(--red); }
.badge-admin { background: var(--primary); color: #fff; font-size: 11px; padding: 1px 8px; margin-left: 4px; }
.badge-admin::before { display: none; }
.pill { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); border-radius: 20px; padding: 2px 11px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r);
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  background: var(--primary); color: #fff; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-light { background: #fff; color: var(--ink-2); border-color: var(--line-strong); }
.btn-light:hover { background: var(--bg); color: var(--ink); }
.btn-success { background: var(--green); }
.btn-success:hover { background: #0e6a41; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: var(--red-dark); }
.btn-danger-ghost { background: #fff; color: var(--red); border-color: #efc3c9; box-shadow: none; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); box-shadow: none; }
.btn-block { width: 100%; height: 46px; font-size: 15px; margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; font-size: 13px; color: var(--primary); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; cursor: pointer; color: inherit; padding: 7px; border-radius: var(--r); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--bg); }
.actions { display: flex; gap: 6px; align-items: center; }
.actions form, .decide { margin: 0; }
.decide { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 240px; }
.decide input { flex: 1 0 100%; height: 32px; padding: 0 10px; font-size: 13px; }

/* ================= Forms ================= */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label, legend, .step-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-size: 14.5px; padding: 9px 12px; width: 100%; min-height: 40px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
input:hover, select:hover, textarea:hover { border-color: #b5c4d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 116, 187, .15); }
textarea { resize: vertical; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.center { text-align: center; margin-top: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card-body.form-actions { padding-top: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar form { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; height: 38px; min-height: 0; padding: 0 12px; font-size: 14px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field .icon { position: absolute; left: 11px; color: var(--muted); }
.toolbar .search-field input { padding-left: 34px; min-width: 250px; }
.days-preview { padding: 11px 14px; background: var(--sky-soft); border-radius: var(--r); color: var(--primary-dark); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-top: 8px; cursor: pointer; }
.photo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.photo-row .hint { margin-top: 8px; }
.photo-form { display: flex; gap: 12px; align-items: center; margin-top: 10px; }

.type-picker { border: 0; padding: 0; margin: 0; }
.type-picker legend { padding: 0; margin-bottom: 8px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.type-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 13px 14px 13px 42px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.type-card input { position: absolute; left: 15px; top: 16px; width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.type-card:hover { border-color: var(--sky); }
.type-card.is-checked { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.type-name { font-weight: 700; color: var(--ink); }
.type-left { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.type-card.is-empty { opacity: .55; cursor: not-allowed; background: #f7f9fb; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--primary-soft); color: var(--primary); font: 700 12.5px var(--font); padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; }

/* ================= Tabs ================= */
.tabs { display: flex; gap: 2px; background: #edf2f7; padding: 3px; border-radius: var(--r); flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: var(--r-sm); color: var(--muted); font-weight: 700; font-size: 13px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.tab-count { background: var(--red); color: #fff; border-radius: 20px; padding: 0 6px; font-size: 11px; margin-left: 3px; }

/* ================= Alerts ================= */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; font-weight: 600; border: 1px solid; border-left-width: 4px; transition: opacity .4s; }
.alert-success { background: var(--green-soft); color: #0b4f31; border-color: #b9e2cb; border-left-color: var(--green); }
.alert-error { background: var(--red-soft); color: #7c0010; border-color: #f2bfc6; border-left-color: var(--red); }
.alert-info { background: var(--sky-soft); color: #064a6b; border-color: #b8e2f5; border-left-color: var(--sky); }
.alert-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 4px; }
.alert-close:hover { opacity: 1; }

/* ================= Leave balance ================= */
.balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.balance { padding: 16px 18px; }
.balance h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.balance .big { font-size: 26px; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; color: var(--ink); }
.balance .big small { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.bar { height: 6px; background: #edf2f6; border-radius: 6px; overflow: hidden; margin: 12px 0 8px; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.balance .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }

/* ================= Lists ================= */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 13px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.date-box { width: 46px; text-align: center; border-radius: var(--r); background: var(--primary-soft); color: var(--primary); padding: 5px 0; line-height: 1.1; flex-shrink: 0; }
.date-box b { display: block; font-size: 17px; font-weight: 800; }
.date-box span { font-size: 10.5px; font-weight: 700; }
.date-box.company { background: var(--red-soft); color: var(--red); }
.file-ico { width: 38px; height: 38px; border-radius: var(--r); background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }

/* ================= Employee record ================= */
.profile-layout { grid-template-columns: 320px minmax(0, 1fr); }
.profile-card { overflow: hidden; align-self: start; }
.profile-cover { height: 84px; background: linear-gradient(110deg, var(--primary), var(--sky)); position: relative; }
.profile-cover::after { content: ""; position: absolute; left: -30px; right: -30px; bottom: 16px; height: 60px; border-top: 3px solid var(--red); border-radius: 50%; transform: rotate(-4deg); }
.profile-id { text-align: center; padding: 0 20px 18px; margin-top: -48px; position: relative; }
.profile-id .avatar { box-shadow: 0 0 0 4px #fff; }
.profile-id h2 { font-size: 18px; font-weight: 800; margin-top: 10px; }
.profile-id .badges { margin-top: 10px; }
.facts { list-style: none; margin: 0; padding: 6px 0; border-top: 1px solid var(--line); }
.facts li { display: flex; gap: 12px; padding: 10px 20px; font-weight: 600; font-size: 13.5px; }
.facts .icon { color: var(--muted); margin-top: 3px; }
.facts small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.facts span { min-width: 0; word-break: break-word; }

.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-head h2 { font-size: 20px; font-weight: 800; }
.profile-head .sub { font-size: 14px; margin: 2px 0 0; }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px 24px; margin: 0; }
.dl dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dl dd { margin: 2px 0 0; font-weight: 700; }
.dl dd .sub { display: inline; }

/* ================= Holiday calendar ================= */
.cal-head { display: flex; align-items: center; gap: 6px; }
.cal-head h2 { min-width: 160px; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0 4px; }
.cal-day { min-height: 82px; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; background: #fff; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.blank { background: transparent; border-color: transparent; }
.cal-day .num { font-weight: 700; font-size: 13px; }
.cal-day.sun { background: #f9fafc; }
.cal-day.sun .num { color: var(--red); }
.cal-day.today { border: 2px solid var(--sky); }
.cal-day.gov { background: var(--primary-soft); border-color: #c3dcee; }
.cal-day.gov .cal-ev { color: var(--primary-dark); }
.cal-day.comp { background: var(--red-soft); border-color: #f2c7cc; }
.cal-day.comp .cal-ev { color: #8d0010; }
.cal-ev { font-size: 11.5px; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.gov { background: var(--primary); }
.legend i.comp { background: var(--red); }

/* ================= Modal ================= */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15, 36, 56, .45); display: grid; place-items: center; padding: 20px; }
.modal-box { background: #fff; border-radius: var(--r-lg); padding: 24px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); }
.modal-box p { margin: 0 0 20px; font-size: 15.5px; font-weight: 700; }
.modal-box .form-actions { justify-content: flex-end; }

.bottom-nav { display: none; }

/* ================= Login ================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.1fr; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; background: linear-gradient(150deg, var(--primary) 0%, #0088cf 55%, var(--sky) 100%); }
.auth-art::before { content: ""; position: absolute; left: -220px; bottom: 70px; width: 1100px; height: 300px; border: 6px solid var(--red); border-color: var(--red) transparent transparent transparent; border-radius: 50%; transform: rotate(-14deg); opacity: .9; }
.auth-art > * { position: relative; }
.auth-art h2 { font-size: clamp(30px, 3.2vw, 42px); font-weight: 800; line-height: 1.15; letter-spacing: -.6px; margin: 40px 0 26px; max-width: 15ch; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 16px; font-weight: 600; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points .icon { background: rgba(255, 255, 255, .18); border-radius: 50%; padding: 7px; width: 34px; height: 34px; }
.auth-foot { margin: 0; opacity: .8; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: block; width: 100%; max-width: 280px; height: auto; margin-bottom: 30px; }
.auth-card h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.auth-card > .hint { margin-bottom: 22px; }
.auth-card .field { margin-bottom: 16px; }
.demo { margin-top: 26px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.demo summary { cursor: pointer; font-weight: 700; color: var(--primary); }

/* ================= Responsive ================= */
@media (max-width: 1180px) {
  .three-col { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1000px) {
  .two-col, .profile-layout { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .user-meta { display: none; }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgba(15, 36, 56, .45); z-index: 35; }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar-logo { display: block; height: 20px; width: auto; max-width: 160px; }
  .global-search, .topbar-spacer { display: none; }
  .user-btn > .icon { display: none; }
  .page-head { padding: 16px 14px 0; }
  .page-head h1 { font-size: 20px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .content { padding: 16px 14px 90px; }
  .app-footer { padding: 14px; padding-bottom: 80px; }
  .three-col { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { flex-direction: column; gap: 8px; padding: 14px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 24px; }
  .stat-value.sm { font-size: 15px; }
  .hero { padding: 20px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats div:nth-child(3) { border-left: 0; }
  .hero-stats div:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .2); }
  .colchart { gap: 4px; height: 180px; }
  .col-val { font-size: 10px; }
  .col-lbl { font-size: 10px; }
  .hbars li { grid-template-columns: 100px 1fr 28px; }
  .dropdown-menu { position: fixed; left: 10px; right: 10px; top: calc(var(--top-h) + 4px); width: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .cal-day { min-height: 54px; padding: 4px 5px; }
  .cal-ev { font-size: 10px; -webkit-line-clamp: 1; }
  .toolbar .search-field input { min-width: 0; width: 100%; }
  .toolbar .search-field { flex: 1 1 100%; }

  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 16px rgba(15, 36, 56, .06); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 700; border-radius: var(--r); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a.active { color: var(--primary); background: var(--primary-soft); }
}
@media (max-width: 520px) {
  .quick { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .quick-tile small { display: none; }
}

/* ================= Print (reports, lists) ================= */
@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .toolbar, .actions, .pager-links, .app-footer, .alert { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
