/*
  Design notes (kept here rather than left implicit):
  - Subject: internal back-office for a domain registration platform. Audience: admin staff
    processing registrations, pricing, suppliers - technical, detail-dense work.
  - Palette: graphite sidebar (#14161B) against a warm paper content area (#FBFAF7), a single
    indigo accent (#3454D1) for actions/links, amber (#C77B12) for warnings, muted red (#B3432B)
    for destructive/errors, green (#2F7D5C) for success/active states.
  - Type: Inter for UI text (clear at small sizes, dense tables), ui-monospace for anything
    that's technically an identifier - domain names, TLDs, IPs, action codes, invoice numbers -
    since that's the actual vocabulary of this tool and monospace makes those scannable in a table.
  - Signature: the sidebar header reads like a terminal prompt ("admin@registry:~$"), a quiet nod
    to the technical subject without being a gimmick applied elsewhere on the page.
*/

:root {
  --bg: #FBFAF7;
  --panel: #FFFFFF;
  --sidebar: #14161B;
  --sidebar-text: #C7CCD6;
  --sidebar-text-active: #FFFFFF;
  --border: #E4E1D8;
  --text: #1B1D22;
  --text-muted: #6B7078;
  --accent: #3454D1;
  --accent-hover: #2A44AD;
  --warning: #C77B12;
  --danger: #B3432B;
  --success: #2F7D5C;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--sidebar-text-active);
  padding: 0 20px 20px;
  border-bottom: 1px solid #262932;
  margin-bottom: 12px;
}
.sidebar-brand .cursor { color: var(--accent); }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar a {
  color: var(--sidebar-text);
  padding: 9px 20px;
  font-size: 13.5px;
  border-left: 3px solid transparent;
}
.sidebar a:hover { color: var(--sidebar-text-active); text-decoration: none; background: #1C1F27; }
.sidebar a.active {
  color: var(--sidebar-text-active);
  border-left-color: var(--accent);
  background: #1C1F27;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid #262932;
  font-size: 12.5px;
  color: #868D99;
}
.sidebar-footer form { margin-top: 8px; }
.sidebar-footer button {
  background: none; border: none; color: #868D99; font-size: 12.5px; cursor: pointer; padding: 0;
}
.sidebar-footer button:hover { color: var(--sidebar-text-active); text-decoration: underline; }

.main { flex: 1; padding: 32px 40px; max-width: 1100px; }

.page-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 20px; margin: 0; font-weight: 650; }
.page-header .subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #F1EFE8; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #93331F; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { background: #F4F2EC; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAF9F5; }
.mono { font-family: var(--mono); font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 90px; font-family: var(--mono); }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 13.5px; }
.alert-error { background: #FBEAE6; color: var(--danger); border: 1px solid #EFC9BE; }
.alert-success { background: #E9F5EF; color: var(--success); border: 1px solid #BFE3D0; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge-active { background: #E9F5EF; color: var(--success); }
.badge-disabled { background: #F1EFE8; color: var(--text-muted); }
.badge-pending { background: #FBF1E1; color: var(--warning); }
.badge-failed { background: #FBEAE6; color: var(--danger); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .btn { margin-top: 12px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar); }
.login-card { background: var(--panel); padding: 40px; border-radius: var(--radius); width: 340px; }
.login-card .sidebar-brand { color: var(--text); border: none; padding: 0 0 24px; margin: 0 0 20px; border-bottom: 1px solid var(--border); }
.login-card .sidebar-brand .cursor { color: var(--accent); }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: end; }
.filters .form-group { margin-bottom: 0; min-width: 160px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .main { padding: 20px; }
}
