:root {
  /* Executive One brand: charcoal-black wordmark + warm orange accent */
  --navy: #211c17;        /* charcoal "EXECUTIVE" black */
  --navy-2: #322a22;
  --gold: #e8821e;        /* "ONE" orange */
  --gold-soft: #f4a14e;
  --bg: #f7f5f1;
  --card: #ffffff;
  --text: #2a2620;
  --muted: #8a8377;
  --line: #ece8e1;
  --green: #1f9d62;
  --red: #d64545;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(33, 28, 23, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cdd6e8;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}
.brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--navy); font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.brand h1 { font-size: 15px; color: #fff; font-weight: 700; letter-spacing: .2px; }
.brand span { font-size: 11.5px; color: var(--gold-soft); }

.nav { padding: 14px 12px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; margin-bottom: 4px; border-radius: 10px;
  color: #aab6cf; font-weight: 500; transition: .15s;
}
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav a.active { background: rgba(201,162,39,0.16); color: #fff; }
.nav a.active .ico { color: var(--gold-soft); }

.sidebar .foot {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: #8593ad;
}
.sidebar .foot a { color: var(--gold-soft); }

.main { margin-left: 250px; flex: 1; padding: 26px 34px; width: calc(100% - 250px); }

/* ---------- Topbar ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar h2 { font-size: 22px; font-weight: 700; color: var(--navy); }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); padding: 7px 14px 7px 8px; border-radius: 30px; box-shadow: var(--shadow);
}
.user-chip .av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.user-chip .nm { font-weight: 600; font-size: 13px; }
.user-chip .rl { font-size: 11px; color: var(--muted); }

/* ---------- Cards / stats ---------- */
.grid { display: grid; gap: 18px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .val { font-size: 25px; font-weight: 800; color: var(--navy); margin-top: 8px; }
.stat .meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat.accent { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; }
.stat.accent .label { color: var(--gold-soft); }
.stat.accent .val { color: #fff; }
.stat.accent .meta { color: #b9c4dc; }
.stat .corner { position: absolute; right: -8px; top: -8px; font-size: 60px; opacity: .07; }
.val.pos { color: var(--green); }
.val.neg { color: var(--red); }

.panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-top: 18px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; color: var(--navy); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
     color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfe; }
.t-name { font-weight: 600; color: var(--navy); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.b-Active { background: #e3f4ec; color: var(--green); }
.b-Matured { background: #e8eefb; color: #3366cc; }
.b-Closed { background: #eceef3; color: #6b7a90; }
.b-Defaulted { background: #fbe7e7; color: var(--red); }
.b-Student { background: #fff3d6; color: #a37c0a; }
.b-Individual { background: #e8eefb; color: #3366cc; }
.b-Business { background: #e3f4ec; color: var(--green); }
.tag-income { color: var(--green); font-weight: 700; }
.tag-expense { color: var(--red); font-weight: 700; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: none; border-radius: 10px; padding: 10px 18px; font-size: 13.5px; font-weight: 600;
  background: var(--navy); color: #fff; transition: .15s;
}
.btn:hover { background: var(--navy-2); }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-soft)); color: var(--navy); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.ghost { background: #eef1f7; color: var(--navy); }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.danger { background: #fbe7e7; color: var(--red); }
.btn.danger:hover { background: #f6d6d6; }

input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.12); }
label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Drawer / modal ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.search { display: flex; gap: 10px; max-width: 360px; flex: 1; }
.filters { display: flex; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow);
        font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chip.active { background: var(--navy); color: #fff; }

dialog {
  border: none; border-radius: 16px; padding: 0; box-shadow: 0 20px 60px rgba(12,31,63,.3);
  width: 540px; max-width: 92vw;
}
dialog::backdrop { background: rgba(12,31,63,.45); backdrop-filter: blur(2px); }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { color: var(--navy); font-size: 17px; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x { cursor: pointer; font-size: 22px; color: var(--muted); background: none; border: none; }

/* ---------- Flash ---------- */
.flashes { margin-bottom: 16px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-size: 13.5px; font-weight: 500; }
.flash.success { background: #e3f4ec; color: var(--green); }
.flash.error { background: #fbe7e7; color: var(--red); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 40px; opacity: .5; margin-bottom: 10px; }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-row .lbl { width: 130px; font-size: 12.5px; color: var(--text); }
.bar-track { flex: 1; height: 9px; background: #eef1f7; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.bar-row .amt { width: 110px; text-align: right; font-size: 12.5px; font-weight: 600; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #081427 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 40px; width: 400px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card .logo { width: 52px; height: 52px; border-radius: 13px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft)); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; margin-bottom: 18px; }
.login-card h1 { font-size: 21px; color: var(--navy); }
.login-card p { color: var(--muted); font-size: 13px; margin: 4px 0 24px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }
