/* ============================================================
   NCA Domain Registry — Design System
   ------------------------------------------------------------
   Identity: an operations console for national domain
   infrastructure. Calm, dense, trustworthy. Deep petrol-teal
   as the institutional anchor, a signal-amber for things that
   need attention, and a paper-white canvas for long data
   sessions. Type: Space Grotesk for display/numerals (a
   technical, engineered feel), Inter for body/data.
   ============================================================ */

:root {
    /* Core palette */
    --petrol-900: #0b2b30;
    --petrol-800: #10393f;
    --petrol-700: #16505a;
    --petrol-600: #1d6b78;
    --petrol-500: #2a8b99;
    --petrol-100: #d7ebee;
    --petrol-050: #eef6f7;

    --sand-500: #c98a3a;
    --sand-400: #dba24f;
    --sand-100: #f6e8d2;

    --ink-900: #0f1720;
    --ink-700: #33414d;
    --ink-500: #5b6b78;
    --ink-400: #8595a2;
    --ink-200: #d9e0e6;
    --ink-100: #eef2f5;
    --paper:   #f7f9fa;
    --white:   #ffffff;

    /* Semantic */
    --ok:      #1f9d6b;
    --ok-bg:   #e2f5ec;
    --warn:    #c98a3a;
    --warn-bg: #f9edd8;
    --danger:  #d1495b;
    --danger-bg:#fae3e6;
    --muted:   #8595a2;
    --muted-bg:#eef2f5;

    --radius:   10px;
    --radius-sm: 7px;
    --shadow-sm: 0 1px 2px rgba(15,23,32,.06), 0 1px 3px rgba(15,23,32,.04);
    --shadow-md: 0 4px 12px rgba(15,23,32,.08);
    --shadow-lg: 0 12px 32px rgba(15,23,32,.12);

    --sidebar-w: 244px;
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--paper);
    color: var(--ink-900);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--petrol-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; }

/* Numerals & data use the display face for a technical feel */
.mono, .metric-value, .data-num {
    font-family: 'Space Grotesk', monospace;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Layout shell
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--petrol-900);
    color: #cfe3e6;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 30;
}
.sidebar__brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar__brand .mark {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--white);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 9px;
}
.sidebar__brand .mark .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--sand-400);
    box-shadow: 0 0 0 4px rgba(219,162,79,.18);
}
.sidebar__brand .sub {
    font-size: 11px; color: #7fa3a8; margin-top: 4px; letter-spacing: .02em;
}

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav__label {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
    color: #5e858a; padding: 14px 12px 6px; font-weight: 600;
}
.nav__item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: #b4d0d4; font-weight: 500; font-size: 13.5px;
    margin-bottom: 2px; transition: background .12s, color .12s;
}
.nav__item:hover { background: rgba(255,255,255,.06); color: var(--white); text-decoration: none; }
.nav__item.is-active { background: var(--petrol-600); color: var(--white); }
.nav__item .ico { width: 17px; height: 17px; flex: none; opacity: .9; }

