/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1117;
    --bg-card: #181a20;
    --bg-input: #1e2028;
    --border: #2a2d38;
    --text: #d1d5e0;
    --text-muted: #7a8099;
    --accent: #4f8cff;
    --accent-hover: #6aa0ff;
    --danger: #e05252;
    --danger-hover: #f06060;
    --success: #3dbd6e;
    --warning: #e0a830;
    --radius: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

html { font-size: 14px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }

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

/* ── Layout ──────────────────────────────────────── */
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1.5rem; background: var(--bg-card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.app-header h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: -.02em; }
.app-header h1 span { color: var(--accent); }
.app-header nav { display: flex; align-items: center; gap: 1rem; }
.app-header nav a { color: var(--text-muted); font-size: .85rem; }
.app-header nav a:hover { color: var(--text); text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* ── Cards ───────────────────────────────────────── */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 1rem; font-weight: 600; }

/* ── Tables ──────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
    text-align: left; padding: .5rem .75rem; font-weight: 600; font-size: .75rem;
    text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
tbody td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: rgba(79, 140, 255, .04); }
tbody tr:last-child td { border-bottom: none; }

.mono { font-family: var(--mono); font-size: .85rem; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .85rem; font-size: .85rem; font-weight: 500;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-input); color: var(--text); cursor: pointer;
    transition: all .15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover { background: rgba(224, 82, 82, .1); border-color: var(--danger); }

.btn-sm { padding: .25rem .5rem; font-size: .8rem; }

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: .85rem; }
.form-group label { display: block; font-size: .8rem; font-weight: 500; margin-bottom: .25rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: .45rem .65rem; font-size: .9rem; font-family: var(--font);
    background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius); outline: none; transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent);
}
.form-group select { cursor: pointer; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 .75rem; }

.form-inline { display: flex; gap: .5rem; align-items: flex-end; }
.form-inline .form-group { margin-bottom: 0; flex: 1; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
    padding: .65rem 1rem; border-radius: var(--radius); font-size: .85rem;
    margin-bottom: 1rem; border: 1px solid;
}
.alert-error { background: rgba(224,82,82,.1); border-color: rgba(224,82,82,.3); color: var(--danger); }
.alert-success { background: rgba(61,189,110,.1); border-color: rgba(61,189,110,.3); color: var(--success); }
.alert-warning { background: rgba(224,168,48,.1); border-color: rgba(224,168,48,.3); color: var(--warning); }

/* ── Login Page ──────────────────────────────────── */
.login-wrap {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-box { width: 340px; }
.login-box h1 { text-align: center; margin-bottom: 1.5rem; font-size: 1.3rem; }
.login-box h1 span { color: var(--accent); }
.login-box .btn { width: 100%; justify-content: center; margin-top: .5rem; }

/* ── Badges ──────────────────────────────────────── */
.badge {
    display: inline-block; padding: .15rem .45rem; font-size: .75rem; font-weight: 600;
    border-radius: 3px; font-family: var(--mono); letter-spacing: .03em;
}
.badge-a { background: rgba(79,140,255,.15); color: var(--accent); }
.badge-aaaa { background: rgba(155,89,255,.15); color: #9b59ff; }
.badge-cname { background: rgba(61,189,110,.15); color: var(--success); }
.badge-mx { background: rgba(224,168,48,.15); color: var(--warning); }
.badge-ns { background: rgba(255,140,50,.15); color: #ff8c32; }
.badge-txt { background: rgba(120,120,140,.2); color: var(--text-muted); }
.badge-soa { background: rgba(224,82,82,.15); color: var(--danger); }
.badge-srv { background: rgba(79,200,255,.15); color: #4fc8ff; }
.badge-ptr { background: rgba(200,140,255,.15); color: #c88cff; }
.badge-default { background: rgba(120,120,140,.15); color: var(--text-muted); }

/* ── Misc ────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mb-1 { margin-bottom: .5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: .35rem; }

.empty-state {
    text-align: center; padding: 2rem; color: var(--text-muted); font-size: .9rem;
}

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6);
    z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; width: 480px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 1rem; font-size: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* ── Breadcrumbs ─────────────────────────────────── */
.breadcrumbs { font-size: .85rem; margin-bottom: 1rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 .35rem; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .modal { width: 100%; margin: 1rem; }
    table { font-size: .8rem; }
}
