:root {
  --bg: #0b0f14;
  --bg-accent: #0f1a23;
  --panel: #121821;
  --panel-2: #0f141c;
  --card: #151c26;
  --border: #212a36;
  --text: #f1f5f9;
  --muted: #9aa5b1;
  --accent: #23e289;
  --accent-2: #4db8ff;
  --warning: #f4b740;
  --danger: #ff5d5d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Sora", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 0%, rgba(35, 226, 137, 0.08), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(77, 184, 255, 0.08), transparent 45%),
    linear-gradient(135deg, #0a0e13, #0d141c 45%, #101722 100%);
  min-height: 100%;
}

body.panel-body {
  min-height: 100vh;
}

body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

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

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, rgba(17, 23, 33, 0.96), rgba(11, 15, 20, 0.95));
  border-right: 1px solid var(--border);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
}

.sidebar .brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(35, 226, 137, 0.3), rgba(77, 184, 255, 0.3));
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-link.active {
  background: rgba(35, 226, 137, 0.12);
  color: var(--text);
  border-color: rgba(35, 226, 137, 0.35);
  box-shadow: inset 0 0 0 1px rgba(35, 226, 137, 0.15);
}

.sidebar .sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.sidebar .sidebar-footer .user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.content {
  flex: 1;
  padding: 28px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(15, 20, 28, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
}

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

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(77, 184, 255, 0.35);
}

.button.primary {
  background: linear-gradient(135deg, rgba(35, 226, 137, 0.2), rgba(77, 184, 255, 0.2));
  border-color: rgba(35, 226, 137, 0.5);
}

.button.danger {
  border-color: rgba(255, 93, 93, 0.4);
  color: var(--danger);
}

.grid {
  display: grid;
  gap: 20px;
}

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

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(35, 226, 137, 0.14);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.stat-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(35, 226, 137, 0.14);
  border: 1px solid rgba(35, 226, 137, 0.3);
}

.stat-value {
  font-size: 36px;
  font-weight: 600;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.badge.success {
  color: var(--accent);
  border-color: rgba(35, 226, 137, 0.4);
  background: rgba(35, 226, 137, 0.12);
}

.badge.warning {
  color: var(--warning);
  border-color: rgba(244, 183, 64, 0.4);
  background: rgba(244, 183, 64, 0.12);
}

.badge.danger {
  color: var(--danger);
  border-color: rgba(255, 93, 93, 0.4);
  background: rgba(255, 93, 93, 0.12);
}

.badge.music {
  color: var(--accent-2);
  border-color: rgba(77, 184, 255, 0.4);
  background: rgba(77, 184, 255, 0.12);
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.ok {
  color: var(--accent);
  background: rgba(35, 226, 137, 0.14);
}

.status-pill.bad {
  color: var(--danger);
  background: rgba(255, 93, 93, 0.14);
}

.status-pill.partial {
  color: var(--warning);
  background: rgba(244, 183, 64, 0.14);
}

.status-pill.empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label {
  font-size: 13px;
  color: var(--muted);
}

.form-row input:not([type="checkbox"]):not([type="file"]),
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: rgba(77, 184, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(77, 184, 255, 0.15);
}

.form-row input[type="file"] {
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(35, 226, 137, 0.4);
  background: rgba(35, 226, 137, 0.12);
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 12px;
}

.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(35, 226, 137, 0.9), rgba(77, 184, 255, 0.9));
}

.chart {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  margin-top: 18px;
}

.chart-axis {
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.chart-bars {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 25%;
}

.chart-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 36px;
  height: 100%;
}

.chart-group-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
}

.chart-bar {
  width: 10px;
  border-radius: 6px 6px 2px 2px;
  min-height: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.chart-bar.voice {
  background: linear-gradient(180deg, rgba(35, 226, 137, 0.9), rgba(35, 226, 137, 0.3));
}

.chart-bar.music {
  background: linear-gradient(180deg, rgba(77, 184, 255, 0.9), rgba(77, 184, 255, 0.3));
}

.chart-label {
  font-size: 10px;
  color: var(--muted);
}

.chart-legend {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.login-card {
  max-width: 420px;
  width: 100%;
  background: rgba(18, 24, 33, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 12px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}

[data-animate] {
  animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    z-index: 10;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    padding: 18px 18px 40px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .chart {
    grid-template-columns: 36px 1fr;
  }

  .chart-axis,
  .chart-bars {
    height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    animation: none;
  }
}
