/* =============================================================
   Tax Appeal Commission — Admin console theme
   ============================================================= */

:root {
  --side-w: 250px;
  --navy-900: #0c2442;
  --navy-800: #12335c;
  --navy-700: #1a3f6e;
  --navy-100: #e6eefb;
  --gold: #e8a33d;
  /* Used by .card-head i / .sic.gold / .link:hover, which previously resolved
     to nothing here: --gold-dark was only defined in the public site.css. */
  --gold-dark: #c98620;
  --ink: #16283f;
  --body: #52607a;
  --light: #f4f7fb;
  --line: #e3e9f2;
  --font: "Noto Sans Ethiopic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--light); line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

.admin-app { display: flex; min-height: 100vh; }

/* ------------------------------ Sidebar ------------------------------ */
.sidebar {
  width: var(--side-w); flex: none;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #c6d4ea; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.side-logo {
  width: 42px; height: 42px; flex: none; border-radius: 12px; object-fit: cover; padding: 2px;
  background: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold), 0 3px 10px rgba(9,30,60,.35);
}
.sidebar-brand strong { color: #fff; font-size: .95rem; line-height: 1.2; }
.sidebar-brand span { font-size: .68rem; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }

.side-nav { padding: 14px 12px; overflow: auto; flex: 1; }
.side-nav .nav-h { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #7f93b5; padding: 12px 10px 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 10px; color: #c6d4ea; font-size: .9rem; margin-bottom: 3px; font-weight: 500;
}
.side-nav a i { font-size: 1.05rem; width: 20px; text-align: center; color: #8fa3c6; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.active { background: var(--gold); color: var(--navy-900); font-weight: 700; }
.side-nav a.active i { color: var(--navy-900); }
.side-nav .badge { margin-left: auto; }

.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.09); font-size: .78rem; color: #7f93b5; }

/* ------------------------------ Main ------------------------------ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tophead {
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 26px;
  min-height: 64px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 800;
}
.tophead h1 { font-size: 1.05rem; margin: 0; }
.tophead .spacer { flex: 1; }
.tophead .user-chip {
  display: flex; align-items: center; gap: 10px; background: var(--light);
  padding: 6px 14px 6px 8px; border-radius: 100px; border: 1px solid var(--line);
}
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-700); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-chip b { font-size: .85rem; color: var(--navy-800); display: block; line-height: 1.2; }
.user-chip span { font-size: .72rem; color: var(--body); }

.content { padding: 26px; }
.page-title { font-size: 1.35rem; margin: 0 0 20px; }

/* ------------------------------ Cards ------------------------------ */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(18,51,92,.06);
}
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head i { color: var(--gold-dark); }
.card-body { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  display: flex; gap: 16px; align-items: center; box-shadow: 0 4px 14px rgba(18,51,92,.06);
}
.stat-card .sic { width: 52px; height: 52px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex: none; }
.sic.navy { background: var(--navy-100); color: var(--navy-800); }
.sic.gold { background: #fdf0da; color: var(--gold-dark); }
.sic.green { background: #e3f6ea; color: #1c7c45; }
.sic.red { background: #fdecec; color: #c0392b; }
.stat-card strong { font-size: 1.6rem; display: block; line-height: 1.2; color: var(--navy-900); }
.stat-card span { font-size: .82rem; color: var(--body); }

/* ------------------------------ Buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; border-radius: 10px; padding: 9px 16px; font-size: .88rem;
  transition: .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-900); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy-900); }
.btn-gold:hover { background: #d6922b; color: var(--navy-900); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a83227; color: #fff; }
.btn-outline { background: #fff; color: var(--navy-800); border: 1px solid var(--line); }
.btn-outline:hover { border-color: var(--navy-700); color: var(--navy-800); }
.btn-sm { padding: 6px 11px; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ------------------------------ Forms ------------------------------ */
.form-card { max-width: 760px; }
.form-label { font-size: .84rem; font-weight: 600; color: var(--navy-800); margin-bottom: 6px; display: block; }
.form-control, .form-select, .form-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px;
  font: inherit; color: var(--ink); background: #fbfcfe; transition: .15s;
}
.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(18,51,92,.1); background: #fff;
}
/* Locked fields must not look editable: no focus ring, muted, no caret. */
.form-control[readonly], .form-textarea[readonly] {
  background: #eef2f7; color: var(--body); cursor: not-allowed;
  border-style: dashed;
}
.form-control[readonly]:focus, .form-textarea[readonly]:focus {
  outline: none; border-color: var(--line); box-shadow: none; background: #eef2f7;
}
.form-textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { margin-top: 20px; display: flex; gap: 12px; align-items: center; }

/* ------------------------------ Tables ------------------------------ */
.table-wrap { overflow-x: auto; }
table.dataTable { width: 100% !important; border-collapse: collapse; }
table.dataTable th, table.dataTable td { white-space: nowrap; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { background: var(--light); color: var(--navy-800); font-weight: 700; text-align: left; padding: 12px 14px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: #f7fafd; }
.dataTables_wrapper .dataTables_filter input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.dataTables_wrapper .dataTables_length select { border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.dataTables_wrapper .dataTables_paginate .paginate_button { border: 1px solid var(--line) !important; border-radius: 8px !important; padding: 4px 10px !important; margin: 0 2px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--navy-800) !important; color: #fff !important; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 100px; font-size: .74rem; font-weight: 700;
}
.chip.on { background: #e3f6ea; color: #1c7c45; }
.chip.close { background: #fdecec; color: #c0392b; }
.chip.unread { background: #fdf0da; color: #a06911; }

/* ------------------------------ Alerts / flash ------------------------------ */
.alert { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 13px 16px; margin-bottom: 18px; font-size: .92rem; }
.alert-success { background: #e9f9ef; color: #1c6b43; border: 1px solid #bfe9cf; }
.alert-danger { background: #fdecec; color: #9c2b2b; border: 1px solid #f5c6c6; }

/* ------------------------------ Login ------------------------------ */
.login-body {
  margin: 0; min-height: 100vh; background: var(--light);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* Two-column shell: context on the left, credentials on the right. */
.login-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}

/* ---- Brand panel ---- */
.login-aside {
  position: relative; overflow: hidden; color: #dce7f7;
  background: linear-gradient(155deg, var(--navy-800) 0%, var(--navy-900) 55%, #081a30 100%);
  display: flex; align-items: center;
}
/* Soft light sources, so the panel is not a flat block of navy. */
.login-aside::before, .login-aside::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.login-aside::before {
  width: 460px; height: 460px; top: -140px; right: -120px;
  background: radial-gradient(circle, rgba(232,163,61,.20), transparent 62%);
}
.login-aside::after {
  width: 520px; height: 520px; bottom: -220px; left: -140px;
  background: radial-gradient(circle, rgba(255,255,255,.07), transparent 65%);
}
.login-aside-inner { position: relative; z-index: 1; padding: 56px 60px; max-width: 560px; }
.login-mark { width: 74px; height: 80px; object-fit: contain; margin-bottom: 28px; }
.login-org {
  font-size: 1.5rem; font-weight: 700; line-height: 1.35; color: #fff;
  margin: 0 0 10px; letter-spacing: -.01em;
}
.login-tagline {
  font-size: 1rem; color: #a9bed9; margin: 0 0 34px; line-height: 1.6;
}
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.login-points li {
  display: flex; align-items: center; gap: 12px;
  font-size: .93rem; color: #c2d3ea;
}
.login-points i {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.10);
  color: var(--gold); font-size: 1rem;
}

/* ---- Form panel ---- */
.login-main {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px; background: #fff;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(12,36,66,.10);
  padding: 40px 36px 32px;
}
.login-head { text-align: center; margin-bottom: 28px; }
.login-head-mark { width: 46px; height: 50px; object-fit: contain; margin-bottom: 14px; }
.login-card h1 { font-size: 1.32rem; margin: 0 0 6px; color: var(--navy-900); letter-spacing: -.01em; }
.login-card .sub { color: var(--body); font-size: .9rem; margin: 0; line-height: 1.55; }

.login-field { margin-bottom: 18px; }
.login-field .form-label { margin-bottom: 7px; }

/* Inputs with a leading icon, so the fields read as a set. */
.input-icon { position: relative; display: block; }
.input-icon-lead {
  position: absolute; top: 50%; transform: translateY(-50%); left: 13px;
  color: var(--body); font-size: 1rem; pointer-events: none; transition: .15s;
}
.form-control.has-lead { padding-left: 40px; }
/* Highlight the icon when its field has focus. */
.input-icon:focus-within .input-icon-lead { color: var(--navy-700); }

/* Password field with a show/hide toggle. The input keeps the normal control
   padding, the button is layered over the right edge, so no layout shift. */
.form-control.has-trail { padding-right: 44px; }
.pwd-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--body); font-size: 1.05rem;
  cursor: pointer; transition: .15s;
}
.pwd-toggle:hover { background: var(--navy-100); color: var(--navy-800); }
/* Keep the focus ring on the input itself, not on the overlay button, so the
   tab order and the visible focus indicator stay where the user expects. */
.pwd-toggle:focus { outline: none; }
.pwd-toggle:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 1px; }

.login-submit { padding: 13px; font-size: .95rem; margin-top: 8px; }

.login-foot { text-align: center; margin: 24px 0 0; }
.login-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .87rem; color: var(--body); transition: .15s;
}
.login-back:hover { color: var(--navy-800); }

/* ---- Responsive: the brand panel is the first thing to go. ---- */
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { min-height: 100vh; background: var(--light); }
  .login-card { box-shadow: 0 12px 30px rgba(12,36,66,.08); }
}
@media (max-width: 420px) {
  .login-main { padding: 28px 18px; }
  .login-card { padding: 30px 22px 24px; }
}

/* ------------------------------ Dashboard ------------------------------ */
.welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  color: #eaf1fc; border-radius: 16px; padding: 26px 30px; margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(12, 36, 66, .25);
  position: relative; overflow: hidden;
}
.welcome::before {
  content: ""; position: absolute; left: -40px; bottom: -110px; width: 230px; height: 230px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .07), transparent 65%);
}
.welcome::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 163, 61, .30), transparent 65%);
}
.welcome > div { position: relative; z-index: 1; }
.w-kicker { margin: 0 0 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 700; }
.welcome h2 { margin: 0 0 6px; font-size: 1.5rem; color: #fff; }
.w-sub { margin: 0; font-size: .88rem; color: #c3d2e8; }
.w-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-light { background: #fff; color: var(--navy-800); }
.btn-light:hover { background: #f0f4fa; color: var(--navy-900); }
.w-right { display: flex; gap: 12px; flex-wrap: wrap; }
.w-chip {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 14px; padding: 12px 18px; min-width: 112px; text-align: center;
}
.w-chip strong { display: block; font-size: 1.45rem; color: #fff; line-height: 1.1; }
.w-chip span { font-size: .72rem; color: #c3d2e8; }

.stat-card { position: relative; transition: .18s; }
.stat-card:hover { transform: translateY(-2px); border-color: #cdd9ea; box-shadow: 0 12px 26px rgba(18, 51, 92, .12); }
.stat-card .sic { box-shadow: inset 0 0 0 1px rgba(18, 51, 92, .05); }
.stat-card .stat-trend { font-size: .76rem; color: var(--body); margin-top: 3px; display: block; }

.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .quick-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
.qc-tile {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: 0 4px 14px rgba(18, 51, 92, .06); transition: .18s;
}
.qc-tile:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 12px 26px rgba(18, 51, 92, .12); }
.qc-tile .qc-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex: none; }
.qc-tile b { color: var(--navy-900); font-size: .92rem; line-height: 1.3; }
.qc-tile span { font-size: .72rem; color: var(--body); }

.q-list { display: flex; flex-direction: column; }
.q-item { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: 0; padding-bottom: 0; }
.q-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: .85rem;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
}
.q-item .q-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.q-item b { font-size: .86rem; color: var(--navy-800); }
.q-item time { font-size: .72rem; color: var(--body); }
.q-item p { margin: 0; font-size: .84rem; color: var(--body); }
.q-item .chip { margin-left: auto; }

/* misc */
.link { color: var(--navy-800); font-weight: 600; }
.link:hover { color: var(--gold-dark); }
.muted { color: var(--body); font-size: .85rem; }
.mt-3 { margin-top: 16px; }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .sidebar { position: fixed; left: -260px; z-index: 990; transition: left .25s; } .sidebar.open { left: 0; } .sidebar-backdrop { position: fixed; inset: 0; background: rgba(9,30,60,.5); z-index: 980; } }
/* Password strength meter + policy hints (changepwd.php) */
.pw-meter { display: flex; gap: 5px; margin-top: 8px; }
.pw-meter span {
  flex: 1; height: 5px; border-radius: 3px; background: var(--line);
  transition: background .18s ease;
}
.pw-meter span.on.s1 { background: #d64545; }
.pw-meter span.on.s2 { background: #e08b2f; }
.pw-meter span.on.s3 { background: #d4b106; }
.pw-meter span.on.s4 { background: #2e9e5b; }

.form-hint { font-size: .78rem; color: var(--body); min-height: 1.1em; }
.form-hint.lvl-1 { color: #d64545; }
.form-hint.lvl-2 { color: #e08b2f; }
.form-hint.lvl-3 { color: #a16207; }
.form-hint.lvl-4 { color: #2e9e5b; }
.form-hint.ok  { color: #2e9e5b; }
.form-hint.bad { color: #d64545; }
