/* ============================================================
   Echo Security Group — Company / Admin Portal
   Brand identity: GOLD + DARK BLACK (luxury / premium security)
   Type: Inter, 12px base
   ============================================================ */
:root {
  /* Core brand */
  --black:      #0A0A0B;   /* deepest — sidebar, hero */
  --bg:         #0E0F11;   /* app / page background */
  --surface:    #17181C;   /* cards, topbar, table, drawer */
  --surface-2:  #202227;   /* inputs, hover, chips */
  --surface-3:  #2A2D33;   /* raised / active */
  --border:     #26282E;   /* hairline borders */
  --border-2:   rgba(255,255,255,.07);

  --gold:       #F5C63D;   /* primary accent */
  --gold-bright:#FFD866;
  --gold-deep:  #E0A81E;

  --red:        #E23A2E;   /* urgency / errors */
  --red-soft:   #F0685E;
  --green:      #35C07A;   /* success */
  --amber:      #F5B62E;

  /* Text */
  --text:       #F4F5F6;
  --text-2:     #C4C8CE;
  --muted:      #8A9099;
  --on-gold:    #0A0A0B;   /* text on gold */

  /* System */
  --radius:      14px;
  --radius-sm:   10px;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  --shadow-lg:   0 24px 60px rgba(0,0,0,.55);
  --gold-grad:   linear-gradient(135deg, #FFD866 0%, #F5C130 55%, #E5A413 100%);
  --sidebar-w:   264px;
  --topbar-h:    64px;
  --font:       'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head:  var(--font);
  --font-body:  var(--font);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 12px; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-family: var(--font); color: var(--text); font-weight: 700; line-height: 1.2; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-weight: 600; font-size: 12.5px;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold  { background: var(--gold-grad); color: var(--on-gold); }
.btn-gold:hover  { filter: brightness(1.06); }
.btn-navy  { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-navy:hover  { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: #E5484D; border: 1px solid #E5484D; }
.btn-danger:hover { background: rgba(229,72,77,.1); }
.btn-block { width: 100%; }

/* ============================================================
   LOGIN
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth__brand {
  position: relative; color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(circle at 78% 12%, rgba(245,198,61,.20), transparent 42%),
    radial-gradient(circle at 12% 92%, rgba(226,58,46,.14), transparent 45%),
    linear-gradient(160deg, #101012 0%, #0A0A0B 100%);
  overflow: hidden;
}
.auth__brand::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 72% 28%, #000, transparent 70%);
  pointer-events: none;
}
.auth__logo { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.auth__logo-img { width: 300px; max-width: 78%; height: auto; display: block; }
.auth__portal-tag { font-size: 11px; letter-spacing: 3px; color: var(--muted); font-weight: 600; }
.auth__pitch { position: relative; z-index: 1; max-width: 460px; }
.auth__pitch h1 { color: #fff; font-size: 32px; margin-bottom: 14px; }
.auth__pitch h1 .hl { color: var(--gold); }
.auth__pitch p { color: rgba(255,255,255,.62); font-size: 14px; }
.auth__values { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.auth__values span {
  font-family: var(--font); font-size: 10.5px; font-weight: 600; letter-spacing: 1.5px;
  padding: 6px 12px; border: 1px solid rgba(245,198,61,.35); border-radius: 40px; color: var(--gold);
}
.auth__foot { position: relative; z-index: 1; font-size: 11.5px; color: rgba(255,255,255,.4); }

.auth__panel { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.login-error {
  display: none; background: rgba(226,58,46,.12); color: var(--red-soft); border: 1px solid rgba(226,58,46,.35);
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 18px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.apply-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.checkbox-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.checkbox-group .checkbox-item {
  display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 500;
  color: var(--text-2); cursor: pointer; margin-bottom: 0;
}
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); flex: none; cursor: pointer; margin: 0; }
.checkbox-item span { flex: 1; }
.checkbox-item:hover span { color: var(--text); }
@media (max-width: 560px) { .checkbox-group { grid-template-columns: 1fr; } }
.field input {
  width: 100%; padding: 11px 13px; font-size: 13px; font-family: inherit; color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  transition: border .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field textarea {
  width: 100%; padding: 12px 14px; font-size: 14.5px; font-family: inherit; color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  resize: vertical; min-height: 70px;
}
.field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245,198,61,.14); }
.field input:focus {
  outline: none; border-color: var(--gold); background: #1a1c20;
  box-shadow: 0 0 0 4px rgba(245,198,61,.14);
}
.field-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 22px; }
.field-row label { display: flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; }
.field-row input[type=checkbox] { accent-color: var(--gold); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; margin: 20px 0; letter-spacing: 1px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.login-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 20px; }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--black); color: var(--text-2);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
}
.sidebar__logo {
  display: flex; align-items: center; gap: 12px; padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.sidebar__logo-img { width: 190px; max-width: 100%; height: auto; display: block; }

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav__label {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700;
  color: var(--muted); padding: 14px 12px 8px;
}
.nav__item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: 13px; margin-bottom: 2px;
  transition: background .15s, color .15s; position: relative;
}
.nav__item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav__item.active { background: rgba(245,198,61,.12); color: #fff; }
.nav__item.active .ico { color: var(--gold); }
.nav__item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  background: var(--gold); border-radius: 0 4px 4px 0;
}
.nav__item .ico { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.nav__item .badge { margin-left: auto; background: var(--gold); color: var(--on-gold); font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.nav__item .badge.alert { background: var(--red); color: #fff; }
.nav__soon { margin-left: auto; font-size: 9.5px; letter-spacing: .5px; color: var(--muted); border: 1px solid var(--border); padding: 1px 7px; border-radius: 20px; }

.sidebar__user {
  display: flex; align-items: center; gap: 11px; padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.sidebar__user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-grad); color: var(--on-gold); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.sidebar__user .meta { min-width: 0; flex: 1; }
.sidebar__user .meta b { color: #fff; font-size: 12.5px; display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user .meta span { font-size: 11px; color: var(--muted); }
.sidebar__user .signout-btn {
  flex: none; width: 30px; height: 30px; border-radius: 9px; border: none; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s;
}
.sidebar__user .signout-btn:hover { background: rgba(255,255,255,.06); color: var(--red-soft); }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar__toggle { display: none; background: none; border: none; color: var(--text-2); }
.topbar h1 { font-size: 17px; }
.topbar .crumb { color: var(--muted); font-size: 11.5px; }
.topbar__spacer { flex: 1; }
.search { position: relative; }
.search-results {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; width: 360px; max-width: 90vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  z-index: 30; max-height: 380px; overflow-y: auto;
}
.search-results.open { display: block; }
.search-results__group + .search-results__group { border-top: 1px solid var(--border); }
.search-results__label { font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 8px 14px 2px; }
.search-results__item { display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.search-results__item:hover { background: var(--surface-2); }
.search-results__item b { color: var(--text); font-weight: 600; }
.search-results__item span { color: var(--muted); font-size: 11.5px; }
.search-results__empty { padding: 16px 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.search {
  display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid transparent;
  border-radius: 10px; padding: 8px 13px; width: 280px; color: var(--muted);
}
.search:focus-within { border-color: var(--gold); }
.search input { border: none; background: none; outline: none; font-family: inherit; font-size: 13px; color: var(--text); width: 100%; }
.search input::placeholder { color: var(--muted); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-2); position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: #fff; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; border: 2px solid var(--surface); }
.topbar__avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-grad); color: var(--on-gold); display: grid; place-items: center; font-weight: 800; font-size: 13px; }

.content { padding: 26px; width: 100%; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 20px; margin-bottom: 4px; }
.page-head p { color: var(--muted); font-size: 13px; }

/* Stat cards */
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
}
.stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gold-grad); opacity: 0; transition: opacity .2s; }
.stat:hover::before { opacity: .9; }
.stat__ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat__ico.gold { background: rgba(245,198,61,.15); color: var(--gold); }
.stat__ico.blue { background: rgba(245,198,61,.10); color: var(--gold-bright); }
.stat__ico.navy { background: rgba(255,255,255,.06); color: var(--text); }
.stat__ico.green{ background: rgba(53,192,122,.14); color: var(--green); }
.stat__text { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.stat h3 { font-size: 20px; line-height: 1; white-space: nowrap; }
.stat p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Panels */
.grid-panels { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.grid-settings { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; align-items: start; margin-bottom: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card__head h3 { font-size: 15px; }
.card__head a { font-size: 12px; font-weight: 600; }
.card__body { padding: 6px 18px 14px; }

.activity { list-style: none; }
.activity li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.activity li:last-child { border-bottom: none; }
.activity .a-ico { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); }
.activity .a-body b { color: var(--text); font-weight: 600; font-size: 13px; }
.activity .a-body p { font-size: 12px; color: var(--muted); }
.activity .a-time { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

.quick { display: grid; gap: 9px; padding: 14px 18px 18px; }
.quick a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 13px; transition: .15s;
}
.quick a:hover { border-color: var(--gold); background: var(--surface-2); }
.quick a .q-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--gold-grad); color: var(--on-gold); flex: none; }
.quick a .arrow { margin-left: auto; color: var(--muted); }
.quick-soon {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 13px; opacity: .6;
}
.quick-soon .q-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.quick-soon .nav__soon { margin-left: auto; }

.badge-pill { font-size: 10.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-pill.green { background: rgba(53,192,122,.14); color: var(--green); }
.badge-pill.amber { background: rgba(245,182,46,.16); color: var(--amber); }

/* ---------- Status tabs ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; color: var(--muted); font-family: inherit; font-weight: 600; font-size: 13px;
  padding: 10px 4px; margin-right: 22px; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-count { font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); padding: 1px 8px; border-radius: 20px; }
.tab.active .tab-count { background: rgba(245,198,61,.16); color: var(--gold); }

/* ---------- Officers page ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { width: 320px; max-width: 100%; }
.toolbar .spacer { flex: 1; }
.filter {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  font-family: inherit; font-size: 12.5px; color: var(--text); cursor: pointer;
}
.filter:focus { outline: none; border-color: var(--gold); }
.count-note { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.roster { width: 100%; border-collapse: collapse; min-width: 820px; }
.roster thead th {
  text-align: left; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 13px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.roster thead th[data-sort] { cursor: pointer; user-select: none; transition: color .15s; }
.roster thead th[data-sort]:hover { color: var(--text); }
.roster thead th[data-sort] .sort-arrow { display: inline-block; margin-left: 4px; opacity: .35; font-size: 9px; }
.roster thead th[data-sort].sorted { color: var(--gold); }
.roster thead th[data-sort].sorted .sort-arrow { opacity: 1; }
.roster tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border-2); font-size: 12.5px; vertical-align: middle; color: var(--text-2); }
.roster tbody tr { cursor: pointer; transition: background .12s; }
.roster tbody tr:hover { background: var(--surface-2); }
.roster tbody tr:last-child td { border-bottom: none; }
.who { display: flex; align-items: center; gap: 12px; }
.who .avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--gold); font-weight: 700; font-size: 12px; }
.who b { color: var(--text); font-weight: 600; display: block; font-size: 13px; }
.who span { font-size: 11.5px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag.blue { background: rgba(245,198,61,.10); color: var(--gold-bright); }
.tag.gold { background: rgba(245,198,61,.16); color: var(--gold); }
.tag.green { background: rgba(53,192,122,.14); color: var(--green); }
.tag.grey { background: var(--surface-2); color: var(--muted); }
.officer-pill-wrap { display: flex; flex-wrap: wrap; gap: 6px; max-width: 420px; }
.lic-yes { color: var(--green); font-weight: 600; }
.lic-no { color: var(--muted); }
.empty-row td { text-align: center; color: var(--muted); padding: 40px !important; }

/* Detail drawer */
.drawer-back { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; }
.drawer-back.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 410px; max-width: 92vw; background: var(--surface); z-index: 70;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border);
}
.drawer.open { transform: translateX(0); }
.drawer__head { background: linear-gradient(180deg, #141519, #0f1013); color: #fff; padding: 22px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); }
.drawer__head .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--gold-grad); color: var(--on-gold); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; overflow: hidden; }
.avatar-wrap { position: relative; flex: none; }
.avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--black); border: 2px solid var(--surface); color: var(--gold);
  display: grid; place-items: center; cursor: pointer;
}
.avatar-edit-btn:hover { background: var(--surface-3); }
.drawer__head b { font-size: 17px; display: block; }
.drawer__head span { font-size: 12px; color: var(--gold); }
.drawer__close { margin-left: auto; background: rgba(255,255,255,.08); border: none; color: #fff; width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
.drawer__close:hover { background: rgba(255,255,255,.16); }
.drawer__body { padding: 6px 22px 26px; overflow-y: auto; }
.dl-group { padding: 14px 0; border-bottom: 1px solid var(--border-2); }
.dl-group h4 { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.dl-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 12.5px; }
.dl-row .k { color: var(--muted); flex: none; }
.dl-row .v { color: var(--text); font-weight: 500; text-align: right; word-break: break-word; }

/* ---------- Banners ---------- */
.banner-warn {
  display: none; align-items: center; gap: 10px; background: rgba(245,182,46,.10); color: var(--amber);
  border: 1px solid rgba(245,182,46,.3); padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 12px; margin-bottom: 16px; line-height: 1.4;
}
.banner-warn svg { flex: none; }
.banner-warn b { color: var(--gold); }
.content .banner-warn { margin-bottom: 20px; }

/* ---------- Photo avatar (image or initials fallback) ---------- */
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.who .avatar, .drawer__head .avatar { overflow: hidden; }

/* ---------- Toolbar actions ---------- */
.toolbar .btn { white-space: nowrap; }
.pending-btn { position: relative; }
.pending-btn .ping {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 10px;
  font-weight: 700; min-width: 18px; height: 18px; border-radius: 20px; display: grid; place-items: center; padding: 0 4px;
}

/* ---------- Modal ---------- */
.modal-back { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 80; align-items: center; justify-content: center; padding: 24px; }
.modal-back.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal--wide { max-width: 920px; height: 85vh; }
.modal--wide .modal__body { flex: 1; padding: 0; display: flex; }
.preview-frame { width: 100%; height: 100%; border: none; background: #fff; }
.preview-img-wrap { width: 100%; height: 100%; display: grid; place-items: center; background: var(--black); overflow: auto; padding: 16px; }
.preview-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-unsupported { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 13px; text-align: center; padding: 40px; }
.preview-unsupported svg { color: var(--gold); }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 16px; }
.modal__close { margin-left: auto; background: var(--surface-2); border: none; color: var(--text-2); width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
.modal__close:hover { background: var(--surface-3); color: #fff; }
.modal__body { padding: 18px 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 0; }

.apply-section { margin-bottom: 22px; }
.apply-section:last-child { margin-bottom: 0; }
.apply-section h3 { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }

/* ---------- Photo picker (modal) ---------- */
.photo-picker { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.photo-picker__preview {
  width: 76px; height: 76px; border-radius: 50%; background: var(--surface-2); border: 1px dashed var(--border);
  display: grid; place-items: center; color: var(--muted); overflow: hidden; flex: none;
}
.photo-picker__preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Dropzone (attachments / new-hire form) ---------- */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  padding: 22px; text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer; transition: border .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: rgba(245,198,61,.06); }
.dropzone b { color: var(--gold); font-weight: 600; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-chip {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 12px; font-size: 12.5px; color: var(--text-2);
}
.file-chip svg { flex: none; color: var(--gold); }
.file-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { background: none; border: none; color: var(--muted); font-size: 15px; padding: 0 2px; }
.file-chip button:hover { color: var(--red-soft); }
.file-chip__name { cursor: pointer; }
.file-chip__name:hover { color: var(--text); }
.officer-chip__info { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; min-width: 0; }
.officer-chip__info b { color: var(--text); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.officer-chip__role { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.officer-pick-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  border-bottom: 1px solid var(--border-2);
}
.officer-pick-item:last-child { border-bottom: none; }
.officer-pick-item:hover { background: var(--surface-2); }
.officer-pick-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); flex: none; cursor: pointer; }
.officer-pick-item__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.officer-pick-item__info b { font-size: 13.5px; color: var(--text); font-weight: 600; }
.officer-pick-item__role { font-size: 11.5px; color: var(--muted); }
.file-chip__dl { flex: none; color: var(--muted); display: grid; place-items: center; }
.file-chip__dl:hover { color: var(--gold); }

/* ---------- Pending applications list ---------- */
.pending-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface-2);
}
.pending-item .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); color: var(--gold); display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; }
.pending-item .info b { color: var(--text); display: block; font-size: 13px; }
.pending-item .info span { font-size: 11.5px; color: var(--muted); }
.pending-item .acts { margin-left: auto; display: flex; gap: 8px; }
.pending-item .acts .btn { padding: 7px 13px; font-size: 12px; }

