@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #0a0c10;
  --bg-surface: #121419;
  --bg-elevated: #171a21;
  --bg-hover: #1c1f27;
  --bg-input: #0f1116;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);

  --accent: #10b981;
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.1);
  --accent-border: rgba(16, 185, 129, 0.35);
  --accent-text: #34d399;

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);

  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);

  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.1);

  --cyan: #06b6d4;
  --cyan-soft: rgba(6, 182, 212, 0.08);
  --cyan-border: rgba(6, 182, 212, 0.4);
  --cyan-text: #22d3ee;

  --text-primary: #f5f7fa;
  --text-secondary: #8b94a3;
  --text-muted: #5c6470;
  --text-dim: #3d434d;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  padding: 32px 20px;
  letter-spacing: -0.005em;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; color: var(--text-primary); }
code, pre { font-family: 'JetBrains Mono', monospace; }
a { color: var(--accent-text); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent); }

/* ── Layout ── */
.container {
  max-width: 620px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-md);
}
.container.wide { max-width: 1100px; }
.container.dashboard { max-width: 1200px; }

/* ── Header ── */
header {
  position: relative;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.logout {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  transition: all 0.15s var(--ease);
  text-decoration: none;
}
.logout:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.logout.danger:hover {
  color: #f87171;
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

/* ── Alerts ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  margin-bottom: 16px;
  border: 1px solid;
  color: var(--text-secondary);
}
.alert strong { color: var(--text-primary); font-weight: 600; }
.alert-success { background: var(--accent-soft); border-color: var(--accent-border); }
.alert-success strong { color: var(--accent-text); }
.alert-error { background: var(--danger-soft); border-color: var(--danger-border); }
.alert-error strong { color: #f87171; }
.alert-info { background: var(--info-soft); border-color: rgba(59, 130, 246, 0.3); }

/* ── Cards ── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }
.card h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.card.pending-card {
  border-color: var(--warning-border);
  background: linear-gradient(180deg, var(--warning-soft), var(--bg-elevated));
}
.card.pending-card h2::before { background: var(--warning); }

/* ── Grids ── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 720px) { .grid, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Form Fields ── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="number"],
.field input[type="datetime-local"],
.field select,
.field textarea,
.field input[type="file"],
.field input:disabled {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s var(--ease);
}
.field textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 90px;
}
.field input:hover:not(:disabled),
.field textarea:hover,
.field select:hover { border-color: var(--border-strong); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input:disabled { opacity: 0.5; cursor: not-allowed; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field small { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 5px; }
.field input[type="number"] { -moz-appearance: textfield; }
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.65); cursor: pointer; }
.field input[type="file"] { cursor: pointer; padding: 6px; }
.field input[type="file"]::file-selector-button {
  padding: 6px 12px;
  margin-right: 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease);
}
.field input[type="file"]::file-selector-button:hover { background: var(--accent-hover); }

.select-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.select-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-input option { background: var(--bg-elevated); color: var(--text-primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  margin-top: 6px;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.btn-warn { background: var(--danger); border-color: var(--danger); }
.btn.btn-warn:hover { background: #dc2626; border-color: #dc2626; }

.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  line-height: 1.3;
}
.btn-mini:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.btn-mini.danger { color: #f87171; }
.btn-mini.danger:hover { background: var(--danger-soft); border-color: var(--danger-border); color: #fca5a5; }
.btn-mini.success { color: var(--accent-text); }
.btn-mini.success:hover { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.btn-mini.warn { color: #fbbf24; }
.btn-mini.warn:hover { background: var(--warning-soft); border-color: var(--warning-border); }

/* ── Quick Action Buttons ── */
.quick-buttons { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.quick-buttons button {
  flex: 1;
  min-width: 100px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.quick-buttons button:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

/* ── Lists ── */
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.15s var(--ease);
}
.user-row:hover { border-color: var(--border-default); background: var(--bg-hover); }
.user-row.disabled { opacity: 0.55; }
.user-row.pending-row {
  border-color: var(--warning-border);
  background: linear-gradient(90deg, var(--warning-soft), var(--bg-surface));
}
.user-row.active-row {
  border-color: var(--accent-border);
  background: linear-gradient(90deg, var(--accent-soft), var(--bg-surface));
  position: relative;
}
.user-row.active-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.user-row.dead-row { border-color: rgba(239, 68, 68, 0.2); }
.user-row.offline-row { opacity: 0.6; }

.user-info { flex: 1; min-width: 0; }
.user-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.user-name strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.user-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
}
.user-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  padding-left: 10px;
  border-left: 2px solid var(--border-default);
  line-height: 1.5;
}

/* ── Status Dots ── */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.on { background: var(--accent); }
.dot.off { background: var(--danger); }
.dot.pending { background: var(--warning); }
.dot.dead { background: var(--danger); }
.dot.offline { background: var(--text-muted); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-cyan {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.badge-green {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}
.badge-red {
  background: var(--danger-soft);
  color: #f87171;
  border: 1px solid var(--danger-border);
}
.badge-amber {
  background: var(--warning-soft);
  color: #fbbf24;
  border: 1px solid var(--warning-border);
}

.user-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

.empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 20px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

/* ── Inline Forms ── */
.approve-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-date, .inline-num, .inline-text {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s var(--ease);
}
.inline-date { width: 185px; }
.inline-num { width: 65px; }
.inline-text { width: 120px; }
.inline-date:focus, .inline-num:focus, .inline-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* ── Status Card ── */
.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  border: 1px solid;
}
.status-card.active { background: var(--accent-soft); border-color: var(--accent-border); }
.status-card.inactive { background: var(--danger-soft); border-color: var(--danger-border); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-card.active .status-dot { background: var(--accent); }
.status-card.inactive .status-dot { background: var(--danger); }
.status-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}
.status-card.active strong { color: var(--accent-text); }
.status-card.inactive strong { color: #f87171; }
.status-card span {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Info Tiles ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.info-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.info-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
  transition: border-color 0.15s var(--ease);
}
.info-tile:hover { border-color: var(--border-default); }
.info-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.info-value.green { color: var(--accent-text); }
.info-value.amber { color: #fbbf24; }
.info-value.red { color: #f87171; }

/* ── Action Tiles ── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.action-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.15s var(--ease);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: center;
}
.action-tile:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.action-icon {
  font-size: 22px;
  line-height: 1;
  filter: brightness(1.1);
}
.action-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.4;
}
.action-tile:hover .action-label { color: var(--text-primary); }
.action-tile small { font-size: 11px; color: var(--text-muted); }

/* ── Dashboard Desktop Grid ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .dash-col-left, .dash-col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

/* ── Login / Signup ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-box h1 {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 26px;
}
.login-box input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  margin-bottom: 10px;
  outline: none;
  transition: all 0.15s var(--ease);
}
.login-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-box input::placeholder { color: var(--text-dim); }
.login-box button {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  margin-top: 6px;
}
.login-box button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── Pricing Cards (signup) ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.pricing-card { position: relative; cursor: pointer; display: block; }
.pricing-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pricing-inner {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  transition: all 0.15s var(--ease);
}
.pricing-card:hover .pricing-inner { border-color: var(--border-strong); }
.pricing-card input:checked + .pricing-inner {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pricing-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.pricing-price {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.pricing-price .cur {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-right: 2px;
}
.pricing-duration { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.pricing-features { list-style: none; padding: 0; margin: 0; }
.pricing-features li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0 3px 16px;
  position: relative;
}
.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ── Plan Banner ── */
.plan-banner {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.plan-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  text-transform: uppercase;
  margin-bottom: 6px;
  padding: 2px 8px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
}
.plan-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.plan-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Toggle ── */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
}
.toggle input[type="checkbox"] { display: none; }
.slider {
  width: 36px;
  height: 20px;
  background: var(--bg-hover);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  position: relative;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: all 0.2s var(--ease);
}
.toggle input:checked + .slider {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.toggle input:checked + .slider::before {
  background: var(--accent);
  transform: translateX(16px);
}
.toggle-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ── Footer ── */
footer, .footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
footer a, .footer a { color: var(--accent-text); font-weight: 500; }
footer a:hover, .footer a:hover { color: var(--accent); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
::selection { background: var(--accent-soft); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   UPLOAD PROGRESS (user_sites.html)
   ═══════════════════════════════════════════════════════════ */

.upload-progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}
.upload-progress-list:empty { display: none; }

.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  transition: all 0.2s var(--ease);
}
.upload-item.uploading {
  border-color: var(--cyan-border);
  background: var(--cyan-soft);
}
.upload-item.success {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.upload-item.error {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.upload-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
}
.upload-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.upload-meta {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.upload-summary {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 13px;
  display: none;
  border: 1px solid;
}
.upload-summary.show { display: block; }
.upload-summary.ok {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-border);
}
.upload-summary.warn {
  background: var(--warning-soft);
  color: #fcd34d;
  border-color: var(--warning-border);
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(6, 182, 212, 0.3);
  border-top-color: var(--cyan-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════ */

.landing-body { padding: 0; background: var(--bg-base); }

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: #fff;
  font-size: 15px;
}
.logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-link {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s var(--ease);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--text-primary); background: var(--bg-elevated); }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.nav-btn-ghost {
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
}
.nav-btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.nav-btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.nav-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 7px 11px;
  border-radius: var(--radius-md);
  font-size: 16px;
  cursor: pointer;
}

.hero { padding: 90px 24px 70px; text-align: center; }
.hero-inner { max-width: 820px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 22px;
}
.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.hero-title {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.grad { color: var(--accent-text); }
.hero-subtitle {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 32px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 50px;
}
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s var(--ease);
}
.btn-hero-primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.btn-hero-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-hero-ghost {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}
.btn-hero-ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 640px;
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}
.stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section { padding: 72px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.section-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  transition: all 0.2s var(--ease);
}
.feature-card:hover { border-color: var(--border-default); background: var(--bg-elevated); }
.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.feature-icon svg { width: 20px; height: 20px; color: var(--accent-text); }
.feature-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.feature-desc { font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }

.pricing-grid-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}
.pricing-card-home {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  transition: all 0.2s var(--ease);
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-card-home:hover { border-color: var(--border-default); }
.pricing-card-home.featured {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-surface));
}
.popular-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 100px;
  white-space: nowrap;
}
.pricing-name-home {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pricing-price-home {
  font-size: 36px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.pricing-price-home .cur { font-size: 20px; font-weight: 500; color: var(--text-secondary); }
.pricing-price-home .period { font-size: 13.5px; font-weight: 500; color: var(--text-muted); }
.pricing-features-home { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.pricing-features-home li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 7px 0 7px 22px;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}
.pricing-features-home li:last-child { border-bottom: none; }
.pricing-features-home li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 7px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}
.btn-pricing {
  display: block;
  padding: 11px;
  text-align: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s var(--ease);
}
.btn-pricing:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.compare-wrap { margin-top: 64px; }
.compare-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-primary);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.compare-table th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12.5px;
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover { background: var(--bg-elevated); }
.compare-table td:first-child { color: var(--text-secondary); font-weight: 500; }
.compare-table .check { color: var(--accent-text); font-weight: 600; }

.faq-list { max-width: 740px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all 0.15s var(--ease);
}
.faq-item[open] { border-color: var(--border-default); background: var(--bg-elevated); }
.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-primary);
  list-style: none;
  position: relative;
  padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  padding: 0 20px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.cta-section { padding: 72px 24px; }
