/* ============================================================
   Echo Security Group — Company / Admin Portal
   Brand tokens sourced from echosecuritygroup.com
   ============================================================ */
:root {
  /* Brand */
  --navy:      #1A2831;   /* primary dark / sidebar */
  --navy-2:    #192A3D;
  --navy-3:    #28404E;
  --steel:     #3A4F66;   /* body / UI text */
  --gold:      #FFB322;   /* primary CTA */
  --gold-600:  #E89E12;
  --blue:      #2872FA;   /* links / secondary accent */
  --blue-600:  #1F5FD6;

  /* Neutrals */
  --white:     #FFFFFF;
  --grey-50:   #F7F9FB;
  --grey-100:  #F1F4F7;
  --grey-200:  #E1E8ED;
  --grey-300:  #CBD5DE;
  --grey-500:  #69727D;
  --ink:       #1A2831;

  /* Feedback */
  --green:     #22A565;
  --amber:     #F5A623;
  --red:       #E5484D;

  /* System */
  --radius:      14px;
  --radius-sm:   10px;
  --shadow:      0 1px 2px rgba(26,40,49,.06), 0 8px 24px rgba(26,40,49,.06);
  --shadow-lg:   0 12px 40px rgba(26,40,49,.16);
  --sidebar-w:   264px;
  --topbar-h:    68px;
  --font-head:  "Montserrat", system-ui, sans-serif;
  --font-body:  "Poppins", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--steel);
  background: var(--grey-100);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4, h5 { font-family: var(--font-head); color: var(--ink); font-weight: 700; line-height: 1.2; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); }
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: 11px 20px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold  { background: var(--gold); color: var(--navy); }
.btn-gold:hover  { background: var(--gold-600); }
.btn-navy  { background: var(--navy); color: #fff; }
.btn-navy:hover  { background: var(--navy-3); }
.btn-ghost { background: transparent; color: var(--steel); border: 1px solid var(--grey-200); }
.btn-ghost:hover { background: var(--grey-100); }
.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:
    linear-gradient(150deg, rgba(26,40,49,.88), rgba(25,42,61,.92)),
    radial-gradient(circle at 80% 15%, rgba(255,179,34,.22), transparent 45%),
    radial-gradient(circle at 15% 90%, rgba(40,114,250,.22), transparent 45%),
    var(--navy);
  overflow: hidden;
}
.auth__brand::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
  pointer-events: none;
}
.auth__logo { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth__logo .mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--gold); color: var(--navy);
  font-family: var(--font-head); font-weight: 800; font-size: 22px;
}
.auth__logo b { font-family: var(--font-head); font-size: 18px; letter-spacing: .3px; }
.auth__logo span { display: block; font-size: 11px; letter-spacing: 3px; color: var(--gold); font-weight: 600; }
.auth__pitch { position: relative; z-index: 1; max-width: 440px; }
.auth__pitch h1 { color: #fff; font-size: 38px; margin-bottom: 16px; }
.auth__pitch p { color: rgba(255,255,255,.75); font-size: 16px; }
.auth__values { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.auth__values span {
  font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  padding: 7px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 40px; color: rgba(255,255,255,.85);
}
.auth__foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255,255,255,.55); }

