@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Roboto+Slab:wght@400;700;800&family=Sora:wght@200;300;400;500;600;700;800&display=swap');

:root {
  --bg: #05070b;
  --bg-2: #080808;
  --surface: rgba(12, 12, 14, 0.88);
  --surface-strong: #111318;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f7fb;
  --muted: #a0a9b8;
  --accent: #0084ff;
  --accent-2: #004382;
  --accent-3: #20d3ff;
  --danger: #ef4444;
  --success: #34d399;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at top left, rgba(0, 132, 255, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(32, 211, 255, 0.16), transparent 26%),
    linear-gradient(180deg, #040507 0%, #080808 58%, #05070b 100%);
  color: var(--text);
  font-family: "Roboto", "Segoe UI", sans-serif;
  color-scheme: dark;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: "Sora", "Roboto", sans-serif; font-weight: 700; letter-spacing: -0.02em; }
p { line-height: 1.7; color: var(--muted); }

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(7, 7, 8, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand, .brand-large {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-large { margin-bottom: 28px; }

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 132, 255, 0.18), rgba(32, 211, 255, 0.12));
  border: 1px solid rgba(0, 132, 255, 0.24);
  box-shadow: 0 12px 30px rgba(0, 132, 255, 0.18);
}

.brand-mark img {
  width: 32px;
  height: 32px;
}

.brand-copy {
  display: grid;
  gap: 6px;
}

.brand-logo {
  width: min(186px, 100%);
  height: auto;
  display: block;
}

.brand-title { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.02em; }
.brand-subtitle { color: var(--muted); font-size: 0.9rem; }

.nav { display: grid; gap: 8px; }
.nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  border-color: rgba(0, 132, 255, 0.24);
  background: linear-gradient(135deg, rgba(0, 132, 255, 0.14), rgba(12, 22, 36, 0.92));
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-user {
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 18, 20, 0.8);
  border: 1px solid var(--line);
}

.sidebar-user-name { font-weight: 700; margin-top: 10px; }
.sidebar-user-email { color: var(--muted); font-size: 0.9rem; word-break: break-word; }

.main {
  padding: 32px;
  max-width: 1600px;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 8px;
}

