/* Kasyro Admin — brand palette borrowed from kasyro-web (Tailwind brand-500/900). */
:root {
  --brand-50:  #e3f2fd;
  --brand-100: #bbdefb;
  --brand-500: #1E88E5;
  --brand-700: #1565c0;
  --brand-900: #0a2f6b;
  --gray-50:   #f8fafc;
  --gray-100:  #f1f5f9;
  --gray-200:  #e2e8f0;
  --gray-400:  #94a3b8;
  --gray-600:  #475569;
  --gray-800:  #1e293b;
  --danger:    #dc2626;
  --ok:        #16a34a;
  --radius:    8px;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 0.5rem; color: var(--brand-900); }
h1.brand { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
.muted { color: var(--gray-600); }
.status { min-height: 1.5em; margin: 1rem 0 0; font-size: 0.9em; }

button, .btn-ghost {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-800);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  transition: background 0.12s, border-color 0.12s;
}
button:hover { background: var(--gray-100); border-color: var(--gray-400); }
button[type="submit"], .btn-primary {
  background: var(--brand-500); color: white; border-color: var(--brand-500);
}
button[type="submit"]:hover, .btn-primary:hover {
  background: var(--brand-700); border-color: var(--brand-700);
}

/* ── Login ─────────────────────────────────────────────────── */
#login-panel {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.login-card {
  width: 100%; max-width: 380px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.login-card form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.login-card label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9em; }
.login-card input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font: inherit;
}
.login-card input:focus { outline: 2px solid var(--brand-500); outline-offset: -1px; border-color: var(--brand-500); }

/* ── Dashboard ─────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  gap: 1rem;
}
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

#tabs {
  display: flex; gap: 0.25rem;
  padding: 0 1.5rem;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
}
#tabs button {
  border: none; border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--gray-600);
}
#tabs button:hover { background: var(--gray-50); color: var(--gray-800); }
#tabs button[aria-selected="true"] {
  color: var(--brand-700); border-bottom-color: var(--brand-500); font-weight: 600;
}

#tab-content { padding: 1.5rem; max-width: 1200px; }

/* ── KPI cards ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
}
.kpi-label { font-size: 0.8em; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.3rem; }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--brand-900); font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 0.85em; color: var(--gray-600); margin-top: 0.3rem; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 0.6rem 0.9rem; text-align: left; border-bottom: 1px solid var(--gray-100); font-size: 0.9em; }
table.data th { background: var(--gray-50); color: var(--gray-600); font-weight: 600; text-transform: uppercase; font-size: 0.75em; letter-spacing: 0.03em; }
table.data tbody tr:hover { background: var(--gray-50); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; padding: 0.1rem 0.5rem;
  background: var(--gray-100); color: var(--gray-800);
  border-radius: 999px; font-size: 0.75em; font-weight: 600; white-space: nowrap;
}
.badge-premium    { background: #dbeafe; color: #1d4ed8; }
.badge-enterprise { background: #ede9fe; color: #6d28d9; }
.badge-free       { background: var(--gray-100); color: var(--gray-600); }
.badge-demo       { background: #fef3c7; color: #92400e; }
.badge-expired    { background: #fee2e2; color: #991b1b; }
.badge-suspended  { background: #fed7aa; color: #9a3412; }

/* ── Utility ───────────────────────────────────────────────── */
.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-bar input {
  flex: 1; max-width: 360px;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font: inherit;
}
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-size: 0.9em; color: var(--gray-600); }

.error { color: var(--danger); }
.ok    { color: var(--ok); }

.chart-wrap {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  max-width: 480px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
