:root {
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --ink: #0f172a;
  --muted: #64748b;
  --surface: #ffffff;
  --bg: #f0f7f6;
  --sidebar: #0b3d3a;
  --card-shadow: 0 10px 30px rgba(15, 118, 110, 0.08);
  --radius: 18px;
  --font: "Source Serif 4", "Times New Roman", Georgia, serif;
  --font-ui: "DM Sans", "Segoe UI", sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Source+Serif+4:wght@500;700&display=swap');

* { box-sizing: border-box; }
body.app-body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(15,118,110,.12), transparent 40%),
    linear-gradient(180deg, #f7fbfa 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  min-height: 100vh;
}
#wrapper { min-height: 100vh; align-items: stretch; }
#page-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}
#page-content > main { flex: 1 0 auto; }
#page-content > footer {
  margin-top: auto;
  border-top: 1px solid rgba(15,118,110,.08);
  padding-top: 1rem;
}
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(11,61,58,.92), rgba(15,118,110,.75)),
    url('https://images.unsplash.com/photo-1519494026892-80bbd2d6fd0d?auto=format&fit=crop&w=1600&q=80') center/cover;
}
.auth-card {
  width: min(440px, 92vw);
  background: rgba(255,255,255,.96);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 30px 60px rgba(0,0,0,.25);
  animation: rise .5s ease;
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, var(--teal-700), #14b8a6);
  color:#fff; font-weight:700; font-size:1.4rem;
}
.sidebar {
  width: 270px; min-height: 100vh;
  background: linear-gradient(180deg, var(--sidebar), #062926);
  color: #fff;
  transition: margin .25s ease;
}
.sidebar-brand { display:flex; gap:12px; align-items:center; }
.sidebar .nav-link {
  color: rgba(255,255,255,.78);
  border-radius: 12px;
  padding: .7rem .9rem;
  display:flex; gap:.7rem; align-items:center;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background: rgba(255,255,255,.1);
  color:#fff;
}
.topbar {
  min-height: 64px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15,118,110,.08);
  position: sticky; top:0; z-index:20;
}
.page-title { font-family: var(--font); letter-spacing: -.02em; }
.panel, .stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(15,118,110,.06);
  animation: rise .45s ease;
}
.panel { padding: 1.25rem; }
.panel-header {
  font-weight: 700;
  margin-bottom: 1rem;
  font-family: var(--font);
}
.stat-card { padding: 1.1rem 1.2rem; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font-size: 1.7rem; font-weight: 700; font-family: var(--font); color: var(--teal-800); }
.btn-teal, .btn-teal:hover { background: var(--teal-700); border-color: var(--teal-700); color:#fff; }
.btn-outline-teal { color: var(--teal-700); border-color: var(--teal-700); }
.btn-outline-teal:hover { background: var(--teal-700); color:#fff; }
#page-content { min-width: 0; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
[data-bs-theme="dark"] body.app-body,
html[data-bs-theme="dark"] body.app-body {
  --surface: #0f1c1b;
  --bg: #071211;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  background: #071211;
}
html[data-bs-theme="dark"] .topbar,
html[data-bs-theme="dark"] .panel,
html[data-bs-theme="dark"] .stat-card {
  background: #102221;
  color: #e2e8f0;
}
@media (max-width: 991px) {
  .sidebar { position: fixed; z-index: 30; margin-left: -270px; }
  .sidebar.show { margin-left: 0; }
}
