:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #273449;
  --border: #334155;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: #1d3a6b;
  --accent: #38bdf8;
  --success: #22c55e;
  --success-soft: #14532d;
  --danger: #ef4444;
  --danger-soft: #7f1d1d;
  --warning: #f59e0b;
  --warning-soft: #78350f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --sidebar-w: 240px;
  --header-h: 56px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 0.82rem; color: var(--accent); font-family: monospace; }

/* LOGIN */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(ellipse at 60% 40%, #1a2e4a 0%, #0f172a 70%); }
.login-wrap { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo-icon { font-size: 2.2rem; color: var(--accent); }
.logo-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.logo-sub { font-size: 0.78rem; color: var(--text-muted); }
.login-hint { margin-top: 18px; text-align: center; color: var(--text-dim); font-size: 0.8rem; }

/* LAYOUT */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.sidebar-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-logo { font-size: 1.4rem; color: var(--accent); }
.sidebar-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.sidebar-sub { font-size: 0.72rem; color: var(--text-muted); }
.sidebar-section { padding: 14px 10px 6px; }
.sidebar-section-label { font-size: 0.67rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); padding: 0 8px; margin-bottom: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--text-muted); transition: all 0.15s; margin-bottom: 1px; border: none; background: none; width: 100%; text-align: left; font-size: 13.5px; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--accent); font-weight: 500; }
.nav-item .nav-icon { font-size: 0.88rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.user-name { font-weight: 600; font-size: 0.85rem; }
.user-role { font-size: 0.72rem; color: var(--text-muted); }

/* MAIN */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: var(--header-h); background: var(--bg2); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 12px; flex-shrink: 0; }
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.topbar-sub { font-size: 0.78rem; color: var(--text-muted); }
.topbar-spacer { flex: 1; }
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* CARDS & SECTIONS */
.page-section { display: none; }
.page-section.active { display: block; }
.section-header { margin-bottom: 20px; }
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.section-desc { font-size: 0.82rem; color: var(--text-muted); }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title .icon { font-size: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }

/* FORMS */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-full { grid-column: 1 / -1; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 8px 12px; color: var(--text); font-size: 13.5px; outline: none; transition: border 0.15s; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: var(--bg2); }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 7px; border: none; cursor: pointer; font-size: 13.5px; font-weight: 500; transition: all 0.15s; font-family: inherit; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-warning { background: var(--warning); color: #1c1917; }
.btn-warning:hover:not(:disabled) { background: #d97706; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ALERTS */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.83rem; margin-top: 10px; }
.alert-error { background: var(--danger-soft); border: 1px solid var(--danger); color: #fca5a5; }
.alert-success { background: var(--success-soft); border: 1px solid var(--success); color: #86efac; }
.alert-warning { background: var(--warning-soft); border: 1px solid var(--warning); color: #fcd34d; }
.alert-info { background: var(--primary-soft); border: 1px solid var(--primary); color: #93c5fd; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 12px; color: var(--text-muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.72rem; font-weight: 600; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--primary-soft); color: var(--accent); }
.badge-yellow { background: var(--warning-soft); color: var(--warning); }
.badge-gray { background: var(--bg3); color: var(--text-muted); }
.badge-orange { background: #431407; color: #fb923c; }

/* RESULT DISPLAY */
.result-box { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-top: 14px; font-size: 12.5px; color: var(--accent); font-family: monospace; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow-y: auto; }
.contact-section { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.contact-section-title { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; }

/* TABS */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; border-top: none; border-left: none; border-right: none; background: none; font-family: inherit; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* TLD LIST */
.tld-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tld-search { flex: 1; min-width: 180px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 14px; font-size: 13px; outline: none; transition: border-color 0.15s; }
.tld-search:focus { border-color: var(--primary); }
.tld-stats { font-size: 0.8rem; color: var(--text-muted); background: var(--bg3); border-radius: 8px; padding: 8px 14px; margin-bottom: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.tld-stats span { display: flex; align-items: center; gap: 5px; }
.price-cell { display: flex; flex-direction: column; gap: 1px; }
.price-usd { font-weight: 600; color: var(--text); font-size: 0.88rem; }
.price-zar { font-size: 0.76rem; color: var(--text-muted); }
.tld-name { font-weight: 700; color: var(--accent); font-family: monospace; font-size: 0.92rem; }

/* MISC */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.font-mono { font-family: monospace; }
.w-full { width: 100%; }

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