.cta-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
}
.cta-title {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.cta-desc { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 26px; }
.cta-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.landing-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px 24px;
  margin-top: 48px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0;
  transition: color 0.15s var(--ease);
}
.footer-col a:hover { color: var(--text-primary); }
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-desc { font-size: 13px; line-height: 1.6; color: var(--text-muted); max-width: 280px; }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.footer-bottom a { color: var(--text-secondary); }
.footer-bottom a:hover { color: var(--text-primary); }

@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 12px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 14px; font-size: 14px; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav-actions { display: none; }
  .hero { padding: 60px 20px 50px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  body { padding: 16px 12px; }
  .container { padding: 24px 18px; border-radius: var(--radius-lg); }
  .container.dashboard { padding: 20px 14px; }
  .login-box { padding: 28px 22px; }
  header h1 { font-size: 18px; }
  .info-grid, .info-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .action-grid, .action-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .user-row { flex-direction: column; align-items: stretch; }
  .user-actions { justify-content: flex-start; }
  .inline-date { width: 100%; }
  .inline-num, .inline-text { width: 100%; }
  .pricing-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 16px; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 14.5px; }
  .hero-actions { flex-direction: column; }
  .btn-hero { width: 100%; justify-content: center; }
  .cta-inner { padding: 36px 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .compare-table th, .compare-table td { padding: 10px 8px; font-size: 11.5px; }
  .pricing-grid-home { grid-template-columns: 1fr; }
  .upload-item { flex-wrap: wrap; }
  .upload-meta { width: 100%; text-align: right; }
}

/* ═══════════════════════════════════════════════════════════
   APP SHELL — Sidebar Layout
   ═══════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  text-decoration: none;
}
.sidebar-brand .logo-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}
.sidebar-brand .brand-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-section {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 10px 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s var(--ease);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.sidebar-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  position: relative;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.sidebar-link .icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-link .label { flex: 1; }
.sidebar-link .count {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-link.danger { color: var(--text-muted); }
.sidebar-link.danger:hover {
  color: #f87171;
  background: var(--danger-soft);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px 36px;
  overflow-x: hidden;
}
.main-inner {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Mobile Topbar ── */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.mobile-brand .logo-mark {
  width: 26px;
  height: 26px;
  font-size: 13px;
}
.mobile-brand .brand-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.mobile-toggle {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 15px;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 199;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .mobile-topbar { display: flex; }
  .sidebar-backdrop { display: block; opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease); }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    border-right: 1px solid var(--border-default);
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { padding: 20px 16px; }
}

@media (max-width: 600px) {
  .main-content { padding: 16px 12px; }
}