.topbar-meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-meta .button { white-space: nowrap; }
.topbar-meta .button.button-small {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.content { display: grid; gap: 24px; }

.hero-banner {
  padding: 26px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(0, 132, 255, 0.16), rgba(0, 0, 0, 0.26)),
    linear-gradient(135deg, rgba(12, 12, 14, 0.96), rgba(8, 8, 8, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.hero-chip {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(0, 132, 255, 0.12);
  color: #bfe1ff;
  border: 1px solid rgba(0, 132, 255, 0.2);
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.metric-card {
  padding: 22px;
  min-height: 150px;
  display: grid;
  align-content: space-between;
}

.metric-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.metric-card-link:hover,
.metric-card-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(0, 132, 255, 0.26);
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.55);
  outline: none;
}

.metric-label { color: var(--muted); font-size: 0.92rem; }
.metric-value { font-size: 2.1rem; font-weight: 800; margin: 10px 0; }
.metric-hint { color: var(--muted); font-size: 0.88rem; }

.panel { padding: 22px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-subsection { margin-top: 22px; }
.panel-subsection h4 { margin-bottom: 12px; }

.admin-form {
  display: grid;
  gap: 18px;
}

.admin-form label {
  display: grid;
  gap: 8px;
}

.admin-form span {
  color: #dbeafe;
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  border-radius: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,0.08);
  background-color: #0e1218;
  color: var(--text);
  outline: none;
  font: inherit;
}

.admin-form select,
.filters-bar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(245, 247, 251, 0.92) 50%),
    linear-gradient(135deg, rgba(245, 247, 251, 0.92) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
  color-scheme: dark;
}

.admin-form select option,
.filters-bar select option {
  background: #0d1117;
  color: var(--text);
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: rgba(0, 132, 255, 0.46);
  box-shadow: 0 0 0 4px rgba(0, 132, 255, 0.1);
}

.admin-form input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: #dbeafe;
  cursor: default;
  opacity: 0.9;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.toggle-row {
  display: grid;
  gap: 12px;
}

.toggle-row .checkbox-row {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.choice-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form .choice-pill {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  width: 100%;
  justify-items: start;
}

.admin-form .choice-pill input {
  margin: 0;
  width: 18px;
  height: 18px;
  grid-column: 1;
  grid-row: 1;
}

.admin-form .choice-pill span {
  grid-column: 2;
  grid-row: 1;
  line-height: 1.2;
  min-width: 0;
}

.filters-bar {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.filters-bar label {
  display: grid;
  gap: 8px;
}

.filters-bar .button {
  height: 100%;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-small {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
}

.button-success {
  background: rgba(52, 211, 153, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(52, 211, 153, 0.18);
}

.button-soft {
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.button-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.button.button-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  flex: 0 0 auto;
  gap: 0;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

.button.button-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
  shape-rendering: geometricPrecision;
}

.button.button-icon.is-loading svg {
  opacity: 0;
}

.button.button-icon.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.75s linear infinite;
}

.button.button-icon.button-soft {
  background: rgba(96, 165, 250, 0.10);
}

.button.button-icon.button-danger {
  background: rgba(239, 68, 68, 0.10);
}

.button.button-icon.button-success {
  background: rgba(52, 211, 153, 0.10);
}

.form-note {
  min-height: 1.2rem;
  color: var(--muted);
}

.form-note.error { color: #fca5a5; }
.form-note.success { color: #86efac; }

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.data-table td .muted {
  display: inline-block;
  margin-top: 4px;
}

.muted { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.pill-soft { background: rgba(96, 165, 250, 0.14); color: #bfdbfe; }
.pill-emerald { background: rgba(45, 212, 191, 0.14); color: #a7f3d0; }
.pill-danger { background: rgba(239, 68, 68, 0.14); color: #fecaca; }
.pill-warning { background: rgba(245, 158, 11, 0.16); color: #fde68a; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
}
.button:hover { transform: translateY(-1px); }
.button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}
.button-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #f8fbff;
  box-shadow: 0 16px 28px rgba(0, 132, 255, 0.2);
}
.button-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.data-table th { color: #bfdbfe; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.data-table td { color: var(--text); }

.empty-state {
  padding: 20px;
  border-radius: 18px;
  background: rgba(0, 132, 255, 0.08);
  border: 1px dashed rgba(0, 132, 255, 0.24);
  color: var(--muted);
}

.empty-state a {
  color: #bfdbfe;
  font-weight: 700;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-grid {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
}

.login-hero, .login-card {
  border-radius: 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(18px);
}

.login-hero { padding: 32px; display: grid; align-content: space-between; min-height: 640px; }
.login-hero h1 { font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 0.98; margin: 0 0 16px; }
.login-hero p { max-width: 60ch; }

.feature-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--text);
}

.login-card { padding: 32px; display: grid; align-content: center; }
.card-head h2 { margin-top: 8px; font-size: 2rem; }

.login-form { display: grid; gap: 16px; margin-top: 20px; }
.login-form label { display: grid; gap: 8px; }
.login-form span { color: #dbeafe; font-size: 0.9rem; font-weight: 700; }
.login-form input {
  width: 100%;
  border-radius: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
}
.login-form input:focus { border-color: rgba(0, 132, 255, 0.42); box-shadow: 0 0 0 4px rgba(0, 132, 255, 0.08); }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-links a {
  color: #bfdbfe;
  font-weight: 700;
}

.auth-links a:hover {
  color: #ffffff;
}

.login-card .form-note {
  margin-top: 4px;
}

.checkbox-row {
  display: flex !important;
  gap: 10px;
  align-items: center;
}
.checkbox-row input { width: 18px; height: 18px; }

.detail-shell {
  display: grid;
  gap: 18px;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.1fr 1fr;
}

.detail-stack {
  display: grid;
  gap: 18px;
}

.inline-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-kpis .pill {
  background: rgba(0, 132, 255, 0.12);
  color: #d7eaff;
  border: 1px solid rgba(0, 132, 255, 0.16);
}

.subtle-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.page-toolbar .muted {
  max-width: 72ch;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.pager-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pager-link {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.pager-link.active {
  background: rgba(0, 132, 255, 0.16);
  border-color: rgba(0, 132, 255, 0.24);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
  .app-shell, .login-grid { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-bar { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main, .sidebar, .login-hero, .login-card { padding: 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .hero-banner, .topbar { flex-direction: column; align-items: flex-start; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .action-cell { justify-content: flex-start; }
  .choice-row { grid-template-columns: 1fr; }
  .filters-bar { grid-template-columns: 1fr; }
  .detail-hero { flex-direction: column; }
  .page-toolbar { align-items: flex-start; }
}
