/* DNS Manager – Standalone App */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #111; background: #f4f5f7; }

/* ── Nav ── */
.nav {
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 52px;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { font-size: 15px; font-weight: bold; color: #fff; white-space: nowrap; }
.nav-links  { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-links a {
    color: #ccc; text-decoration: none; padding: 6px 12px;
    font-size: 13px; border-radius: 0; transition: background .1s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Main ── */
.main { padding: 28px 24px; max-width: 1280px; margin: 0 auto; }
.main-centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: #f4f5f7; }
.main-centered .card { width: 100%; max-width: 400px; }

/* ── Cards ── */
.card { background: #fff; padding: 24px; border: 1px solid #e0e0e0; margin-bottom: 16px; }
.card h1 { font-size: 20px; margin-bottom: 6px; }
.card h2 { font-size: 16px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.subtitle { color: #666; font-size: 13px; margin-bottom: 20px; }

/* ── Page header ── */
.page-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { font-size: 20px; flex: 1; }

/* ── Alerts ── */
.alert { padding: 10px 14px; border: 1px solid #ccc; margin-bottom: 16px; font-size: 13px; }
.alert-error   { background: #fff5f5; border-color: #f99; color: #c00; }
.alert-success { background: #f5fff8; border-color: #9d9; color: #060; }
.alert-info    { background: #f5f8ff; border-color: #99d; color: #336; }

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; color: #555; }
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=number],
.field input[type=date],
.field select,
.field textarea {
    padding: 8px 10px;
    border: 1px solid #bbb;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #111;
    background: #fff;
    border-radius: 0;
    -webkit-appearance: auto;
    appearance: auto;
    width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #444; outline: none; }
.checkboxes { display: flex; flex-direction: column; gap: 8px; }
.checkboxes label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: normal; text-transform: none; letter-spacing: 0; color: #111; cursor: pointer; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: #222; color: #fff; border: 1px solid #222;
    padding: 8px 16px; font-family: Arial, Helvetica, sans-serif;
    font-size: 13px; cursor: pointer; white-space: nowrap;
    text-decoration: none; line-height: 1.4; border-radius: 0;
    transition: background .1s;
}
.btn:hover       { background: #444; border-color: #444; color: #fff; }
.btn-ghost       { background: #fff; color: #222; border-color: #999; }
.btn-ghost:hover { background: #f5f5f5; color: #222; }
.btn-danger      { background: #fff; color: #c00; border-color: #c00; }
.btn-danger:hover{ background: #fff5f5; }
.btn-full        { width: 100%; justify-content: center; }
.btn-sm          { padding: 4px 10px; font-size: 12px; }
.btn:disabled    { opacity: .4; cursor: not-allowed; }

/* ── Tables ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
}
.table th {
    background: #222; color: #fff;
    text-align: left; padding: 9px 12px;
    font-size: 12px; font-weight: bold; white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid #eee; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:nth-child(even) td { background: #fafafa; }
.table tr:hover td { background: #f5f5f5; }
.action-btns { display: flex; gap: 6px; }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Badges ── */
.badge { display: inline-block; background: #c00; color: #fff; font-size: 11px; font-weight: bold; padding: 1px 6px; margin-left: 4px; }
.badge-action { display: inline-block; border: 1px solid #999; padding: 1px 7px; font-size: 11px; font-weight: bold; }
.record-badge { display: inline-block; border: 1px solid #999; background: #f0f0f0; padding: 1px 7px; font-size: 11px; font-weight: bold; min-width: 48px; text-align: center; }

/* ── Misc ── */
.hint    { color: #888; font-style: italic; }
.small   { font-size: 12px; color: #666; }
.mt-1    { margin-top: 12px; }
.mt-2    { margin-top: 24px; }
.text-center  { text-align: center; }
.text-success { color: #060; }
.input-code   { font-size: 24px; letter-spacing: .2em; text-align: center; }
.secret-code  { display: block; font-size: 13px; background: #f5f5f5; padding: 10px; word-break: break-all; margin-top: 4px; border: 1px solid #ddd; }
.totp-qr      { text-align: center; margin: 16px 0; }
.totp-qr img  { border: 4px solid #fff; box-shadow: 0 0 0 1px #ddd; }
.steps        { padding-left: 20px; margin-bottom: 16px; }
.steps li     { margin-bottom: 8px; font-size: 13px; color: #444; }
.info-table   { width: 100%; font-size: 13px; }
.info-table td { padding: 5px 0; border-bottom: 1px solid #f0f0f0; }
.info-table td:first-child { color: #666; width: 120px; }
.zone-list    { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
.zone-check   { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px; border: 1px solid #eee; font-size: 13px; }
.zone-check:hover { background: #f5f5f5; }
.zone-id      { color: #888; font-size: 11px; margin-left: auto; font-family: monospace; }
.table-check-list { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow-y: auto; }
.table-check-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* ── DNS App (same as plugin) ── */
#dns-app *, #dns-app { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #111; }
#zone-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid #ccc; padding-bottom: 12px; }
.zone-btn { background: #fff; border: 1px solid #999; color: #111; padding: 6px 16px; cursor: pointer; font-family: Arial, Helvetica, sans-serif; font-size: 13px; border-radius: 0; -webkit-appearance: none; }
.zone-btn:hover  { background: #f0f0f0; }
.zone-btn.active { background: #222; color: #fff; border-color: #222; }
.dns-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dns-toolbar h2 { font-size: 15px; font-weight: bold; flex: 1; }
.dns-search-wrap { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.dns-search-wrap input { flex: 1; padding: 6px 10px; border: 1px solid #ccc; font-family: Arial, Helvetica, sans-serif; font-size: 13px; border-radius: 0; }
.dns-search-wrap input:focus { border-color: #555; outline: none; }
.search-count { font-size: 12px; color: #888; }
.dns-msg { padding: 9px 14px; border: 1px solid #ccc; background: #fafafa; margin-bottom: 10px; font-size: 13px; display: none; }
.dns-msg.error   { background: #fff5f5; border-color: #f99; color: #c00; }
.dns-msg.success { background: #f5fff8; border-color: #9d9; color: #060; }
.dns-msg.pending { background: #fffbea; border-color: #c90; color: #664d00; }
.approval-notice { background: #fffbea; border: 1px solid #c90; color: #664d00; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.preset-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border: 1px solid #ddd; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; background: #f8f8f8; }
.table-wrap { overflow-x: auto; margin-bottom: 10px; }
.dns-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dns-table th { background: #222; color: #fff; text-align: left; padding: 9px 12px; font-size: 12px; font-weight: bold; white-space: nowrap; }
.dns-table th:nth-child(1), .dns-table td:nth-child(1) { min-width: 80px; width: 8%; }
.dns-table th:nth-child(4), .dns-table td:nth-child(4) { min-width: 90px; width: 9%; }
.dns-table td { padding: 9px 12px; border-bottom: 1px solid #e0e0e0; vertical-align: middle; word-break: break-all; background: #fff; }
.dns-table tr:nth-child(even) td { background: #fafafa; }
.dns-table tr:hover td { background: #f0f0f0; }
.dns-table tr.expiring td { background: #fffbea !important; }
.dns-table tr.hidden-row { display: none; }
.dns-badge { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: bold; border: 1px solid #999; background: #f0f0f0; color: #222; min-width: 52px; text-align: center; }
.proxy-on  { font-weight: bold; }
.proxy-off { color: #aaa; }
.lock-icon { color: #aaa; font-size: 11px; margin-left: 4px; }
.expiry-tag { font-size: 11px; background: #fffbea; border: 1px solid #c90; color: #664d00; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; }
.bulk-wrap  { overflow-x: auto; margin-bottom: 12px; }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #111; }
.bulk-table th { background: #222; color: #fff; text-align: left; padding: 9px 8px; font-size: 12px; font-weight: bold; white-space: nowrap; }
.bulk-table th:nth-child(1), .bulk-table td:nth-child(1) { min-width: 80px; width: 9%; }
.bulk-table th:nth-child(5), .bulk-table td:nth-child(5) { min-width: 100px; width: 10%; }
.bulk-table td { padding: 5px 4px; border-bottom: 1px solid #ccc; vertical-align: middle; background: #fff; }
.bulk-table tr:nth-child(even):not(.readonly-row) td { background: #f8f8f8; }
.bulk-table tr.readonly-row td { opacity: .55; background: #f5f5f5; }
.bulk-table tr.new-row td { background: #f5fff8; }
.bulk-table input[type=text], .bulk-table input[type=number], .bulk-table select { width: 100%; padding: 5px 7px; border: 1px solid #aaa; font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #111; background: #fff; border-radius: 0; }
.bulk-table input:focus, .bulk-table select:focus { border-color: #333; outline: none; background: #fff; }
.bulk-table input[disabled], .bulk-table select[disabled] { background: #eee; color: #777; cursor: not-allowed; }
.bulk-del-btn { background: none; border: none; color: #888; font-size: 15px; cursor: pointer; padding: 2px 6px; }
.bulk-del-btn:hover { color: #c00; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99999; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.overlay.open { display: flex; }

/* ── Brand color defaults (overridden by inline <style> from Settings) ── */
:root {
    --brand:      #2563eb;
    --brand-dark: #1d4ed8;
    --brand-text: #ffffff;
    --brand-light:#93c5fd;
}

/* ── Nav logo ── */
.nav-logo { max-height: 36px; max-width: 160px; object-fit: contain; display: block; }
.nav-brand { display: flex; align-items: center; color: var(--brand-text); text-decoration: none; font-size: 15px; font-weight: bold; white-space: nowrap; }

/* ── Impersonation bar ── */
.impersonate-bar {
    background: #fbbf24; color: #000;
    padding: 8px 20px; font-family: Arial, Helvetica, sans-serif;
    font-size: 13px; display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 200;
}
.impersonate-back {
    margin-left: auto; background: #222; color: #fff;
    padding: 4px 14px; text-decoration: none; font-size: 12px;
}

/* ── 2FA reminder ── */
.tofa-reminder {
    background: #fff7ed; border-bottom: 1px solid #fed7aa;
    color: #7c2d12; padding: 9px 20px;
    font-family: Arial, Helvetica, sans-serif; font-size: 13px;
    display: flex; align-items: center; gap: 12px;
}
.tofa-link { color: #7c2d12; font-weight: bold; margin-left: 4px; }
.tofa-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #7c2d12; margin-left: auto; padding: 0 4px; }

/* ── Zone tabs — improved contrast ── */
.zone-btn {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: rgba(255,255,255,.85);
    padding: 6px 16px; cursor: pointer;
    font-family: Arial, Helvetica, sans-serif; font-size: 13px;
    border-radius: 3px; -webkit-appearance: none;
    transition: background .1s, color .1s;
}
.zone-btn:hover  { background: rgba(255,255,255,.25); color: #fff; border-color: rgba(255,255,255,.6); }
.zone-btn.active { background: #fff; color: var(--brand); border-color: #fff; font-weight: bold; }

/* Make zone-nav sit on brand bg */
#zone-nav {
    background: var(--brand);
    margin: -28px -24px 20px -24px;
    padding: 12px 24px;
    display: flex; flex-wrap: wrap; gap: 6px;
    position: relative; z-index: 2;
}

/* ── DNS table action buttons — visible on white bg ── */
.row-actions { display: flex; gap: 5px; }

.btn-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 28px;
    background: #f5f5f5; color: #333;
    border: 1px solid #ccc;
    cursor: pointer; font-size: 14px; border-radius: 3px;
    transition: background .1s, color .1s, border-color .1s;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
    position: relative;
}
.btn-action:hover          { background: #e8e8e8; }
.btn-action.edit:hover     { background: #eff6ff; color: var(--brand); border-color: var(--brand); }
.btn-action.hist:hover     { background: #f5f3ff; color: #7c3aed; border-color: #7c3aed; }
.btn-action.del:hover      { background: #fff5f5; color: #dc2626; border-color: #dc2626; }
.btn-action[disabled]      { opacity: .4; cursor: not-allowed; }

/* Tooltip on action buttons */
.btn-action::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%; transform: translateX(-50%);
    background: #222; color: #fff;
    font-size: 11px; white-space: nowrap;
    padding: 3px 8px; border-radius: 2px;
    opacity: 0; pointer-events: none;
    transition: opacity .15s;
    z-index: 10;
}
.btn-action:hover::after { opacity: 1; }

/* ── Login card ── */
.login-card { backdrop-filter: blur(4px); background: rgba(255,255,255,.96); }
.login-logo { text-align: center; margin-bottom: 16px; }
.login-logo img { max-height: 60px; max-width: 220px; object-fit: contain; }

/* ── Settings color picker ── */
input[type=color] { -webkit-appearance: none; appearance: none; background: none; cursor: pointer; }
