:root{
  --bg:#eef3f7;
  --panel:#ffffff;
  --panel-soft:#f7f9fb;
  --ink:#172033;
  --muted:#5f6f82;
  --line:#d7e0ea;
  --brand:#17637a;
  --brand-dark:#12495d;
  --brand-soft:#e7f5f7;
  --ok:#0f766e;
  --warn:#b45309;
  --danger:#b91c1c;
  --shadow:0 16px 40px rgba(22,32,48,.08);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  background:
    radial-gradient(circle at 18% -8%, rgba(23,99,122,.16), transparent 28%),
    linear-gradient(180deg,#f8fbfd 0%,var(--bg) 48%,#eaf0f5 100%);
  color:var(--ink);
}
.wrap,.workspace{
  max-width:1220px;
  margin:0 auto;
  padding:24px;
}
.dashboardWorkspace{
  padding-top:20px;
}
.appShellHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:20px clamp(20px,4vw,42px);
  background:linear-gradient(135deg,#18364a 0%,#166079 62%,#227067 100%);
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.18);
  box-shadow:0 10px 32px rgba(18,49,70,.18);
}
.appShellHeader h1{
  margin:2px 0 4px;
  font-size:26px;
}
.appShellHeader p{
  margin:0;
  color:#dbe7f0;
}
.eyebrow{
  color:#9bd2e8;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.headerActions,.actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:24px;
  box-shadow:var(--shadow);
}
h1,h2,h3{
  margin:0;
}
h2{
  margin-bottom:14px;
  font-size:18px;
}
h3{
  margin:4px 0 6px;
  font-size:16px;
}
p{
  line-height:1.55;
}
a{
  color:var(--brand);
  font-weight:750;
}
.btn,button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  border:0;
  border-radius:8px;
  padding:9px 15px;
  background:var(--brand);
  color:#fff;
  font-weight:850;
  text-decoration:none;
  cursor:pointer;
  font:inherit;
}
.btn.secondary,button.secondary{
  background:#f6f8fb;
  color:var(--brand-dark);
  border:1px solid #c8d5e2;
}
.btn.ghost{
  background:rgba(255,255,255,.08);
  color:#fff;
  border:1px solid rgba(255,255,255,.28);
}
.btn.danger,button.danger{
  background:var(--danger);
}
label{
  display:block;
  margin:12px 0;
  font-weight:780;
}
input,select{
  width:100%;
  margin-top:6px;
  border:1px solid #c8d5e2;
  border-radius:8px;
  padding:11px 12px;
  font:inherit;
  background:#fff;
}
input:focus,select:focus{
  border-color:#38a3b8;
  box-shadow:0 0 0 3px rgba(56,163,184,.16);
  outline:0;
}
.grid,.panelGrid{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(320px,.85fr);
  gap:20px;
  align-items:start;
}
.recentCard{
  grid-column:1 / -1;
}
.statsGrid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:20px;
}
.statCard{
  min-height:112px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:18px;
  background:var(--panel);
  box-shadow:0 10px 28px rgba(22,32,48,.06);
}
.statCard span{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
  text-transform:uppercase;
}
.statCard strong{
  display:block;
  margin-top:9px;
  font-size:25px;
  line-height:1.15;
}
.statCard small{
  display:block;
  margin-top:8px;
  color:#7a8998;
  font-size:12px;
}
.module{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:18px 20px;
  background:var(--panel-soft);
}
.moduleContent{
  min-width:0;
}
.moduleActions{
  display:flex;
  flex:0 0 auto;
}
.moduleTag{
  display:inline-block;
  padding:3px 8px;
  border-radius:999px;
  background:var(--brand-soft);
  color:var(--brand-dark);
  font-size:12px;
  font-weight:900;
}
.cardTitleRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}
.sectionKicker{
  display:block;
  margin-bottom:5px;
  color:#637286;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
}
.apiStatus{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-radius:10px;
  padding:13px 14px;
  margin:16px 0;
  border:1px solid var(--line);
  background:var(--panel-soft);
}
.apiStatus span{
  color:var(--muted);
  font-weight:800;
}
.apiStatus.ok{
  border-color:#99f6e4;
  background:#eefcf8;
  color:#134e4a;
}
.apiStatus.warn{
  border-color:#fcd34d;
  background:#fffbeb;
  color:#78350f;
}
.notice{
  margin:12px 0;
  padding:11px 12px;
  border-radius:8px;
  background:#ecfdf5;
  color:#064e3b;
  border:1px solid #a7f3d0;
}
.warn{
  background:#fffbeb;
  color:#78350f;
  border-color:#fcd34d;
}
.error{
  background:#fef2f2;
  color:#7f1d1d;
  border-color:#fecaca;
}
.apiCard{
  overflow:hidden;
}
.apiForm label{
  margin-bottom:10px;
}
.apiActions{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:10px;
}
.apiActions .btn,.apiActions button{
  width:100%;
}
.apiManageRow{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:10px;
  margin-top:10px;
  padding-top:12px;
  border-top:1px solid #e5edf5;
}
.apiManageRow form{
  margin:0;
}
.apiManageRow button{
  width:100%;
}
.apiManageRow .danger{
  background:#b91c1c;
}
table{
  width:100%;
  border-collapse:collapse;
  margin-top:8px;
}
th,td{
  border-bottom:1px solid #e5edf5;
  padding:10px;
  text-align:left;
  vertical-align:top;
}
th{
  color:#52657a;
  font-size:13px;
}
.muted{
  color:var(--muted);
}
.pill{
  display:inline-block;
  border:1px solid #c8d5e2;
  border-radius:999px;
  padding:3px 8px;
  background:#fff;
  font-size:12px;
  font-weight:850;
}
.pill.dark{
  color:#fff;
  border-color:rgba(255,255,255,.3);
  background:rgba(255,255,255,.12);
}
@media (max-width:820px){
  .appShellHeader,.top{
    align-items:flex-start;
    flex-direction:column;
  }
  .workspace,.wrap{
    padding:16px;
  }
  .panelGrid,.grid,.statsGrid{
    grid-template-columns:1fr;
  }
  .module{
    align-items:flex-start;
    flex-direction:column;
  }
  .moduleActions,.moduleActions .btn{
    width:100%;
  }
  .apiActions,.apiManageRow{
    grid-template-columns:1fr;
  }
}

