@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

.report-title {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

/* ============================================================================
   GemFlow theme - light, elegant style matching the Zultgems brand reference.
   Cream/gradient background, olive-green accent, serif brand type, glass panels.
   ============================================================================ */

:root {
  --bg: #f7f4ec;
  --bg-panel: #ffffff;
  --bg-panel-2: #f1eee4;
  --bg-sidebar: rgba(250,248,241,.78);
  --border: #e6e1d2;
  --text: #2b2a25;
  --text-dim: #8c8775;
  --accent: #6b7a4a;       /* olive green - Zultgems brand accent */
  --accent-dark: #57633c;
  --accent-soft: rgba(107,122,74,0.12);
  --accent-2: #b98a63;     /* warm champagne accent */
  --danger: #b65c4a;
  --radius: 18px;
  --shadow: 0 18px 44px rgba(43,42,37,0.09);
  --shadow-soft: 0 8px 24px rgba(43,42,37,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: "Segoe UI", Inter, -apple-system, Arial, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 83% 12%, rgba(183,174,100,.20), transparent 18%),
    radial-gradient(circle at 88% 20%, rgba(123,99,37,.10), transparent 16%),
    linear-gradient(110deg, #f7f4eb 0%, #fffdf8 48%, #f5f0e4 100%);
}

a { color: var(--accent); text-decoration: none; }

.serif { font-family: "Playfair Display", Georgia, serif; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-block;
}

.brand-mark {
  width: 100%;
  height: 100%;
  color: var(--accent);
}

.brand-logo-img {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-tag {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Sidebar brand: bigger, centered, like the reference */
.sidebar .brand {
  flex-direction: column;
  text-align: center;
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.sidebar .brand-mark-wrap { width: 40px; height: 52px; margin: 0 auto 12px; }
.sidebar .brand-name { font-size: 16px !important; letter-spacing: 0.32em; margin-left: 0; }
.sidebar .brand-tag { display: block; margin-top: 6px; letter-spacing: 0.28em; font-size: 9.5px; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #ffffff 0%, #f7f4ec 60%, #f2eee2 100%);
}

.login-card {
  width: 360px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.login-card .brand-mark-wrap { width: 36px; height: 36px; }
.login-card .brand { justify-content: center; margin-bottom: 28px; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  background: #fbfaf6;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-pw-wrap { position: relative; }
.field-pw-wrap input { padding-right: 38px; }
.field-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #9a9582;
  display: flex;
  align-items: center;
}
.field-eye-btn svg { width: 18px; height: 18px; }
.field-eye-btn:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.03em;
}

.btn:hover { background: var(--accent-dark); }
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.danger { background: var(--danger); color: #fff; }

.error-msg {
  background: rgba(182,92,74,0.08);
  border: 1px solid rgba(182,92,74,0.35);
  color: #9a4435;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
  display: none;
}

/* ---------- App shell (topbar + sidebar) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-sidebar);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 2;
  overflow: hidden;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(115,122,56,.38) transparent;
}
.nav-list::-webkit-scrollbar { width: 6px; }
.nav-list::-webkit-scrollbar-track { background: transparent; }
.nav-list::-webkit-scrollbar-thumb { background: rgba(115,122,56,.32); border-radius: 99px; }
.nav-list::-webkit-scrollbar-thumb:hover { background: rgba(115,122,56,.52); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 50px;
  padding: 0 16px;
  border-radius: 9px;
  color: #5a5747;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}

.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; color: inherit; stroke-width: 1.7; }

.nav-item:hover { background: rgba(115,122,56,.08); color: var(--text); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), #7b7f48);
  box-shadow: var(--shadow-soft);
  font-weight: 600;
}

.nav-group .nav-sub { display: none; }
.nav-group.open .nav-sub { display: flex; }
.nav-sub { flex-direction: column; gap: 4px; margin: 2px 0 2px 20px; padding-left: 18px; border-left: 1px solid var(--border); }
.nav-caret { margin-left: auto; display: flex; transition: transform .18s ease; }
.nav-caret svg { width: 12px; height: 12px; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-subitem {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}
.nav-subitem:hover { background: rgba(115,122,56,.08); color: var(--text); }
.nav-subitem.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px 0 42px;
  border-bottom: 1px solid #ECE8DF;
  background: rgba(255, 253, 248, 0.42);
}

.topbar .page-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  min-width: 0;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.gf-company-seal {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #E8E2D6;
  background: rgba(255, 255, 255, 0.34);
  color: var(--accent-dark);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 44px;
  line-height: 1;
  font-weight: 500;
}

.gf-company-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.gf-company-name {
  display: block;
  max-width: min(720px, 58vw);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 33px;
  line-height: 1.05;
  font-weight: 600;
  color: #22211d;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-company-select {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 28px 0 0;
  cursor: pointer;
}

.gf-company-select:focus {
  outline: 1px solid #ECE8DF;
  outline-offset: 4px;
}

.gf-company-address {
  display: block;
  max-width: min(720px, 58vw);
  margin-top: 15px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
  color: #7A7A7A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-module-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 15px;
  padding: 7px 13px 6px;
  border-radius: 8px;
  border: 1px solid rgba(107, 122, 74, 0.16);
  background: rgba(107, 122, 74, 0.09);
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.bell-wrap { position: relative; color: #6f6b5c; cursor: pointer; }
.bell-wrap svg { width: 21px; height: 21px; }
.bell-dot {
  position: absolute; top: -2px; right: -2px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
}

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: none;
  border: none;
  color: #6f6b5c;
  cursor: pointer;
  padding: 0;
}
.topbar-icon-btn svg { width: 19px; height: 19px; stroke-width: 1.7; }
.topbar-icon-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }
.topbar-icon-btn.exit:hover { background: rgba(182,92,74,0.12); color: var(--danger); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: default;
}


.user-chip .name { color: var(--text); font-weight: 600; line-height: 1.3; font-size: 14px; }
.user-chip .role-sub { font-size: 12px; color: var(--text-dim); line-height: 1.3; margin-top: 2px; }
.user-chip .chevron { color: #b0ab98; margin-left: 2px; }
.user-chip .chevron svg { width: 12px; height: 12px; }

.content { padding: 44px 50px 36px; flex: 1; }

/* ---------- Dashboard home: tab cards ---------- */
.dash-hero {
  position: relative;
  min-height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 44px;
  margin-bottom: 32px;
  background: var(--bg-panel-2);
}
.hero-gem {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  width: 170px;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 18px 26px rgba(71,64,35,.16));
}
.hero-gem-img {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 760px;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  z-index: 0;
}
.dash-hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 760px;
  background: linear-gradient(to right, var(--bg-panel-2) 0%, rgba(241,238,228,.88) 22%, rgba(241,238,228,.15) 55%, rgba(241,238,228,0) 75%);
  z-index: 1;
  pointer-events: none;
}
.greeting { position: relative; z-index: 2; margin-bottom: 0; max-width: 60%; }
.greeting h1 { font-family: "Playfair Display", Georgia, serif; font-size: 32px; font-weight: 600; margin: 0 0 10px; }
.greeting p { color: var(--text-dim); margin: 0; font-size: 14px; }

@media (max-width: 1100px) {
  .hero-gem { width: 130px; }
}
@media (max-width: 900px) {
  .hero-gem, .hero-gem-img { display: none; }
  .dash-hero::after { background: none; }
  .greeting { max-width: 100%; }
  .dash-hero { min-height: 0; padding: 24px; }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 24px;
  max-width: 1260px;
}
@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}
@media (max-width: 620px) {
  .card-grid { grid-template-columns: 1fr; }
}

.module-card {
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(119,113,86,.12);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 250px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255,255,255,.7), transparent 46%);
  pointer-events: none;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(43,42,37,0.13);
}

.module-card .icon {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  color: #373720;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.module-card .icon svg { width: 27px; height: 27px; stroke-width: 1.6; }

.module-card .title { font-family: "Playfair Display", Georgia, serif; font-size: 19px; font-weight: 600; color: var(--text); position: relative; z-index: 1; }
.module-card .desc { font-size: 13px; color: var(--text-dim); line-height: 1.65; position: relative; z-index: 1; }

.module-card .go-arrow {
  margin-top: auto;
  align-self: flex-end;
  color: var(--accent);
  position: relative;
  z-index: 1;
}
.module-card .go-arrow svg { width: 24px; height: 24px; }

.badge {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(185,138,99,0.4);
  border-radius: 4px;
  padding: 2px 6px;
  width: fit-content;
}

/* ---------- Generic placeholder page ---------- */
.placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 24px;
  text-align: center;
  color: var(--text-dim);
  background: rgba(255,255,255,.7);
}
.placeholder .icon-big { color: var(--accent); margin-bottom: 14px; display: flex; justify-content: center; }
.placeholder .icon-big svg { width: 34px; height: 34px; }
.placeholder h2 { color: var(--text); margin: 0 0 8px; font-size: 17px; font-family: "Playfair Display", Georgia, serif; }
.placeholder p { font-size: 13px; margin: 0; }

/* ---------- Table (admin) ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.03em;
  font-size: 11px;
  text-transform: uppercase;
}
table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
table.data-table tr:hover td { background: var(--bg-panel-2); }

.panel {
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel + .panel { margin-top: 18px; }
.panel h3 { margin: 0 0 16px; font-size: 14px; letter-spacing: 0.02em; font-family: "Playfair Display", Georgia, serif; font-weight: 600; }

.role-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: inline-block;
}
.role-pill.admin { background: rgba(185,138,99,0.16); color: #8a5d3d; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* ---------- Admin tabs ---------- */
.admin-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.admin-tab {
  padding: 4px 2px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: 7px;
}
.admin-tab svg { width: 16px; height: 16px; }
.admin-tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.perm-icons { display: flex; gap: 6px; flex-wrap: wrap; }
.perm-chip {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
}
.perm-chip svg { width: 14px; height: 14px; }
.perm-chip.locked { background: rgba(185,138,99,0.16); color: #8a5d3d; }

.module-check-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.module-check-list label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
  font-weight: 400;
}
.lock-note { font-size: 12px; color: var(--text-dim); }

/* ---------- Chip-style checkbox grid (e.g. RD form type / month pickers) ---------- */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fbfaf6;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  user-select: none;
}
.chip-check input { margin: 0; accent-color: var(--accent-dark); cursor: pointer; }
.chip-check:hover { border-color: var(--accent-dark); }
.chip-check.checked { background: var(--accent-soft); border-color: var(--accent-dark); color: var(--accent-dark); font-weight: 600; }
.chip-actions { display: flex; gap: 14px; margin-top: 8px; }
.chip-actions a { font-size: 12.5px; color: var(--accent-dark); text-decoration: underline; cursor: pointer; }

