:root {
  --bg: #070b16;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.03);
  --panel-strong: #10182b;
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef2fb;
  --muted: #93a0bd;
  --brand: #e9b64d;
  --brand-2: #f7d47a;
  --brand-3: #38bdf8;
  --green: #39d98a;
  --red: #ff6b7d;
  --amber: #f5a623;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 88% -6%, rgba(233, 182, 77, 0.16), transparent 60%),
    radial-gradient(820px 560px at 6% 4%, rgba(56, 189, 248, 0.12), transparent 58%),
    radial-gradient(700px 520px at 50% 118%, rgba(57, 217, 138, 0.10), transparent 60%),
    linear-gradient(180deg, #070b16 0%, #080d1b 50%, #070a14 100%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 70%);
}
/* frosted-glass surfaces (dark theme) */
.login-card, .card, .stat, .sidebar, .badge { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.card, .stat { box-shadow: var(--shadow-soft); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; position: relative; z-index: 1; }
.login-card { background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)); border: 1px solid var(--border); border-radius: 24px; padding: 36px; width: min(390px, 100%); box-shadow: var(--shadow); }
.login-card input { width: 100%; margin: 8px 0; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.login-card input::placeholder { color: #5c6a86; }
.login-card input:focus { outline: none; border-color: rgba(233,182,77,.6); box-shadow: 0 0 0 4px rgba(233,182,77,.15); background: rgba(255,255,255,.05); }
.login-card button#loginBtn { width: 100%; margin-top: 14px; padding: 14px; border: none; border-radius: 12px; background: linear-gradient(100deg, var(--brand), var(--brand-2)); color: #0a0e1a; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 14px 30px rgba(233,182,77,.3); transition: transform .14s ease, box-shadow .14s ease; }
.login-card button#loginBtn:hover { transform: translateY(-1px); box-shadow: 0 18px 38px rgba(233,182,77,.4); }
.login-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #0a0e1a; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 12px 28px rgba(233,182,77,.34); }
.secure-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--green); background: rgba(57,217,138,.12); border: 1px solid rgba(57,217,138,.28); padding: 5px 10px; border-radius: 20px; }
.secure-chip svg { width: 14px; height: 14px; }
.secure-chip.sm { font-size: 11px; padding: 4px 9px; }
.login-title { margin: 0; font-size: 24px; letter-spacing: -.6px; }
.login-sub { margin: 4px 0 18px; color: var(--muted); font-size: 14px; }
.login-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 10px 0 2px; }
.trust-strip { display: flex; justify-content: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.trust-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.trust-item svg { width: 15px; height: 15px; color: var(--brand); }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 18px 2px 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; flex-wrap: wrap; }