.sidebar__foot {
    padding: 14px; border-top: 1px solid rgba(255,255,255,.07);
    font-size: 12px;
}
.userchip { display: flex; align-items: center; gap: 10px; }
.userchip .avatar {
    width: 32px; height: 32px; border-radius: 8px; flex: none;
    background: var(--petrol-600); color: #fff;
    display: grid; place-items: center; font-weight: 600;
    font-family: 'Space Grotesk', sans-serif; font-size: 13px;
}
.userchip .meta { line-height: 1.25; min-width: 0; }
.userchip .meta .nm { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip .meta .rl { color: #7fa3a8; font-size: 11px; text-transform: capitalize; }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
    height: 60px;
    background: var(--white);
    border-bottom: 1px solid var(--ink-200);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px;
    position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 18px; font-weight: 600; }
.topbar__title .crumb { color: var(--ink-400); font-weight: 500; font-size: 13px; display: block; margin-bottom: 1px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 26px; width: 100%; margin: 0 auto; }
/* On very wide screens, allow a generous cap so content fills the space
   but stays readable; below that it's fully fluid. */
@media (min-width: 1600px) {
    .content { max-width: 1720px; padding: 30px 40px; }
}
@media (min-width: 2200px) {
    .content { max-width: 2000px; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600; font-family: inherit;
    border: 1px solid transparent; cursor: pointer;
    transition: background .12s, border-color .12s, transform .04s;
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--petrol-600); color: #fff; }
.btn--primary:hover { background: var(--petrol-700); text-decoration: none; }
.btn--ghost { background: var(--white); color: var(--ink-700); border-color: var(--ink-200); }
.btn--ghost:hover { background: var(--ink-100); text-decoration: none; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #b93c4d; text-decoration: none; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn .ico { width: 15px; height: 15px; }

/* ============================================================
   Cards & metrics
   ============================================================ */
.card {
    background: var(--white);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card__head {
    padding: 15px 18px; border-bottom: 1px solid var(--ink-100);
    display: flex; align-items: center; justify-content: space-between;
}
.card__head h3 { font-size: 14.5px; }
.card__head .sub { font-size: 12px; color: var(--ink-400); }
.card__body { padding: 18px; }

.metric-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px; margin-bottom: 22px;
}
.metric {
    background: var(--white); border: 1px solid var(--ink-200);
    border-radius: var(--radius); padding: 17px 18px;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.metric::after {
    content:''; position:absolute; left:0; top:0; bottom:0; width:3px;
    background: var(--petrol-500);
}
.metric.is-ok::after     { background: var(--ok); }
.metric.is-warn::after   { background: var(--warn); }
.metric.is-danger::after { background: var(--danger); }
.metric.is-sand::after   { background: var(--sand-400); }
.metric__label { font-size: 12px; color: var(--ink-500); font-weight: 500; }
.metric__value {
    font-family: 'Space Grotesk', sans-serif; font-weight: 600;
    font-size: 30px; line-height: 1.1; margin-top: 6px; color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}
.metric__foot { font-size: 11.5px; color: var(--ink-400); margin-top: 5px; }

/* ---- Colorful metric cards (soft-tinted backgrounds) ---- */
.metric--emerald { background: linear-gradient(135deg, #eafaf1 0%, #dff5e9 100%); border-color: #bce6cf; }
.metric--emerald::after { background: #1f9d6b; }
.metric--emerald .metric__value { color: #10794f; }

.metric--teal { background: linear-gradient(135deg, #e6f6f8 0%, #d7eef2 100%); border-color: #b6dfe6; }
.metric--teal::after { background: #1d6b78; }
.metric--teal .metric__value { color: #145560; }

.metric--amber { background: linear-gradient(135deg, #fdf3e0 0%, #fae9cd 100%); border-color: #f0d6a8; }
.metric--amber::after { background: #d9902f; }
.metric--amber .metric__value { color: #a5651a; }

.metric--coral { background: linear-gradient(135deg, #fdebed 0%, #fadfe3 100%); border-color: #f2c2c9; }
.metric--coral::after { background: #d1495b; }
.metric--coral .metric__value { color: #a5303f; }

.metric--blue { background: linear-gradient(135deg, #e9f0fb 0%, #dbe7f8 100%); border-color: #bfd3f0; }
.metric--blue::after { background: #3b6cc4; }
.metric--blue .metric__value { color: #2b5199; }

.metric--slate { background: linear-gradient(135deg, #eef1f5 0%, #e3e8ef 100%); border-color: #cdd6e0; }
.metric--slate::after { background: #64748b; }
.metric--slate .metric__value { color: #46536b; }

.metric__icon {
    position: absolute; right: 14px; top: 14px; width: 30px; height: 30px;
    border-radius: 8px; display: grid; place-items: center; opacity: .9;
}
.metric__icon svg { width: 17px; height: 17px; }

/* ---- Grouped stat strips (compact, related numbers together) ---- */
.stat-strips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-strip {
    background: var(--white);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
}
.stat-strip__title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-400); font-weight: 600; margin-bottom: 11px;
    display: flex; align-items: center; justify-content: space-between;
}
.stat-strip__title a { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.stat-strip__row { display: flex; gap: 6px; }
.stat-cell { flex: 1; min-width: 0; }
.stat-cell__value {
    font-family: 'Space Grotesk', sans-serif; font-weight: 600;
    font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums;
    display: flex; align-items: baseline; gap: 5px;
}
.stat-cell__value .pct { font-size: 12px; font-weight: 500; color: var(--ink-400); }
.stat-cell__label {
    font-size: 11.5px; color: var(--ink-500); margin-top: 4px;
    display: flex; align-items: center; gap: 5px;
}
.stat-cell__label .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.stat-strip__divider { width: 1px; background: var(--ink-100); margin: 2px 4px; flex: none; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
    text-align: left; font-weight: 600; color: var(--ink-500);
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    padding: 10px 14px; border-bottom: 1px solid var(--ink-200);
    background: var(--paper); white-space: nowrap;
}
table.data tbody td {
    padding: 11px 14px; border-bottom: 1px solid var(--ink-100);
    vertical-align: middle;
}
table.data tbody tr:hover { background: var(--petrol-050); }
table.data tbody tr:last-child td { border-bottom: none; }
.data .domain-cell { font-weight: 600; color: var(--ink-900); }
.data .domain-cell .fullname { display:block; font-weight:400; color: var(--ink-400); font-size: 11.5px; margin-top:1px; }

/* ============================================================
   Badges / pills
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok     { background: var(--ok-bg);     color: #157a51; }
.badge--warn   { background: var(--warn-bg);   color: #9a6a24; }
.badge--danger { background: var(--danger-bg); color: #a5303f; }
.badge--muted  { background: var(--muted-bg);  color: #5b6b78; }

.tag-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
    color: #fff;
}

/* Freshness dot */
.fresh-ind { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color: var(--ink-400); }
.fresh-ind .fdot { width:7px; height:7px; border-radius:50%; }
.fresh-ind.fresh .fdot { background: var(--ok); }
.fresh-ind.aging .fdot { background: var(--warn); }
.fresh-ind.stale .fdot { background: var(--danger); }

/* ============================================================
   Forms
   ============================================================ */
.field { margin-bottom: 15px; }
.field label { display:block; font-size:12.5px; font-weight:600; color: var(--ink-700); margin-bottom:5px; }
.input, .select, .textarea {
    width: 100%; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
    border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
    background: var(--white); color: var(--ink-900);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--petrol-500);
    box-shadow: 0 0 0 3px rgba(42,139,153,.14);
}
.textarea { resize: vertical; min-height: 80px; }
.select--sm { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.form-row { display:grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* ============================================================
   Toolbar / filters
   ============================================================ */
.toolbar {
    display:flex; align-items:center; gap:10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar .search {
    flex: 1; min-width: 220px; position: relative;
}
.toolbar .search input {
    width:100%; padding: 9px 12px 9px 34px; border:1px solid var(--ink-200);
    border-radius: var(--radius-sm); font-size:13.5px; background:var(--white);
}
.toolbar .search .ico { position:absolute; left:11px; top:50%; transform:translateY(-50%); color: var(--ink-400); width:16px; height:16px; }

/* ============================================================
   Flash messages
   ============================================================ */
.flash { padding: 11px 15px; border-radius: var(--radius-sm); font-size:13px; margin-bottom: 14px; font-weight: 500; border:1px solid transparent; }
.flash--success { background: var(--ok-bg); color:#157a51; border-color:#bce6d4; }
.flash--error   { background: var(--danger-bg); color:#a5303f; border-color:#f2c5cc; }
.flash--info    { background: var(--petrol-050); color: var(--petrol-700); border-color: var(--petrol-100); }

/* ============================================================
   Login page
   ============================================================ */
.login-wrap {
    min-height: 100vh; display: grid; place-items: center;
    background:
      radial-gradient(1200px 600px at 15% -10%, rgba(42,139,153,.14), transparent 60%),
      radial-gradient(900px 500px at 110% 110%, rgba(219,162,79,.10), transparent 55%),
      var(--petrol-900);
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 400px; background: var(--white);
    border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-card__head { padding: 30px 30px 6px; }
.login-card__head .mark { display:flex; align-items:center; gap:10px; font-family:'Space Grotesk'; font-weight:700; font-size:19px; color: var(--petrol-800); }
.login-card__head .mark .dot { width:11px;height:11px;border-radius:50%;background:var(--sand-400); }
.login-card__head p { color: var(--ink-400); font-size:13px; margin: 8px 0 0; }
.login-card__body { padding: 22px 30px 30px; }

/* ============================================================
   Misc utilities
   ============================================================ */
.grid-2 { display:grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-halves { display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.muted { color: var(--ink-400); }
.mt-0{margin-top:0}.mb-0{margin-bottom:0}
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing:.06em; color: var(--ink-400); font-weight:600; margin: 26px 0 12px; }
.empty {
    text-align:center; padding: 46px 20px; color: var(--ink-400);
}
.empty .big { font-family:'Space Grotesk'; font-size: 15px; color: var(--ink-500); margin-bottom: 5px; font-weight:600; }
.pagination { display:flex; gap:6px; margin-top: 16px; justify-content:flex-end; }
.pagination a, .pagination span {
    padding: 6px 11px; border-radius: 6px; font-size: 12.5px; font-weight:600;
    border: 1px solid var(--ink-200); color: var(--ink-700); background: var(--white);
}
.pagination .is-current { background: var(--petrol-600); color:#fff; border-color: var(--petrol-600); }
.kv { display:grid; grid-template-columns: 150px 1fr; gap: 3px 14px; font-size: 13px; }
.kv dt { color: var(--ink-400); padding: 7px 0; }
.kv dd { margin:0; padding: 7px 0; border-bottom: 1px solid var(--ink-100); }

/* Responsive */
/* Tablets / small laptops: stack the two-column rows before full mobile */
@media (max-width: 1100px) {
    .grid-2, .grid-halves { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.is-open { transform: none; }
    .main { margin-left: 0; }
    .grid-2, .grid-halves, .form-row { grid-template-columns: 1fr; }
    .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }

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