:root {
  --bg: #07051a;
  --bg-soft: #0d0a28;
  --bg-card: #080618;
  --accent: #c4b5fd;
  --accent-soft: rgba(109, 40, 217, 0.14);
  --text: #e5e7eb;
  --text-muted: #9e9caf;
  --border-subtle: rgba(157, 148, 200, 0.22);
  --shadow-soft: 0 18px 45px rgba(10, 8, 40, 0.85);
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #07051a 0, #05021d 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

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

/* Layout */

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  gap: 16px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  /* Full-width sticky nav bar */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 14px;
    backdrop-filter: blur(20px);
  }

  .sidebar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    gap: 0;
    flex-wrap: nowrap;
    min-height: 0;
  }

  /* Logo stays left */
  .logo {
    flex-shrink: 0;
  }

  .logo-text {
    font-size: 0.8rem;
  }

  /* Nav pills centered */
  nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
  }

  .nav-label {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin-top: 0;
  }

  .nav-item {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 999px;
  }

  /* Avatar pill on the right, text hidden */
  .sidebar-bottom {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
  }

  .user-pill {
    padding: 4px 6px;
    gap: 0;
  }

  .user-name,
  .user-tag,
  #current-time {
    display: none;
  }
}

/* Sidebar */

.sidebar {
  backdrop-filter: blur(18px);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, rgba(99, 80, 220, 0.09), transparent 55%),
    radial-gradient(circle at bottom right, rgba(120, 80, 210, 0.07), transparent 50%),
    #05021d;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 18px 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}


.logo-text {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #e5e7eb;
}

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

.nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 99px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
  cursor: pointer;
}

.nav-item.active {
  background: linear-gradient(
    120deg,
    rgba(132, 21, 121, 0.16),
    rgba(120, 45, 212, 0.06)
  );
  color: var(--text);
}

.nav-item:hover {
  background: rgba(34, 16, 66, 0.9);
  color: var(--text);
  transform: translateY(-1px);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.nav-dot.muted {
  background: rgba(148, 163, 184, 0.9);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
}

.sidebar-bottom {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148, 163, 184, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 12px;
  row-gap: 8px;
  flex-wrap: wrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #e5e7eb 0, #6b7280 30%, #111827 70%);
}

.user-name {
  font-size: 0.78rem;
}

.user-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pill-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.7);
  color: #ddd6fe;
}

/* Main content */

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-kicker {
  font-size: 1.3rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}

.page-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 7px 13px;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.15s ease, transform 0.08s ease,
    box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: rgba(30, 64, 175, 0.25);
  border-color: rgba(129, 140, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.5);
  transform: translateY(-1px);
}

.btn-primary {
  border-color: rgba(139, 92, 246, 1);
  background: linear-gradient(120deg, #7c3aed, #a78bfa);
  color: #f5f3ff;
  font-weight: 550;
  box-shadow: 0 15px 35px rgba(109, 40, 217, 0.45);
}

.btn-primary:hover {
  background: linear-gradient(120deg, #6d28d9, #7c3aed);
  box-shadow: 0 20px 40px rgba(109, 40, 217, 0.6);
}

/* Grid */

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

.card {
  grid-column: span 4;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, rgba(99, 80, 220, 0.09), transparent 55%),
    radial-gradient(circle at bottom right, rgba(120, 80, 210, 0.07), transparent 50%),
    #05021d;
  box-shadow: var(--shadow-soft);
  padding: 14px 16px 13px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 900px) {
  .card {
    grid-column: span 12;
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-muted);
}

.metric {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 600;
}

.metric-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.18);
  color: #ddd6fe;
  border: 1px solid rgba(167, 139, 250, 0.7);
  margin-top: 1px;
}

.metric-change.down {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.8);
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Wider card */

.card-wide {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 900px) {
  .card-wide {
    grid-column: span 12;
  }
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 0.75rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-muted);
}

.chip.accent {
  background: rgba(109, 40, 217, 0.16);
  border-color: rgba(167, 139, 250, 0.85);
  color: #ddd6fe;
}

/* Simple placeholder chart */

.chart {
  margin-top: 4px;
  width: 100%;
  height: 130px;
  border-radius: 999px;
  background: radial-gradient(circle at 10% 0, rgba(96, 165, 250, 0.45), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(139, 92, 246, 0.4), transparent 55%),
    linear-gradient(120deg, #0a0820, #080618);
  position: relative;
  overflow: hidden;
}

.chart-line {
  position: absolute;
  inset: 12% 6%;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.12);
}

.chart-glow {
  position: absolute;
  left: 10%;
  top: 40%;
  width: 40%;
  height: 120%;
  background: radial-gradient(circle at 10% 0, rgba(248, 250, 252, 0.7), transparent 60%);
  filter: blur(22px);
  opacity: 0.7;
}

.chart-labels {
  position: absolute;
  inset: auto 12px 6px 12px;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.85);
}

/* Table */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 0.8rem;
}

.table th,
.table td {
  padding: 6px 4px;
  text-align: left;
}

.table th {
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.table tr + tr td {
  border-top: 1px solid rgba(30, 41, 59, 0.9);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin-right: 6px;
  display: inline-block;
}

.status-on {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.status-off {
  background: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
}

.status-paused {
  background: #6b7280;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.4);
}

.badge-soft {
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-muted);
}

.text-right {
  text-align: right;
}

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

/* Link List Styles */

.link-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.link-item:hover {
  background: rgba(15, 10, 50, 0.9);
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25);
}

.link-icon {
  font-size: 1.4rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.link-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Weather Widget */

.weather-container {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.weather-main {
  flex: 1;
}

.weather-temp {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.weather-desc {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.weather-location {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.weather-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}

.weather-stat {
  text-align: center;
}

.weather-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.weather-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 900px) {
  .weather-container {
    flex-direction: column;
  }
  
  .weather-stats {
    justify-content: space-around;
  }
}

/* Notes Area */

.notes-area {
  width: 100%;
  min-height: 120px;
  margin-top: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.notes-area:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(12, 8, 35, 0.8);
}

.notes-area::placeholder {
  color: var(--text-muted);
}