/* notifications */
.notif-bell { position: relative; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 11px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--text); transition: background .15s ease, box-shadow .15s ease; }
.notif-bell:hover { background: rgba(255,255,255,.09); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.notif-bell svg { width: 20px; height: 20px; }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; background: linear-gradient(135deg, #ff6b7d, #ff9a6b); color: #1a0b0e; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(255,107,125,.4); }
.notif-panel { position: absolute; right: 0; top: 48px; width: min(380px, 86vw); max-height: 460px; overflow-y: auto; background: var(--panel-strong); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); z-index: 20; padding: 8px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 11px; align-items: flex-start; }
.notif-item:hover { background: rgba(255,255,255,.05); }
.notif-item.unread { background: rgba(233,182,77,.09); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; background: var(--brand); }
.notif-dot.success { background: var(--green); } .notif-dot.error { background: var(--red); } .notif-dot.warning { background: var(--amber); }
.notif-item .nt { font-weight: 700; font-size: 13px; }
.notif-item .nm { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.notif-item .ntime { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* modal */
.p2c-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(3,6,14,.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); padding: 18px; }
.p2c-modal-card { background: var(--panel-strong); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; width: min(460px, 100%); }
.p2c-modal-card .field input, .p2c-modal-card .toolbar select { width: 100%; }
.demo-creds { display: flex; gap: 8px; margin-top: 16px; }
.ghost { background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--muted); padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 12px; flex: 1; }
.ghost:hover { color: var(--text); border-color: rgba(233,182,77,.5); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #0a0e1a; font-size: 13px; box-shadow: 0 10px 24px rgba(233,182,77,.3); }
/* full Pay AGL wordmark logo */
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -0.3px; color: #fff; }
.wordmark .dot { color: var(--brand); -webkit-text-fill-color: var(--brand); }

/* APP LAYOUT */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; position: relative; z-index: 1; }
.sidebar { background: rgba(255,255,255,.03); border-right: 1px solid var(--border); padding: 22px 16px; display: flex; flex-direction: column; box-shadow: 12px 0 40px rgba(0,0,0,.3); }
.sidebar nav { margin-top: 24px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav button { text-align: left; background: transparent; border: 1px solid transparent; color: var(--muted); padding: 10px 12px; border-radius: 12px; cursor: pointer; font-size: 14px; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.sidebar nav button:hover { background: rgba(255,255,255,.05); color: var(--text); border-color: var(--border); transform: translateX(2px); }
.sidebar nav button.active { background: linear-gradient(100deg, rgba(233,182,77,.16), rgba(247,212,122,.1)); color: #fff; font-weight: 700; border-color: rgba(233,182,77,.28); box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; }
.user-info { font-size: 13px; margin-bottom: 10px; }
.user-info .name { font-weight: 600; }
.user-info .email { color: var(--muted); font-size: 12px; }

.content { padding: 0 32px 44px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 24px 0; position: sticky; top: 0; background: rgba(7, 11, 22, 0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 5; }
.topbar h1 { font-size: 25px; margin: 0; letter-spacing: -.5px; background: linear-gradient(100deg, #fff, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badge { font-size: 11px; text-transform: uppercase; letter-spacing: .55px; padding: 5px 10px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--muted); }

/* CARDS / STATS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { --accent: #e9b64d; --accent2: #f7d47a; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); border: 1px solid var(--border); border-radius: 18px; padding: 18px; position: relative; overflow: hidden; transition: transform .16s ease, box-shadow .16s ease; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.stat::after { content: ""; position: absolute; inset: auto -28px -46px auto; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent); }
.stat:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,.4); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .label::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -.5px; position: relative; background: linear-gradient(100deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* rotating accent palette so each card pops with its own color */
.stat:nth-child(6n+1) { --accent:#e9b64d; --accent2:#f7d47a; }
.stat:nth-child(6n+2) { --accent:#39d98a; --accent2:#7ef0b8; }
.stat:nth-child(6n+3) { --accent:#f5a623; --accent2:#ff7a59; }
.stat:nth-child(6n+4) { --accent:#38bdf8; --accent2:#7dd3fc; }
.stat:nth-child(6n+5) { --accent:#ff6b7d; --accent2:#ff9a6b; }
.stat:nth-child(6n+6) { --accent:#a78bfa; --accent2:#c4b5fd; }

.card { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); border: 1px solid var(--border); border-radius: 18px; padding: 20px; margin-bottom: 20px; transition: box-shadow .16s ease, border-color .16s ease; }
.card:hover { box-shadow: 0 16px 40px rgba(0,0,0,.35); border-color: rgba(233,182,77,.18); }
.card h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.card h2::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); flex: 0 0 auto; }

/* TABLE */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; overflow: hidden; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: rgba(255,255,255,.035); }

.pill { font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 700; letter-spacing: .2px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.success, .pill.completed, .pill.active { background: rgba(57,217,138,.14); color: var(--green); border-color: rgba(57,217,138,.3); }
.pill.failed, .pill.suspended, .pill.closed { background: rgba(255,107,125,.14); color: var(--red); border-color: rgba(255,107,125,.3); }
.pill.pending, .pill.approved { background: rgba(245,166,35,.15); color: var(--amber); border-color: rgba(245,166,35,.3); }

.btn { background: linear-gradient(100deg, var(--brand), var(--brand-2)); border: none; color: #0a0e1a; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 800; box-shadow: 0 10px 24px rgba(233,182,77,.24); transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(233,182,77,.32); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: default; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .toolbar input { background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--text); padding: 9px 11px; border-radius: 10px; font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.toolbar select option { background: #10182b; color: var(--text); }
.toolbar select:focus, .toolbar input:focus, .field input:focus, .field textarea:focus { outline: none; border-color: rgba(233,182,77,.62); box-shadow: 0 0 0 4px rgba(233,182,77,.14); background: rgba(255,255,255,.05); }
.amount { font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 20px; text-align: center; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 8px 8px 0 0; min-height: 4px; box-shadow: 0 8px 18px rgba(233,182,77,.2); }
.bar-label { font-size: 11px; color: var(--muted); }

/* ---- additions for full build ---- */
.demo-label { font-size: 12px; margin: 16px 0 6px; }
.sidebar nav { overflow-y: auto; max-height: calc(100vh - 200px); }
.ghostbtn { background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--muted); box-shadow: none; }
.ghostbtn:hover { color: var(--text); border-color: rgba(233,182,77,.4); background: rgba(255,255,255,.07); box-shadow: none; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; max-width: 480px; background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 10px; }
.field input::placeholder, .field textarea::placeholder { color: #5c6a86; }
.field select option { background: #10182b; color: var(--text); }
.card h3 { font-size: 14px; margin: 16px 0 6px; }
pre { background: #05070e; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 15px; overflow-x: auto; font-size: 12.5px; color: #c8d0e0; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
code { background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; border: 1px solid var(--border); color: var(--brand-2); }
.ticket { border: 1px solid var(--border); border-radius: 14px; padding: 15px; margin-bottom: 12px; background: rgba(255,255,255,.03); }
.ticket-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ticket-msgs { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.msg { background: rgba(255,255,255,.05); border-radius: 10px; padding: 9px 11px; font-size: 13px; }
a { color: var(--brand-2); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 16px; }
.perm-item { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 4px 0; cursor: pointer; }
.perm-item input { width: 15px; height: 15px; accent-color: var(--brand); }
/* AI Admin Agent chat */
.ag-log { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.ag-row { display: flex; }
.ag-row.you { justify-content: flex-end; }
.ag-bubble { max-width: 80%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.ag-bubble.you { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #0a0e1a; font-weight: 600; border-bottom-right-radius: 4px; }
.ag-bubble.agent { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.agent-card { width: 100%; margin: 8px 0 2px; font-size: 13px; }
.agent-card td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.agent-card td.ak { color: var(--muted); width: 42%; }
.ag-actions { display: flex; gap: 8px; margin-top: 10px; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar nav { max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .content { padding: 0 18px 34px; }
  .topbar { position: static; }
}

/* lively entrance + interaction pops */
@keyframes p2cFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#page > * { animation: p2cFadeUp .28s ease both; }
#page > *:nth-child(2) { animation-delay: .04s; }
#page > *:nth-child(3) { animation-delay: .08s; }
#page > *:nth-child(4) { animation-delay: .12s; }
.btn:active { transform: translateY(1px) scale(.99); }
tbody tr { transition: background .12s ease; }
.bars .bar { transition: height .4s cubic-bezier(.2,.8,.2,1); }
.badge { background: linear-gradient(100deg, rgba(233,182,77,.16), rgba(247,212,122,.12)); color: var(--brand-2); border-color: rgba(233,182,77,.3); font-weight: 700; }