/* ---------- Footer ---------- */
.gf-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}
.gf-footer a { color: var(--text-dim); }
.gf-footer .footer-right { display: flex; align-items: center; gap: 36px; }
.gf-footer .support { color: var(--accent); font-weight: 600; cursor: pointer; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(43,42,37,0.35);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-backdrop.show { display: flex; }
.modal-box {
  width: 380px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.modal-box h3 { margin: 0 0 18px; font-family: "Playfair Display", Georgia, serif; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }





/* Role editor: nested module/submenu permissions */
.role-permission-group { border-bottom: 1px solid var(--border); padding: 8px 2px; }
.role-permission-group:last-child { border-bottom: 0; }
.role-module-check { font-weight: 600; color: var(--text); }
.role-submenu-checks { display: grid; gap: 5px; margin: 7px 0 0 24px; padding-left: 12px; border-left: 1px solid var(--border); }
.role-submenu-checks label { font-size: 12px; color: var(--text-dim); }
.role-submenu-checks input:disabled + span { opacity: .5; }
#roleModuleChecks { max-height: 360px; }
/* ---------- Working company identity (stripe, seal colour, switch button) ---------- */
.gf-company-stripe { position: fixed; top: 0; left: 0; right: 0; height: 5px; z-index: 60; background: var(--gf-company, var(--accent)); }
.gf-company-seal { border-color: var(--gf-company, #E8E2D6); color: var(--gf-company, var(--accent-dark)); }
.gf-company-name-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.gf-company-switch { border: 1px solid var(--border); background: var(--bg-panel); color: var(--text); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.gf-company-switch:hover { border-color: var(--gf-company, var(--accent)); color: var(--gf-company, var(--accent-dark)); }
.gf-switch-box { width: min(460px, calc(100vw - 32px)); }
.gf-switch-box h3 small { font-family: inherit; font-size: 13px; color: var(--text-dim); font-weight: 400; }
.gf-switch-now { font-size: 13.5px; line-height: 1.6; margin: 0 0 14px; color: var(--text-dim); }
.gf-switch-now strong { font-size: 17px; }
.gf-switch-list { display: flex; flex-direction: column; gap: 8px; }
.gf-switch-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-left: 6px solid var(--c);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 15px; }
.gf-switch-option input { accent-color: var(--c); }
.gf-switch-warn { font-size: 12.5px; line-height: 1.6; color: var(--danger); margin: 14px 0 0; }
.gf-switch-warn span { color: var(--text-dim); }

/* ---------- Systems (Finance / Operation) ---------- */
.gf-system-heading { grid-column: 1 / -1; margin: 18px 0 -4px; font-family: "Playfair Display", Georgia, serif; font-size: 22px; font-weight: 600; }

/* ---------- Employee (HR) pages ---------- */
.hr-page .panel { margin-bottom: 18px; }
.hr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hr-head h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 24px; font-weight: 600; }
.hr-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-panel); font: inherit; font-size: 14px; color: var(--text); }
.hr-input:focus { outline: none; border-color: var(--accent); }
.hr-year { width: auto; min-width: 100px; }
.hr-num { width: 80px; }
.hr-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.hr-row > .field { flex: 1 1 160px; }
.hr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.hr-cols > .panel { margin: 0 0 18px; }
.hr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.hr-stat { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.hr-stat-title { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.hr-stat-big { font-family: "Playfair Display", Georgia, serif; font-size: 30px; font-weight: 600; margin: 6px 0 4px; }
.hr-stat-big small { font-family: inherit; font-size: 13px; font-weight: 400; color: var(--text-dim); }
.hr-stat-sub { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.hr-help { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 0 0 12px; }
.hr-calc { font-size: 13px; color: var(--accent-dark); margin: -4px 0 10px; min-height: 18px; }
.hr-notice { background: #fff6e0; border: 1px solid #ecd7a0; color: #7a5a12; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; line-height: 1.6; }
.hr-check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0 12px; }
.hr-check input { accent-color: var(--accent); }
.hr-table-wrap { overflow-x: auto; }
.hr-empty { color: var(--text-dim); text-align: center; padding: 16px !important; }
.hr-sm { width: auto !important; padding: 5px 10px !important; font-size: 12px !important; }
.hr-actions { white-space: nowrap; }
.hr-actions .btn + .btn { margin-left: 6px; }
.hr-hist { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.hr-bad { color: var(--danger); }
.hr-inactive td { opacity: .5; }
.hr-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: #e3eed6; color: #3f5a1f; }
.badge-warn { background: #fbefd2; color: #8a5b0b; }
.badge-bad { background: #f6dfda; color: #9a3b2a; }
.badge-muted { background: #ece9e1; color: #7a776d; }
.hr-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.hr-tab { border: 1px solid var(--border); background: var(--bg-panel); border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-dim); }
.hr-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hr-modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.hr-cal-nav { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.hr-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hr-cal-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); text-align: center; padding: 4px 0; }
.hr-cal-d { min-height: 92px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--bg-panel); overflow: hidden; }
.hr-cal-d.empty { border: 0; background: transparent; }
.hr-cal-d.wkend { background: var(--bg-panel-2); }
.hr-cal-d.today { border: 2px solid var(--accent); }
.hr-cal-n { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.hr-chip { display: block; font-size: 11px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-chip.hol { background: #f6dfda; color: #9a3b2a; }
.hr-chip.approved { background: #e3eed6; color: #3f5a1f; }
.hr-chip.pending { background: #fff; color: #8a5b0b; border: 1px dashed #d9b25f; }
.hr-legend { display: flex; gap: 10px; margin-top: 12px; }
.hr-legend .hr-chip { display: inline-block; }
@media (max-width: 700px) { .hr-cal-d { min-height: 64px; } .hr-chip { font-size: 10px; } }

/* Unified, permission-filtered navigation. */
a.module-card, a.nav-item, a.nav-subitem { text-decoration:none; color:inherit; }
.gf-nav-section > summary { list-style:none; user-select:none; }
.gf-nav-section > summary::-webkit-details-marker { display:none; }
.gf-nav-section[open] > summary .nav-caret { transform:rotate(180deg); }
.gf-nav-children { margin:6px 0 4px 8px; padding:6px 7px; background:#f2f0e8; border-radius:9px; }
.gf-nav-caption { padding:13px 10px 5px; color:var(--text-dim); font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.gf-nav-children .nav-subitem { height:auto; min-height:35px; padding:8px 10px; line-height:1.4; font-size:12px; color:var(--text); }
.gf-nav-children .nav-subitem.active { background:var(--accent-soft); color:var(--accent-dark); }
.gf-nav-section > .nav-item { font-weight:600; font-size:13px; }
a.nav-item.active, .gf-nav-section > .nav-item.active { background:var(--accent); color:white; }
.nav-list { gap:5px; }
.nav-item:focus-visible, .nav-subitem:focus-visible, .gf-menu-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.gf-menu-toggle, .gf-drawer-close, .gf-drawer-backdrop { display:none; }
@media(max-width:1050px) {
  .sidebar { position:fixed; inset:0 auto 0 0; width:280px; max-width:86vw; height:100dvh; z-index:102; transform:translateX(-100%); transition:transform .2s ease; background:var(--bg); }
  .gf-drawer-open .sidebar { transform:translateX(0); }
  .gf-drawer-open { overflow:hidden; }
  .gf-drawer-open .gf-drawer-backdrop { display:block; position:fixed; inset:0; z-index:101; background:#20231866; border:0; }
  .gf-drawer-close { display:block; border:0; background:none; text-align:right; color:var(--text-dim); font:inherit; font-size:12px; cursor:pointer; }
  .gf-menu-toggle { display:grid; place-items:center; flex-shrink:0; width:36px; height:36px; border:1px solid var(--border); border-radius:8px; background:white; color:var(--accent-dark); cursor:pointer; }
  .gf-menu-toggle svg { width:20px; height:20px; }
  .topbar { gap:14px; padding:18px 24px; min-height:110px; }
  .topbar .page-title { flex:1; gap:12px; }
  .content { padding:28px 24px; }
}
@media(max-width:650px) {
  .topbar, body:has(.policies-page) .topbar { padding:16px; gap:10px; flex-wrap:wrap; }
  .topbar .page-title { flex-basis:calc(100% - 48px); }
  .gf-company-seal { width:42px; height:42px; font-size:18px; flex-shrink:0; }
  .gf-company-name { font-size:18px; overflow-wrap:anywhere; }
  .gf-company-address { display:none; }
  .topbar-right { margin-left:auto; max-width:100%; gap:8px; }
  .user-chip .name { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .content { padding:24px 16px; }
  .card-grid { grid-template-columns:minmax(0,1fr); }
}