/* Dashboard refinement */
.dashboardPage{
  font-size:14px;
  background:
    linear-gradient(180deg,#f8fafc 0%,#eef3f7 44%,#e9eff5 100%);
}
.dashboardPage .appShellHeader{
  padding:0;
  background:#17324d;
  box-shadow:0 8px 24px rgba(15,38,60,.16);
}
.appHeaderInner{
  width:100%;
  max-width:1220px;
  margin:0 auto;
  padding:14px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.dashboardPage .eyebrow{
  margin-bottom:2px;
  color:#a9d7e8;
  font-size:10px;
  letter-spacing:.12em;
}
.dashboardPage .appShellHeader h1{
  font-size:23px;
  line-height:1.15;
}
.dashboardPage .appShellHeader p{
  margin-top:6px;
  color:#d8e6f0;
  font-size:13px;
}
.dashboardPage .headerActions{
  flex-wrap:nowrap;
}
.dashboardPage .btn,
.dashboardPage button{
  min-height:36px;
  border-radius:8px;
  padding:7px 12px;
  font-size:14px;
  line-height:1.15;
}
.dashboardPage .btn.secondary,
.dashboardPage button.secondary{
  background:#fff;
  border-color:#cbd8e5;
}
.dashboardPage .btn.ghost{
  background:rgba(255,255,255,.08);
}
.dashboardPage .dashboardWorkspace{
  max-width:1220px;
  padding:22px 24px 28px;
}
.dashboardPage .statsGrid{
  gap:12px;
  margin-bottom:16px;
}
.dashboardPage .statCard{
  min-height:88px;
  padding:14px 16px;
  border-radius:10px;
  box-shadow:0 8px 22px rgba(21,34,50,.055);
}
.dashboardPage .statCard span{
  font-size:11px;
  letter-spacing:.02em;
}
.dashboardPage .statCard strong{
  margin-top:8px;
  font-size:22px;
}
.dashboardPage .statCard small{
  margin-top:6px;
  font-size:12px;
  line-height:1.35;
}
.dashboardPage .panelGrid{
  grid-template-columns:minmax(0,1.45fr) minmax(360px,.9fr);
  gap:18px;
}
.dashboardPage .card{
  border-radius:10px;
  padding:20px 24px;
  box-shadow:0 14px 34px rgba(21,34,50,.07);
}
.dashboardPage h2{
  margin:0;
  font-size:18px;
  line-height:1.2;
}
.dashboardPage h3{
  font-size:15px;
  line-height:1.25;
}
.dashboardPage p{
  line-height:1.5;
}
.dashboardPage .cardTitleRow{
  margin-bottom:14px;
}
.dashboardPage .sectionKicker{
  margin-bottom:4px;
  color:#66778a;
  font-size:10px;
  letter-spacing:.11em;
}
.dashboardPage .module{
  padding:16px 18px;
  border-radius:10px;
  background:#f8fafc;
}
.dashboardPage .module .muted{
  margin:8px 0 0;
  font-size:14px;
}
.dashboardPage .moduleTag{
  padding:3px 8px;
  font-size:11px;
}
.dashboardPage .moduleActions .btn{
  min-width:116px;
}
.dashboardPage .apiCard .muted{
  margin:0 0 14px;
  color:#596b80;
  font-size:14px;
}
.dashboardPage .apiStatus{
  margin:14px 0 16px;
  padding:11px 12px;
  border-radius:9px;
}
.dashboardPage .apiStatus span,
.dashboardPage .apiStatus strong{
  font-size:13px;
}
.dashboardPage label{
  margin:0 0 12px;
  font-size:13px;
  font-weight:850;
}
.dashboardPage input,
.dashboardPage select{
  min-height:40px;
  margin-top:6px;
  padding:9px 10px;
  border-radius:8px;
  font-size:14px;
}
.dashboardPage .apiActions,
.dashboardPage .apiManageRow{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.dashboardPage .apiManageRow{
  margin-top:10px;
  padding-top:10px;
}
.dashboardPage .apiActions .btn,
.dashboardPage .apiActions button,
.dashboardPage .apiManageRow button{
  width:100%;
  min-height:38px;
  white-space:normal;
}
.dashboardPage .apiManageRow form{
  min-width:0;
}
.dashboardPage .notice{
  padding:10px 12px;
  font-size:13px;
}

@media (max-width:980px){
  .dashboardPage .statsGrid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .dashboardPage .panelGrid{
    grid-template-columns:1fr;
  }
}
@media (max-width:620px){
  .appHeaderInner{
    align-items:flex-start;
    flex-direction:column;
    padding:14px 16px;
  }
  .dashboardPage .dashboardWorkspace{
    padding:16px;
  }
  .dashboardPage .statsGrid,
  .dashboardPage .apiActions,
  .dashboardPage .apiManageRow{
    grid-template-columns:1fr;
  }
}

/* Admin center */
.adminPage{
  font-size:14px;
  background:linear-gradient(180deg,#f8fafc 0%,#eef3f7 100%);
}
.adminWorkspace{
  max-width:1260px;
  padding:24px;
}
.adminHero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.adminHero h1{
  font-size:24px;
  line-height:1.15;
}
.adminHero p{
  margin:8px 0 0;
}
.adminStatsGrid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:18px;
}
.adminGrid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 330px;
  gap:18px;
  align-items:start;
  width:100%;
  min-width:0;
}
.adminPage .card{
  border-radius:10px;
  padding:20px;
}
.adminUsersCard,.adminSystemCard{
  width:100%;
  max-width:100%;
  min-width:0;
}
.adminTableWrap{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow:auto;
}
.adminTable{
  min-width:860px;
  margin:0;
}
.adminTable th{
  padding:9px 10px;
  color:#65768a;
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.adminTable td{
  padding:12px 10px;
  font-size:13px;
}
.adminTable strong{
  display:block;
  color:#172033;
  font-size:13px;
}
.adminSubtext{
  display:block;
  margin-top:4px;
  color:#6b7c8f;
  font-size:12px;
  line-height:1.35;
}
.statusPill{
  text-transform:capitalize;
}
.statusPill.approved,.okPill{
  border-color:#99f6e4;
  background:#ecfdf5;
  color:#166534;
}
.statusPill.pending{
  border-color:#fde68a;
  background:#fffbeb;
  color:#92400e;
}
.statusPill.suspended{
  border-color:#fecaca;
  background:#fef2f2;
  color:#991b1b;
}
.adminActions{
  display:grid;
  grid-template-columns:repeat(2,minmax(104px,1fr));
  gap:8px;
  align-items:stretch;
  margin:0;
}
.adminActions button{
  width:100%;
  min-height:34px;
  padding:7px 9px;
  border-radius:8px;
  font-size:12px;
  line-height:1.15;
}
.systemFacts{
  display:grid;
  gap:9px;
  margin:0 0 14px;
}
.systemFacts div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid #e5edf5;
}
.systemFacts dt{
  color:#637286;
  font-size:12px;
  font-weight:850;
}
.systemFacts dd{
  margin:0;
  color:#172033;
  font-size:13px;
  font-weight:850;
  text-align:right;
}
.systemFacts .pathFact{
  align-items:flex-start;
  flex-direction:column;
  gap:6px;
}
.systemFacts .pathFact dd{
  width:100%;
  text-align:left;
}
.systemFacts .pathFact code{
  display:block;
  width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
  background:#eef3f7;
  border:1px solid #dbe5ee;
  border-radius:7px;
  padding:6px 7px;
  color:#334155;
  font-size:11px;
  line-height:1.35;
}
.backupForm{
  margin:0 0 12px;
}
.backupForm button{
  width:100%;
}
.backupForm button:disabled{
  opacity:.55;
  cursor:not-allowed;
}
.adminNote{
  margin:0;
  font-size:12px;
}
.adminNote code{
  font-size:11px;
  background:#eef3f7;
  border:1px solid #dbe5ee;
  border-radius:6px;
  padding:1px 5px;
}

@media (max-width:980px){
  .adminStatsGrid,.adminGrid{
    grid-template-columns:1fr;
  }
  .adminGrid{
    gap:14px;
  }
  .adminPage .card{
    width:100%;
    max-width:100%;
  }
}
@media (max-width:620px){
  .adminWorkspace{
    padding:16px;
  }
  .adminStatsGrid{
    gap:10px;
  }
  .adminPage .statCard{
    width:100%;
  }
  .adminUsersCard,.adminSystemCard{
    padding:16px;
  }
  .adminHero{
    align-items:flex-start;
    flex-direction:column;
  }
  .adminHero .actions,.adminHero .btn{
    width:100%;
  }
}
