:root {
  --brand: #0b3b60;
  --brand-dark: #082b47;
  --accent: #d9a441;
  --ink: #152235;
  --muted: #647084;
  --surface: #ffffff;
  --surface-alt: #f4f7fa;
  --line: #dce3ea;
  --success: #18744b;
  --warning: #986600;
  --danger: #a63f3f;
  --radius: 16px;
  --shadow: 0 12px 38px rgba(13, 39, 62, .08);
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--surface-alt); line-height: 1.55; }
a { color: var(--brand); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid #55a7df; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 9999; background: #fff; color: #111; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.public-header { background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 800; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 20px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
.brand-text { display: grid; line-height: 1.1; }
.brand-text small { font-weight: 600; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; margin-top: 4px; }
.public-nav { display: flex; align-items: center; gap: 6px; }
.public-nav a { text-decoration: none; color: var(--ink); padding: 10px 12px; border-radius: 10px; font-weight: 650; font-size: 14px; }
.public-nav a:hover { background: var(--surface-alt); }
.mobile-nav-button { display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; }
.hero { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; padding: 76px 0 84px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; right: -160px; top: -190px; background: rgba(255,255,255,.08); }
.hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; left: -190px; bottom: -220px; background: rgba(217,164,65,.17); }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 48px; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--accent); }
.hero h1 { margin: 12px 0 18px; font-size: clamp(38px, 6vw, 68px); line-height: 1.02; letter-spacing: -.04em; max-width: 820px; }
.hero p { font-size: 18px; max-width: 690px; color: rgba(255,255,255,.85); }
.hero-search { display: flex; background: #fff; border-radius: 15px; padding: 7px; box-shadow: 0 18px 50px rgba(0,0,0,.2); max-width: 720px; margin-top: 28px; }
.hero-search input { min-width: 0; flex: 1; border: 0; padding: 13px 15px; color: var(--ink); background: transparent; }
.hero-search button { border: 0; border-radius: 11px; background: var(--accent); color: #1c2632; font-weight: 800; padding: 12px 20px; }
.hero-panel { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.17); border-radius: 24px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.hero-panel h2 { font-size: 18px; margin: 0 0 12px; }
.quick-links { display: grid; gap: 10px; }
.quick-links a { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: #fff; text-decoration: none; padding: 13px 14px; background: rgba(255,255,255,.08); border-radius: 12px; }
.quick-links a:hover { background: rgba(255,255,255,.15); }
.section { padding: 64px 0; }
.section.compact { padding: 36px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 26px; }
.section-heading h1, .section-heading h2 { margin: 0; line-height: 1.1; letter-spacing: -.025em; }
.section-heading p { margin: 8px 0 0; color: var(--muted); max-width: 680px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 22px; }
.card h3 { margin: 0 0 8px; }
.card p { color: var(--muted); }
.department-card { display: block; text-decoration: none; color: inherit; padding: 22px; min-height: 190px; position: relative; transition: transform .18s ease, box-shadow .18s ease; }
.department-card:hover { transform: translateY(-3px); box-shadow: 0 18px 45px rgba(13,39,62,.13); }
.department-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 900; background: #eaf2f8; color: var(--brand); margin-bottom: 20px; }
.person-card { overflow: hidden; }
.person-card-top { height: 72px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.person-card-body { padding: 0 20px 20px; }
.avatar { width: 78px; height: 78px; border-radius: 22px; object-fit: cover; background: #e8edf2; border: 5px solid #fff; margin-top: -39px; }
.person-card h3 { margin: 12px 0 3px; }
.person-meta { color: var(--muted); font-size: 14px; }
.person-actions { display: flex; gap: 8px; margin-top: 18px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; text-decoration: none; border-radius: 11px; padding: 10px 15px; font-weight: 750; font-size: 14px; }
.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover { color: #fff; background: var(--brand-dark); }
.button-accent { background: var(--accent); color: #1e2935; }
.button-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button-danger { background: #fff2f1; color: var(--danger); border-color: #efc5c2; }
.button-small { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; grid-template-columns: minmax(240px, 1fr) 220px auto; gap: 12px; margin-bottom: 24px; box-shadow: var(--shadow); }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 750; color: #364456; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #cbd4de; border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--ink); }
.field textarea { min-height: 120px; resize: vertical; }
.field small { color: var(--muted); }
.field-error input, .field-error select, .field-error textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 12px; font-weight: 650; }
.checkbox { display: flex; align-items: flex-start; gap: 9px; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.notice { border-radius: 12px; padding: 13px 16px; margin: 16px 0; border: 1px solid; }
.notice-success { background: #eef9f3; border-color: #bde1ce; color: #145a3b; }
.notice-error { background: #fff2f1; border-color: #efc5c2; color: #87322d; }
.notice-warning { background: #fff8e7; border-color: #ead7a3; color: #6d4e00; }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #eef2f6; color: #526071; }
.tag-success { background: #e8f7ef; color: #14623f; }
.tag-warning { background: #fff2cd; color: #765000; }
.tag-danger { background: #fdebea; color: #913d38; }
.empty-state { padding: 60px 22px; text-align: center; border: 1px dashed #bfcbd6; border-radius: 16px; background: rgba(255,255,255,.65); }
.public-footer { background: #0b2134; color: rgba(255,255,255,.76); padding: 46px 0 28px; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.public-footer a { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 30px; padding-top: 20px; font-size: 13px; }
.profile-shell { max-width: 940px; margin: -56px auto 0; position: relative; z-index: 2; }
.profile-banner { height: 180px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border-radius: 22px 22px 0 0; }
.profile-content { background: #fff; border-radius: 0 0 22px 22px; border: 1px solid var(--line); border-top: 0; padding: 0 34px 34px; box-shadow: var(--shadow); }
.profile-identity { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.profile-avatar { width: 132px; height: 132px; border: 8px solid #fff; border-radius: 30px; background: #e8edf2; margin-top: -66px; }
.profile-title { flex: 1; padding: 20px 0 0; }
.profile-title h1 { margin: 0; font-size: 34px; line-height: 1.1; }
.profile-title p { margin: 6px 0; color: var(--muted); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 18px; }
.profile-detail-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; margin-top: 30px; }
.detail-list { display: grid; gap: 12px; }
.detail-item { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.detail-item strong { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.qr-box { text-align: center; padding: 22px; }
.qr-box img { width: 190px; height: 190px; }
.contact-panel { margin-top: 24px; }
/* Admin */
.admin-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { background: #0b2134; color: #fff; padding: 20px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .brand-lockup { color: #fff; padding: 4px 8px 18px; }
.admin-sidebar .brand-text small { color: rgba(255,255,255,.55); }
.admin-nav { display: grid; gap: 3px; margin-top: 10px; }
.admin-nav .nav-label { color: rgba(255,255,255,.45); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; margin: 18px 10px 7px; }
.admin-nav a { color: rgba(255,255,255,.78); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 650; display: flex; justify-content: space-between; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-user { border-top: 1px solid rgba(255,255,255,.12); margin-top: 20px; padding: 18px 9px 0; }
.admin-user strong { display: block; }
.admin-user small { color: rgba(255,255,255,.6); }
.admin-main { min-width: 0; }
.admin-topbar { background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 12px 30px; position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.admin-topbar h1 { font-size: 19px; margin: 0; }
.admin-content { padding: 30px; max-width: 1540px; margin: 0 auto; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 19px; box-shadow: var(--shadow); }
.stat-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 6px; font-size: 30px; letter-spacing: -.04em; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 20px; margin-top: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 17px; }
.panel-body { padding: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; padding: 12px 14px; border-bottom: 1px solid var(--line); }
td { padding: 14px; border-bottom: 1px solid #edf0f3; vertical-align: middle; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.table-person { display: flex; align-items: center; gap: 10px; }
.table-avatar { width: 38px; height: 38px; border-radius: 11px; background: #e8edf2; }
.progress { height: 8px; background: #e8edf2; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.kpi-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kpi-row:last-child { border-bottom: 0; }
.admin-mobile-button { display: none; }
.org-chart { display: flex; flex-direction: column; align-items: center; gap: 28px; overflow-x: auto; padding: 20px 8px; }
.org-level { display: flex; justify-content: center; gap: 18px; min-width: max-content; }
.org-node { width: 210px; text-align: center; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 15px; box-shadow: var(--shadow); }
.org-node.vacant { border-style: dashed; background: #fafbfc; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: #fff; }
.login-visual { background: linear-gradient(145deg, var(--brand-dark), var(--brand)); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; }
.login-visual h1 { font-size: clamp(42px, 5vw, 70px); line-height: 1; margin: 18px 0; letter-spacing: -.04em; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(440px, 100%); }
.login-card h2 { font-size: 32px; margin-bottom: 8px; }
.login-card > p { color: var(--muted); margin-bottom: 28px; }
.login-card form { display: grid; gap: 17px; }
.demo-credentials { background: #f3f7fa; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 18px; font-size: 13px; }
@media (max-width: 1100px) {
  .grid-4, .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .hero-panel { max-width: 720px; }
}
@media (max-width: 860px) {
  .public-nav { display: none; position: absolute; top: 70px; left: 16px; right: 16px; background: #fff; padding: 12px; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); flex-direction: column; align-items: stretch; }
  .public-nav.open { display: flex; }
  .mobile-nav-button { display: inline-flex; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; left: -290px; z-index: 100; width: 270px; transition: left .2s ease; }
  .admin-sidebar.open { left: 0; }
  .admin-mobile-button { display: inline-flex; }
  .admin-content, .admin-topbar { padding-left: 18px; padding-right: 18px; }
  .profile-detail-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}
@media (max-width: 640px) {
  .container { width: min(100% - 22px, 1180px); }
  .hero { padding: 52px 0 60px; }
  .hero-search { flex-direction: column; }
  .grid-2, .grid-3, .grid-4, .stat-grid, .form-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .profile-shell { margin-top: -28px; }
  .profile-banner { height: 120px; }
  .profile-content { padding: 0 18px 24px; }
  .profile-identity { align-items: flex-start; flex-direction: column; }
  .profile-avatar { width: 104px; height: 104px; border-radius: 24px; margin-top: -52px; }
  .profile-title { padding-top: 0; }
  .profile-title h1 { font-size: 28px; }
  .admin-content { padding: 20px 12px; }
  .admin-topbar { padding: 10px 12px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