.auth__panel { display: grid; place-items: center; padding: 40px; background: var(--white); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--grey-500); margin-bottom: 30px; font-size: 14.5px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 14.5px; font-family: inherit; color: var(--ink);
  border: 1.5px solid var(--grey-200); border-radius: var(--radius-sm); background: var(--grey-50);
  transition: border .15s, box-shadow .15s, background .15s;
}
.field input:focus {
  outline: none; border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 4px rgba(40,114,250,.12);
}
.field-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 24px; }
.field-row label { display: flex; align-items: center; gap: 7px; color: var(--steel); cursor: pointer; }
.login-error {
  display: none; background: rgba(229,72,77,.1); color: #C0393E; border: 1px solid rgba(229,72,77,.3);
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px;
}
.divider { display: flex; align-items: center; gap: 12px; color: var(--grey-500); font-size: 12px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--grey-200); flex: 1; }
.login-foot { text-align: center; font-size: 13.5px; color: var(--grey-500); margin-top: 20px; }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--navy); color: rgba(255,255,255,.7);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__logo {
  display: flex; align-items: center; gap: 12px; padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__logo .mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--gold); color: var(--navy); font-family: var(--font-head); font-weight: 800; font-size: 18px;
}
.sidebar__logo b { color: #fff; font-family: var(--font-head); font-size: 15px; display: block; }
.sidebar__logo small { font-size: 10px; letter-spacing: 2px; color: var(--gold); }

.nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav__label {
  font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700;
  color: rgba(255,255,255,.35); padding: 16px 12px 8px;
}
.nav__item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  color: rgba(255,255,255,.72); font-weight: 500; font-size: 14px; margin-bottom: 2px;
  transition: background .15s, color .15s; position: relative;
}
.nav__item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav__item.active { background: rgba(255,179,34,.12); color: #fff; }
.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: 20px; height: 20px; flex: none; stroke: currentColor; }
.nav__item .badge { margin-left: auto; background: var(--blue); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; }
.nav__soon { margin-left: auto; font-size: 10px; letter-spacing: .5px; color: rgba(255,255,255,.35); border: 1px solid rgba(255,255,255,.15); padding: 1px 7px; border-radius: 20px; }

.sidebar__user {
  display: flex; align-items: center; gap: 11px; padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar__user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--steel); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 14px; flex: none; }
.sidebar__user .meta b { color: #fff; font-size: 13.5px; display: block; font-family: var(--font-body); font-weight: 600; }
.sidebar__user .meta span { font-size: 11.5px; color: rgba(255,255,255,.5); }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--grey-200);
  display: flex; align-items: center; gap: 18px; padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar__toggle { display: none; background: none; border: none; color: var(--steel); }
.topbar h1 { font-size: 19px; }
.topbar .crumb { color: var(--grey-500); font-size: 13px; }
.topbar__spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 9px; background: var(--grey-100); border: 1px solid transparent;
  border-radius: 10px; padding: 8px 13px; width: 280px; color: var(--grey-500);
}
.search:focus-within { border-color: var(--blue); background: #fff; }
.search input { border: none; background: none; outline: none; font-family: inherit; font-size: 14px; color: var(--ink); width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--grey-200); background: #fff;
  display: grid; place-items: center; color: var(--steel); position: relative;
}
.icon-btn:hover { background: var(--grey-100); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; border: 2px solid #fff; }
.topbar__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 15px; }

.content { padding: 28px; max-width: 1320px; width: 100%; }
.page-head { margin-bottom: 24px; }
.page-head h2 { font-size: 24px; margin-bottom: 4px; }
.page-head p { color: var(--grey-500); font-size: 14.5px; }

/* Stat cards */
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat {
  background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat__ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.stat__ico.gold { background: rgba(255,179,34,.15); color: var(--gold-600); }
.stat__ico.blue { background: rgba(40,114,250,.12); color: var(--blue); }
.stat__ico.navy { background: rgba(26,40,49,.08); color: var(--navy); }
.stat__ico.green{ background: rgba(34,165,101,.12); color: var(--green); }
.stat__trend { font-size: 12.5px; font-weight: 600; }
.stat__trend.up { color: var(--green); }
.stat__trend.down { color: var(--red); }
.stat h3 { font-size: 30px; margin-bottom: 2px; }
.stat p { font-size: 13px; color: var(--grey-500); }

/* Panels */
.grid-panels { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.card {
  background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--grey-200); }
.card__head h3 { font-size: 16px; }
.card__head a { font-size: 13px; font-weight: 600; }
.card__body { padding: 8px 20px 16px; }

.activity { list-style: none; }
.activity li { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--grey-100); }
.activity li:last-child { border-bottom: none; }
.activity .a-ico { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--grey-100); color: var(--steel); }
.activity .a-body b { color: var(--ink); font-weight: 600; font-size: 14px; }
.activity .a-body p { font-size: 13px; color: var(--grey-500); }
.activity .a-time { margin-left: auto; font-size: 12px; color: var(--grey-300); white-space: nowrap; }

