
:root {
  --bg-main: #050816;
  --bg-elevated: #0b1020;
  --bg-card: #101426;
  --border-soft: #1f2438;
  --accent: #58cc02;
  --accent-soft: #24391c;
  --accent-strong: #46a302;
  --danger: #ff4b4b;
  --text-main: #f7fafc;
  --text-muted: #8c98c6;
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #141832 0, #050816 40%, #02010a 100%);
  color: var(--text-main);
}

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

body.theme-dark .app {
  min-height: 100vh;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: radial-gradient(circle at 20% 20%, #8ff75c, #4bbf00);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #020308;
  font-weight: 800;
  font-size: 20px;
  box-shadow: var(--shadow-soft);
}

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

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, background 0.15s ease-out, border-color 0.15s ease-out;
}

.btn.primary {
  background: var(--accent);
  color: #020308;
  box-shadow: 0 12px 30px rgba(88, 204, 2, 0.45);
}

.btn.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(88, 204, 2, 0.55);
}

.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-soft);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: #2e3650;
}

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

.btn.danger {
  background: transparent;
  border-color: rgba(255, 75, 75, 0.4);
  color: var(--danger);
}

.btn.danger:hover {
  background: rgba(255, 75, 75, 0.08);
}

/* Auth layout */
.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 26px 24px 26px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(14, 19, 40, 0.98), rgba(10, 15, 32, 0.98));
  border: 1px solid rgba(164, 179, 255, 0.08);
  box-shadow: var(--shadow-soft);
}

.page-title {
  margin: 16px 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

label {
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  border-radius: 12px;
  border: 1px solid #222945;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #050816;
  color: var(--text-main);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(88, 204, 2, 0.4);
  background: #050c1e;
}

/* Layout: app with sidebar */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  padding: 18px 16px;
  background: radial-gradient(circle at top left, #181f3c 0, #050816 45%, #02010a 100%);
  border-right: 1px solid rgba(133, 154, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border-radius: 999px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-out;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(116, 133, 255, 0.35);
  color: #d7e1ff;
}

.nav-item.active {
  background: rgba(15, 185, 95, 0.18);
  border-color: rgba(88, 204, 2, 0.7);
  color: #e5ffe0;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(9, 15, 35, 0.9);
  border: 1px solid rgba(122, 140, 255, 0.45);
  color: #d0dcff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px dashed rgba(122, 140, 255, 0.3);
}

/* Main area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(133, 154, 255, 0.18);
  background: rgba(5, 8, 22, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(14, 21, 60, 0.9);
  border: 1px solid rgba(128, 150, 255, 0.4);
  color: var(--text-muted);
}

/* Content */
.content {
  padding: 18px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.stat-card {
  border-radius: 18px;
  background: radial-gradient(circle at top left, #1b2240, #080c1c);
  padding: 14px 14px 12px;
  border: 1px solid rgba(133, 154, 255, 0.25);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
}

.stat-foot {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Panels */
.panel {
  border-radius: 22px;
  background: rgba(6, 10, 30, 0.95);
  border: 1px solid rgba(133, 154, 255, 0.2);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px 18px;
  display: none;
  flex-direction: column;
  gap: 14px;
}

.panel.active {
  display: flex;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.panel-title {
  font-size: 17px;
  font-weight: 600;
}

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

.panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 14px;
}

/* Cards, lists */
.card {
  border-radius: 16px;
  background: #050816;
  border: 1px solid rgba(72, 94, 255, 0.25);
  padding: 13px 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.card-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(240, 190, 76, 0.16);
  border: 1px solid rgba(240, 190, 76, 0.55);
  color: #ffe39a;
}

.pill-small {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(13, 20, 60, 0.9);
  border: 1px solid rgba(122, 140, 255, 0.6);
  color: #d7e1ff;
}

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

.list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-item {
  border-radius: 13px;
  background: #050816;
  border: 1px solid rgba(77, 101, 255, 0.35);
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

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

.list-item-title {
  font-weight: 600;
}

.list-item-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(4, 11, 40, 0.95);
  border: 1px solid rgba(122, 140, 255, 0.7);
  color: #d7e1ff;
}

.badge-soft {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(11, 41, 24, 0.9);
  border: 1px solid rgba(88, 204, 2, 0.7);
  color: #c8ffc0;
}

.list-item-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  align-items: center;
  gap: 6px;
}

.list-item-actions {
  display: flex;
  gap: 6px;
}

/* Info bar */
.info-bar {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(4, 10, 35, 0.9);
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px dashed rgba(128, 150, 255, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}

.info-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffd65b;
}

.text-success {
  color: #7dff8a;
}

.text-danger {
  color: var(--danger);
}

/* Responsive */
@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .panel-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