/* ---------- Org chart ---------- */
.orgchart { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 0 28px; }
.orgchart__connector { width: 2px; height: 28px; background: var(--border); }
.orgchart__node {
  display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 26px; box-shadow: var(--shadow); box-sizing: border-box;
  width: 100%; height: 118px;
}
.orgchart__node.ceo { border-color: rgba(245,198,61,.4); width: auto; }
.orgchart__photo {
  width: 64px; height: 64px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center; border: 2px solid var(--gold);
}
.orgchart__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.orgchart__info b { display: block; font-size: 15px; color: var(--text); }
.orgchart__info .role { font-size: 12.5px; color: var(--gold); font-weight: 600; margin-top: 2px; }
.orgchart__info .region { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.orgchart__branches { display: flex; gap: 60px; align-items: flex-start; }
.orgchart__branch { display: flex; flex-direction: column; align-items: center; position: relative; padding-top: 28px; width: 340px; }
.orgchart__branch::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 28px;
  background: var(--border); transform: translateX(-50%);
}
.orgchart__branch::after { content: ""; position: absolute; top: 0; height: 2px; background: var(--border); }
.orgchart__branch:first-child::after { left: 50%; right: -30px; }
.orgchart__branch:last-child::after { right: 50%; left: -30px; }
@media (max-width: 720px) {
  .orgchart__branch::before, .orgchart__branch::after { display: none; }
}
.orgchart__sub {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 20px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin-top: 14px; min-width: 220px; justify-content: center;
}
.orgchart__sub svg { color: var(--gold); flex: none; }
.orgchart-chain { margin-top: 8px; }
.orgchart-chain__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.orgchart-chain__col { padding: 18px 24px; text-align: center; font-size: 13px; color: var(--text-2); }
.orgchart-chain__col + .orgchart-chain__col { border-left: 1px solid var(--border); }
.orgchart-chain__col h4 { color: var(--gold); font-size: 12px; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 10px; }
.orgchart-chain__col .flow { line-height: 1.9; }
.orgchart-chain__col .flow b { color: var(--text); }
.orgchart-tagline {
  margin-top: 20px; text-align: center; padding: 16px; border-radius: var(--radius-sm);
  background: var(--gold-grad); color: var(--on-gold); font-weight: 800; letter-spacing: .5px; font-size: 13px;
}
@media (max-width: 720px) {
  .orgchart__branches { flex-direction: column; gap: 28px; }
  .orgchart-chain__cols { grid-template-columns: 1fr; }
  .orgchart-chain__col + .orgchart-chain__col { border-left: none; border-top: 1px solid var(--border); }
}

/* Overlay for mobile sidebar */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) { .grid-stats { grid-template-columns: repeat(2,1fr); } .grid-panels { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid-settings { grid-template-columns: 1fr; } }
@media (max-width: 900px)  { .auth { grid-template-columns: 1fr; } .auth__brand { display: none; } }
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .overlay { display: block; }
  .topbar__toggle { display: grid; place-items: center; }
  .search { display: none; }
}
@media (max-width: 640px) { .toolbar .search { width: 100%; } }
@media (max-width: 560px) { .grid-stats { grid-template-columns: 1fr; } .content { padding: 18px; } }
