:root {
  --bg: #020617;
  --bg-elevated: #02091e;
  --bg-elevated-soft: #020c23;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.15);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --danger: #f97373;
  --warning: #facc15;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #042f2e 0, #020617 55%);
}

body {
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

/* Sidebar */

.sidebar {
  width: 240px;
  background: radial-gradient(circle at top, #064e3b 0, #020617 55%);
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #0b1120;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 18px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  background: radial-gradient(circle at 30% 0, #22c55e 0, #1d4ed8 40%, #020617 70%);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--muted);
}

.nav {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, #22c55e, #14b8a6);
  color: #0b1120;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.8);
  font-size: 11px;
}

.footer-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.footer-value {
  margin-top: 2px;
  font-weight: 600;
}

/* Main layout */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #020617 0, #020617 55%);
}

.topbar {
  height: 54px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.88),
    rgba(15, 23, 42, 0.88)
  );
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#search-input {
  min-width: 260px;
  max-width: 420px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.8);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 13px;
}

#search-input::placeholder {
  color: #6b7280;
}

.session-label {
  font-size: 12px;
  color: var(--muted);
}

.content {
  flex: 1;
  position: relative;
  padding: 16px 18px 14px;
}

/* Buttons & pills */

.btn,
.btn-primary {
  border-radius: 999px;
  padding: 7px 14px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn-primary {
  border-color: rgba(34, 197, 94, 0.7);
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #0b1120;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.4);
}

.btn:hover {
  border-color: rgba(148, 163, 184, 0.8);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn[disabled],
.btn-primary[disabled] {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.8);
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  color: #fee2e2;
  box-shadow: 0 10px 25px rgba(248, 113, 113, 0.4);
}

.btn-danger:hover {
  filter: brightness(1.03);
}

.pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}

.pill-outline {
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--muted);
}

/* Views */

.view {
  display: none;
  height: 100%;
}

.view-active {
  display: block;
}

/* Map */

#view-map {
  height: 100%;
}

.map-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

#map {
  width: 100%;
  height: calc(100% - 40px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 64, 175, 0.7);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

.map-stats-bar {
  height: 36px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(30, 64, 175, 0.6);
  background: linear-gradient(90deg, #020617, #020617);
  font-size: 12px;
  color: var(--muted);
}

.stat-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(55, 65, 81, 0.9);
}

/* Panels */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.table-panel,
.billing-layout {
  height: calc(100% - 46px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: radial-gradient(circle at top left, #020c23 0, #020617 55%);
  padding: 14px 14px 8px;
  overflow: auto;
}

/* Table styles */

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

.table th,
.table td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.table tr:hover td {
  background: rgba(15, 23, 42, 0.9);
}

/* Billing layout */

.billing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 16px;
}

.billing-form,
.billing-summary {
  border-radius: var(--radius-md);
  padding: 12px 12px 10px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  background: radial-gradient(circle at top, #020c23 0, #020617 55%);
}

.billing-form h3,
.billing-summary h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  font-size: 12px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-grid input,
.form-grid select {
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.85);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font-size: 13px;
  padding: 6px 8px;
}

.billing-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.summary-box {
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
  font-size: 12px;
  white-space: pre-wrap;
}

.billing-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

#bill-link-url {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.85);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
}

/* ANTIVOL */

.antitheft-layout {
  height: calc(100% - 46px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.antitheft-column {
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  background: radial-gradient(circle at top, #020c23 0, #020617 55%);
  overflow: auto;
}

.antitheft-column h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.card {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
  font-size: 13px;
}

.antitheft-target-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.antitheft-target-form input {
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.85);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
}

.antitheft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* Empty message */

.empty {
  font-size: 13px;
  color: var(--muted);
}

/* Responsive */

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .topbar {
    padding-inline: 14px;
  }
  .billing-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  #map {
    height: calc(100% - 60px);
  }
  .antitheft-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
