:root {
  --bg: #0f172a;
  --surface: #111827;
  --surface-strong: #1f2937;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --success: #4ade80;
  --danger: #fb7185;
  --radius: 18px;
  font-family: 'Sora', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 40%),
    linear-gradient(180deg, #020617 0%, #090e1f 100%);
  color: var(--text);
}

img {
  max-width: 100%;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-right: 0.85rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
}

.nav-link.active,
.sb-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.overview-grid,
.cards-grid,
.kpi-grid,
.page-row {
  display: grid;
  gap: 1rem;
}

.overview-grid,
.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.page-row {
  grid-template-columns: 1.4fr 0.9fr;
}

.stats-card,
.panel-card,
.filters-card {
  margin-bottom: 1rem;
}

.donut-chart {
  width: 100%;
  height: 240px;
  margin-top: 1rem;
}

.warn-box {
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #ff6b81;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.hide {
  display: none !important;
}

#toast-box {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-ic {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 150;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.btn-row,
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
}

.page-shell {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.hero-card h2 {
  margin-top: 0;
}

button {
  cursor: pointer;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2vw, 2.5rem);
}

.brand p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
}

.page-shell,
.content-shell,
.login-shell {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.hero-card,
.card,
.login-card,
.document-page main {
  background: rgba(15, 23, 42, 0.9);
}

.footer,
.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}
