:root {
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1a1a1a;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-muted: #666;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --onion: #a855f7;
  --radius: 6px;
  --font: 'Courier New', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--onion);
}

/* NAV */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 18px;
  font-weight: bold;
  color: var(--onion);
  text-decoration: none;
  letter-spacing: 2px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text);
}

/* CONTAINER */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1;
}

/* ALERTS */
.alerts { margin-bottom: 20px; }
.alert {
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
  border: 1px solid transparent;
}
.alert-success { background: #052e16; border-color: var(--success); color: #4ade80; }
.alert-danger  { background: #1f0909; border-color: var(--danger);  color: #f87171; }
.alert-warning { background: #1c1000; border-color: var(--warning); color: #fbbf24; }
.alert-info    { background: #0c1a2e; border-color: var(--info);    color: #60a5fa; }

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent);   color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg3);      color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline   { background: transparent;     color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger    { background: var(--danger);   color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success   { background: var(--success);  color: #fff; }
.btn-warning   { background: var(--warning);  color: #fff; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn-xs        { padding: 3px 7px;  font-size: 11px; }
.btn.disabled, .disabled { opacity: 0.4; pointer-events: none; }
.w-100         { width: 100%; text-align: center; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 12px; }
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* AUTH */
.auth-box {
  max-width: 420px;
  margin: 60px auto 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.auth-title { text-align: center; margin-bottom: 24px; color: var(--onion); letter-spacing: 3px; }
.auth-form { }
.auth-link { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.auth-link a { color: var(--accent); }

/* FORM BOX */
.form-box {
  max-width: 560px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}
.page-header h1 { font-size: 20px; }

/* STATS BAR */
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 120px;
}
.stat-value { display: block; font-size: 22px; font-weight: bold; color: var(--onion); }
.stat-label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* SITES GRID */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.site-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}
.site-card:hover { border-color: var(--accent); }
.site-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.site-name { font-weight: bold; font-size: 15px; }
.site-onion { font-size: 12px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; }
.site-meta { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; margin-bottom: 12px; }
.site-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.onion-link { color: var(--onion); font-size: 11px; }

/* STATUS DOT */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-active  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-pending { background: var(--warning); }
.status-suspended { background: var(--danger); }

/* BADGES */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
}
.badge-free      { background: #1a1a1a; color: #666; border: 1px solid #333; }
.badge-basic     { background: #0c1a2e; color: #60a5fa; border: 1px solid #2563eb; }
.badge-pro       { background: #1e0a3c; color: #c084fc; border: 1px solid #7c3aed; }
.badge-admin     { background: #1f0909; color: #f87171; border: 1px solid #dc2626; }
.badge-active    { background: #052e16; color: #4ade80; }
.badge-pending   { background: #1c1000; color: #fbbf24; }
.badge-paid      { background: #052e16; color: #4ade80; }
.badge-expired   { background: #1f0909; color: #f87171; }
.badge-suspended { background: #1f0909; color: #f87171; }

/* CARDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: bold;
  font-size: 13px;
  color: var(--text-muted);
}
.card-header.danger-zone { color: var(--danger); }
.card-body { padding: 16px; }

/* INFO TABLE */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.info-table td:first-child { color: var(--text-muted); width: 140px; font-size: 12px; }
.info-table tr:last-child td { border-bottom: none; }

/* DATA TABLE */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: normal;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: var(--bg2); }

/* FILE MANAGER */
.fm-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.fm-table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
.fm-table { width: 100%; border-collapse: collapse; }
.fm-table th {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  background: var(--bg3);
}
.fm-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.fm-table tr:last-child td { border-bottom: none; }
.fm-table .fm-dir td:first-child { font-weight: bold; }
.fm-name a { color: var(--text); }
.fm-name a:hover { color: var(--accent); }
.fm-size { color: var(--text-muted); font-size: 12px; }
.fm-actions { display: flex; gap: 4px; }
.panel-form {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--accent); }
.file-list { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.file-item { padding: 3px 0; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .form-control { flex: 1; margin: 0; }

/* EDITOR */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  margin-bottom: 8px;
}
.CodeMirror {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  font-family: var(--font) !important;
  font-size: 13px !important;
}

/* PLANS */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.plan-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.plan-card.plan-current { border-color: var(--accent); }
.plan-card.plan-featured { border-color: var(--onion); }
.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--onion);
  color: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
}
.plan-header { margin-bottom: 16px; }
.plan-name { display: block; font-size: 20px; font-weight: bold; letter-spacing: 2px; color: var(--onion); }
.plan-price { font-size: 24px; font-weight: bold; }
.plan-price small { font-size: 13px; color: var(--text-muted); }
.plan-features { list-style: none; margin-bottom: 16px; }
.plan-features li { padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.plan-features li:last-child { border-bottom: none; }

/* INVOICE */
.invoice-box {
  max-width: 560px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.invoice-status { text-align: center; font-size: 18px; margin-bottom: 20px; padding: 12px; border-radius: var(--radius); }
.status-paid     { background: #052e16; color: #4ade80; }
.status-expired  { background: #1f0909; color: #f87171; }
.status-pending  { background: #1c1000; color: #fbbf24; }
.invoice-details { margin-bottom: 20px; }
.payment-instructions h3 { margin-bottom: 12px; font-size: 15px; }
.payment-instructions ol { padding-left: 18px; margin-bottom: 12px; line-height: 2; }
.btc-address-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.btc-addr { word-break: break-all; font-size: 13px; }
.payment-timer { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 20px; }

/* INFO BOX */
.info-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.info-box ul { padding-left: 16px; margin-top: 6px; line-height: 1.8; }

/* SECTION TITLE */
.section-title { font-size: 16px; margin: 24px 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }

/* ADMIN NAV */
.admin-nav { display: flex; gap: 12px; flex-wrap: wrap; }

/* MODAL */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 320px;
}
.modal-box h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; }

/* PAGINATION */
.pagination { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* UTILITIES */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .container { padding: 16px 12px; }
  .navbar { padding: 0 12px; }
  .navbar-links { gap: 12px; }
  .sites-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
}