.quick { display: grid; gap: 10px; padding: 16px 20px 20px; }
.quick a {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 10px;
  border: 1px solid var(--grey-200); color: var(--ink); font-weight: 600; font-size: 14px; transition: .15s;
}
.quick a:hover { border-color: var(--blue); background: var(--grey-50); }
.quick a .q-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--navy); color: var(--gold); flex: none; }
.quick a .arrow { margin-left: auto; color: var(--grey-300); }

.badge-pill { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-pill.green { background: rgba(34,165,101,.12); color: var(--green); }
.badge-pill.amber { background: rgba(245,166,35,.15); color: var(--amber); }

/* ---------- Officers page ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .search { width: 320px; max-width: 100%; }
.toolbar .spacer { flex: 1; }
.filter {
  padding: 9px 13px; border: 1px solid var(--grey-200); border-radius: 10px; background: #fff;
  font-family: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.filter:focus { outline: none; border-color: var(--blue); }
.count-note { font-size: 13px; color: var(--grey-500); margin-bottom: 14px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--grey-200); 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-family: var(--font-head); font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--grey-500); font-weight: 700; padding: 14px 16px; border-bottom: 1px solid var(--grey-200); white-space: nowrap;
}
.roster tbody td { padding: 13px 16px; border-bottom: 1px solid var(--grey-100); font-size: 14px; vertical-align: middle; }
.roster tbody tr { cursor: pointer; transition: background .12s; }
.roster tbody tr:hover { background: var(--grey-50); }
.roster tbody tr:last-child td { border-bottom: none; }
.who { display: flex; align-items: center; gap: 12px; }
.who .avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 13px; }
.who b { color: var(--ink); font-weight: 600; display: block; }
.who span { font-size: 12px; color: var(--grey-500); }
.tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--grey-100); color: var(--steel); white-space: nowrap; }
.tag.blue { background: rgba(40,114,250,.1); color: var(--blue); }
.tag.gold { background: rgba(255,179,34,.16); color: var(--gold-600); }
.tag.green { background: rgba(34,165,101,.12); color: var(--green); }
.tag.grey { background: var(--grey-100); color: var(--grey-500); }
.lic-yes { color: var(--green); font-weight: 600; }
.lic-no { color: var(--grey-500); }
.empty-row td { text-align: center; color: var(--grey-500); padding: 40px !important; }

/* Detail drawer */
.drawer-back { display: none; position: fixed; inset: 0; background: rgba(26,40,49,.45); z-index: 60; }
.drawer-back.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw; background: #fff; z-index: 70;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer__head { background: var(--navy); color: #fff; padding: 24px; display: flex; align-items: center; gap: 15px; }
.drawer__head .avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 20px; flex: none; }
.drawer__head b { font-family: var(--font-head); font-size: 18px; display: block; }
.drawer__head span { font-size: 13px; color: rgba(255,255,255,.7); }
.drawer__close { margin-left: auto; background: rgba(255,255,255,.12); border: none; color: #fff; width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
.drawer__close:hover { background: rgba(255,255,255,.22); }
.drawer__body { padding: 8px 24px 28px; overflow-y: auto; }
.dl-group { padding: 16px 0; border-bottom: 1px solid var(--grey-100); }
.dl-group h4 { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--grey-500); margin-bottom: 12px; }
.dl-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 14px; }
.dl-row .k { color: var(--grey-500); flex: none; }
.dl-row .v { color: var(--ink); font-weight: 500; text-align: right; word-break: break-word; }
.dl-row .v a { font-weight: 500; }

@media (max-width: 640px) { .toolbar .search { width: 100%; } }

/* Overlay for mobile sidebar */
.overlay { display: none; position: fixed; inset: 0; background: rgba(26,40,49,.5); 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)  { .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: 560px) { .grid-stats { grid-template-columns: 1fr; } .content { padding: 18px; } }
