:root {
  --night: #00343A;
  --night-2: #0A4A52;
  --ink: #002529;
  --muted: #55706F;
  --bone: #F5F7F6;
  --card: #FFFFFF;
  --line: #D9E3E1;
  --mint: #35C9AE;
  --mint-deep: #0A6B61;
  --amber: #B7791F;
  --amber-bg: #FBF3E2;
  --blue: #1E6FA8;
  --blue-bg: #E9F3FA;
  --green: #1E7A54;
  --green-bg: #E7F5EE;
  --red: #A33A2A;
  --red-bg: #FBEDEA;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 Arial, Helvetica, sans-serif; background: var(--bone); color: var(--ink); }
a { color: var(--mint-deep); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
p { margin: 0 0 12px; }
small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--night); color: #EDF5F4; display: flex; flex-direction: column; padding: 22px 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; margin-bottom: 28px; }
.brand__seal { width: 36px; height: 36px; border: 1px solid var(--mint); color: var(--mint); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.brand__text { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand__text small { color: #8FB5B8; }
.nav { display: grid; gap: 4px; }
.nav a { color: #CFE2E1; text-decoration: none; padding: 9px 11px; border-radius: 8px; font-size: 14px; }
.nav a:hover { background: var(--night-2); color: #fff; }
.nav a.is-on { background: var(--night-2); color: #fff; box-shadow: inset 2px 0 0 var(--mint); }
.side__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; font-size: 13px; }
.side__foot p { margin: 0 0 6px; }
.side__foot small { color: #8FB5B8; }
.linkbtn { background: none; border: 0; color: var(--mint); padding: 0; font: inherit; cursor: pointer; }
.main { padding: 30px 36px 52px; min-width: 0; }

/* Auth */
body.auth { display: grid; place-items: center; min-height: 100vh; background: var(--night); padding: 20px; }
.authcard { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 30px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.authcard .brand { color: var(--ink); margin-bottom: 20px; }
.authcard .brand__text small { color: var(--muted); }
.authcard h1 { font-size: 25px; margin-bottom: 6px; }
.authcard .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.authcard .foot { font-size: 12px; color: var(--muted); margin-top: 16px; }
.authcard .brand__seal { color: var(--mint-deep); border-color: var(--mint-deep); }

/* Flash */
.flash { padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash--ok { background: var(--green-bg); border-color: #B9DFCC; color: var(--green); }
.flash--err { background: var(--red-bg); border-color: #EBC7C0; color: var(--red); }

/* Page head */
.head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 22px; }
.head .sub { color: var(--muted); margin: 4px 0 0; font-size: 13px; }

/* Cards and stats */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 28px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat--pending { border-top: 3px solid var(--amber); }
.stat--ongoing { border-top: 3px solid var(--blue); }
.stat--approved { border-top: 3px solid var(--green); }
.stat--failed { border-top: 3px solid var(--red); }

/* Table */
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { background: #EFF4F3; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAFCFC; }
.name { font-weight: 700; }
.mono { font-family: Consolas, monospace; font-size: 13px; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge--pending { background: var(--amber-bg); color: var(--amber); }
.badge--ongoing { background: var(--blue-bg); color: var(--blue); }
.badge--approved { background: var(--green-bg); color: var(--green); }
.badge--failed { background: var(--red-bg); color: var(--red); }

/* Forms */
.form { display: grid; gap: 14px; max-width: 640px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-size: 13px; font-weight: 700; display: grid; gap: 5px; }
input, select, textarea { width: 100%; border: 1px solid #A9BCBA; border-radius: 8px; padding: 9px 11px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); outline-offset: 1px; border-color: var(--mint); }
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
.btn { display: inline-block; border: 1px solid var(--night); background: var(--night); color: #fff; border-radius: 8px; padding: 9px 15px; font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--night-2); }
.btn--mint { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.btn--mint:hover { background: #2AB89E; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--danger { background: var(--red); border-color: var(--red); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.inline { display: inline-flex; gap: 8px; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { text-decoration: none; font-size: 12px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); }
.filters a.is-on { background: var(--night); color: #fff; border-color: var(--night); }
.search { display: flex; gap: 8px; margin-bottom: 14px; max-width: 460px; }

/* Detail */
.detail { display: grid; grid-template-columns: 1.4fr .9fr; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline li { border-left: 2px solid var(--line); padding-left: 12px; font-size: 13px; }
.timeline b { display: block; }

/* Agent board */
.board { display: grid; gap: 10px; }
.rowcard { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.rowcard .when { color: var(--muted); font-size: 13px; min-width: 150px; text-align: right; }
.rowcard.is-new { animation: ping 1.4s ease; }
@keyframes ping { 0% { background: #DFF6EF; } 100% { background: #fff; } }
.empty { padding: 34px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px; }
  .brand { margin: 0; }
  .nav { display: flex; flex-wrap: wrap; }
  .side__foot { margin: 0 0 0 auto; border: 0; padding: 0; text-align: right; }
  .main { padding: 20px; }
  .detail, .grid2, .stats { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .rowcard { grid-template-columns: 1fr auto; }
  .rowcard .when { grid-column: 1 / -1; text-align: left; }
}
.rowcard .badge { justify-self: start; }

/* Engagement */
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mint-deep); margin: 0 0 8px; }
.grid3 { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; align-items: stretch; }
.targetcard { display: flex; gap: 18px; align-items: center; }
.ring { --p: 0; width: 118px; height: 118px; border-radius: 50%; flex: 0 0 118px; display: grid; place-items: center; background: conic-gradient(var(--mint) calc(var(--p) * 1%), #E4EEEC 0); }
.ring__inner { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.ring__inner b { font-size: 25px; line-height: 1; }
.ring__inner span { font-size: 11px; color: var(--muted); }
.targetcard__text h2 { font-size: 17px; margin-bottom: 6px; }
.salaryrows { display: grid; gap: 6px; }
.salaryrows > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.salaryrows span small { display: block; color: var(--muted); font-size: 11px; }
.salaryrows .pos b { color: var(--green); }
.salaryrows .neg b { color: var(--red); }
.net { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-top: 10px; }
.net b { font-size: 22px; }
.leaders { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.leaders li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 5px 0; }
.leaders li.me { background: #EAF6F3; border-radius: 7px; padding-inline: 6px; }
.rank { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #EDF2F1; font-size: 11px; font-weight: 700; color: var(--muted); }
.rank--1 { background: #F6E7B8; color: #7A5A00; }
.rank--2 { background: #E5E9EA; color: #4C6165; }
.rank--3 { background: #F3DFCC; color: #8A4B1A; }
.leaders__n { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .grid3 { grid-template-columns: 1fr 1fr; } .targetcard { grid-column: 1 / -1; } }
@media (max-width: 700px) { .grid3 { grid-template-columns: 1fr; } }
.pos { color: var(--green); }
.neg { color: var(--red); }
.salaryrows > div .linkbtn { font-size: 11px; }

/* Zones */
.zone--red { --zone: var(--red); }
.zone--yellow { --zone: #D19A18; }
.zone--green { --zone: var(--green); }
.ring { background: conic-gradient(var(--zone, var(--mint)) calc(var(--p) * 1%), #E4EEEC 0); }
.targetcard.zone--red { box-shadow: inset 0 0 0 1px #EBC7C0; }
.targetcard.zone--yellow { box-shadow: inset 0 0 0 1px #EAD9A9; }
.targetcard.zone--green { box-shadow: inset 0 0 0 1px #B9DFCC; }
.zonebar-card { padding: 14px 18px; }
.zonebar { position: relative; display: grid; grid-template-columns: 15fr 15fr 2fr; gap: 4px; height: 12px; }
.zonebar span { border-radius: 99px; }
.zonebar .zr { background: #E8A79B; }
.zonebar .zy { background: #E7C878; }
.zonebar .zg { background: #85C9A8; }
.zonebar i { position: absolute; top: -4px; width: 3px; height: 20px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); }
.zonelegend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 7px; }
.zone-dot { font-weight: 700; }
.zone-dot--red { color: var(--red); }
.zone-dot--yellow { color: #A87908; }
.zone-dot--green { color: var(--green); }
a.rowcard { text-decoration: none; color: var(--ink); }
a.rowcard:hover { border-color: var(--mint); }
.badge--sent { background: #EFE9F8; color: #5B3E8E; }
.rowcard--agent { grid-template-columns: 1fr auto; }
