/* DNS Manager Standalone – app.css */

/* CSS variable defaults (overridden by inline <style> in layout) */
:root {
    --brand:       #2563eb;
    --brand-dark:  #1d4ed8;
    --brand-light: #93c5fd;
    --brand-text:  #ffffff;
    --page-bg:     #f4f5f7;
    --body-text:   #111111;
    --card-bg:     #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html  { font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
body  { background: var(--page-bg); color: var(--body-text); min-height: 100vh; display: flex; flex-direction: column; }
body.page-login { display: block; }
.main { flex: 1; }

/* ── Nav ── */
.nav {
    background: var(--brand);
    color: var(--brand-text);
    display: flex; align-items: center;
    padding: 0 24px; height: 52px; gap: 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.nav-brand {
    display: flex; align-items: center;
    color: var(--brand-text); text-decoration: none;
    font-size: 15px; font-weight: bold; white-space: nowrap;
    padding-right: 20px; border-right: 1px solid rgba(255,255,255,.25);
    margin-right: 8px; height: 52px;
}
.nav-logo {
    max-height: 40px;
    max-width: 180px;
    object-fit: contain;
    display: block;
}
.nav-links { display: flex; flex: 1; }
.nav-links a {
    color: var(--brand-text); text-decoration: none;
    padding: 0 14px; height: 52px; display: flex; align-items: center;
    font-size: 13px; opacity: .85; transition: opacity .1s, background .1s;
    border-bottom: 3px solid transparent;
}
.nav-links a:hover  { opacity: 1; background: rgba(255,255,255,.1); }
.nav-links a.active { opacity: 1; border-bottom-color: #fff; }

/* ── 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: 52px; z-index: 99;
}
.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-size: 13px; display: flex; align-items: center; gap: 12px;
}
.tofa-link  { color: #7c2d12; font-weight: bold; }
.tofa-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #7c2d12; margin-left: auto; padding: 0 4px; }

/* ── Layout ── */
.main { padding: 28px 24px; max-width: 1400px; margin: 0 auto; }
/* Login page */
.login-bg {
    min-height: 100vh;
    background-color: var(--page-bg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.login-center { width: 100%; max-width: 420px; }
.login-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
}

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

.page-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { font-size: 20px; flex: 1; color: var(--body-text); }

/* ── Alerts ── */
.alert { padding: 10px 14px; border: 1px solid #ccc; margin-bottom: 16px; font-size: 13px; }
.alert-error   { background: #fff5f5; border-color: #fca5a5; color: #c00; }
.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-info    { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; color: #666; }
.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: var(--body-text); background: var(--card-bg);
    border-radius: 0; -webkit-appearance: auto; appearance: auto; width: 100%;
}
.field input:focus,.field select:focus,.field textarea:focus { border-color: var(--brand); 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; cursor: pointer; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--brand); color: var(--brand-text);
    border: 1px solid var(--brand);
    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; -webkit-appearance: none;
    transition: background .1s, border-color .1s;
}
.btn:hover       { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--brand-text); }
.btn-ghost       { background: var(--card-bg); color: var(--body-text); border-color: #999; }
.btn-ghost:hover { background: #f5f5f5; color: var(--body-text); border-color: #666; }
.btn-danger      { background: var(--card-bg); color: #dc2626; border-color: #dc2626; }
.btn-danger:hover{ background: #fff5f5; color: #dc2626; }
.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: var(--card-bg); border: 1px solid #e0e0e0; }
.table th { background: var(--brand); color: var(--brand-text); 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; color: var(--body-text); }
.table tr:last-child td { border-bottom: none; }
.table tr:nth-child(even) td { background: rgba(0,0,0,.02); }
.table tr:hover td { background: rgba(0,0,0,.04); }
.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; } }

/* ── Misc ── */
.badge { display: inline-block; background: #dc2626; color: #fff; font-size: 11px; font-weight: bold; padding: 1px 6px; margin-left: 4px; border-radius: 2px; }
.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; }
.badge-action { display: inline-block; border: 1px solid #999; padding: 1px 7px; font-size: 11px; font-weight: bold; }
.hint     { color: #888; font-style: italic; }
.small    { font-size: 12px; color: #666; }
.mt-1     { margin-top: 12px; }
.mt-2     { margin-top: 24px; }
.text-success { color: #166534; }
.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; font-family: monospace; }
.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: #555; }
.info-table   { width: 100%; font-size: 13px; }
.info-table td { padding: 5px 0; border-bottom: 1px solid #f0f0f0; color: var(--body-text); }
.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 8px; 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; }
a { color: var(--brand); }

/* ── Login ── */
.login-logo    { text-align: center; margin-bottom: 16px; }
.login-logo img{ max-height: 64px; max-width: 240px; object-fit: contain; }

/* ── DNS App zone nav ── */
#dns-app { color: var(--body-text); }
#zone-nav {
    background: transparent;
    margin: 0 0 18px 0;
    padding: 0 0 12px 0;
    border-bottom: 1px solid rgba(0,0,0,.1);
    display: flex; flex-wrap: wrap; gap: 6px;
    position: relative; z-index: 2;
}
.zone-btn {
    background: var(--card-bg);
    border: 1px solid #ccc;
    color: var(--body-text);
    padding: 6px 16px; cursor: pointer;
    font-family: Arial, Helvetica, sans-serif; font-size: 13px;
    border-radius: 3px; -webkit-appearance: none;
    transition: all .12s;
}
.zone-btn:hover  { border-color: var(--brand); color: var(--brand); background: var(--card-bg); }
.zone-btn.active { background: var(--brand); color: var(--brand-text); border-color: var(--brand); font-weight: bold; }

/* ── DNS toolbar ── */
.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; color: var(--body-text); }

/* ── DNS search ── */
.dns-search-wrap { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.dns-search-wrap input { flex: 1; padding: 7px 10px; border: 1px solid #ccc; font-family: Arial, Helvetica, sans-serif; font-size: 13px; border-radius: 0; background: var(--card-bg); color: var(--body-text); }
.dns-search-wrap input:focus { border-color: var(--brand); outline: none; }
.search-count { font-size: 12px; color: #888; white-space: nowrap; }

/* ── DNS messages ── */
.dns-msg { padding: 9px 14px; border: 1px solid #ccc; background: var(--card-bg); margin-bottom: 10px; font-size: 13px; display: none; }
.dns-msg.error   { background: #fff5f5; border-color: #fca5a5; color: #dc2626; }
.dns-msg.success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.dns-msg.pending { background: #fffbea; border-color: #fcd34d; color: #92400e; }

.approval-notice { background: #fffbea; border: 1px solid #fcd34d; color: #92400e; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.preset-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border: 1px solid #e0e0e0; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; background: rgba(0,0,0,.02); }

/* ── DNS table ── */
.table-wrap  { overflow-x: auto; margin-bottom: 10px; }
.dns-table   { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--body-text); }
.dns-table th {
    background: var(--brand); color: var(--brand-text);
    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 #e8e8e8; vertical-align: middle; word-break: break-all; background: var(--card-bg); color: var(--body-text); }
.dns-table tr:nth-child(even) td { background: rgba(0,0,0,.02); }
.dns-table tr:hover td { background: rgba(0,0,0,.04); }
.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 #bbb; background: rgba(0,0,0,.04); color: var(--body-text); min-width: 52px; text-align: center; }
.proxy-on  { font-weight: bold; color: #f97316; }
.proxy-off { color: #aaa; }
.lock-icon { color: #aaa; font-size: 11px; margin-left: 4px; }
.expiry-tag { font-size: 11px; background: #fffbea; border: 1px solid #fcd34d; color: #92400e; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }

/* ── Action buttons (end of DNS rows) ── */
.row-actions { display: flex; gap: 5px; white-space: nowrap; }
.btn-action {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 28px; padding: 0 7px;
    background: #f0f0f0; color: #444;
    border: 1px solid #ccc;
    cursor: pointer; font-size: 14px; border-radius: 3px;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none; position: relative;
    transition: all .12s;
}
.btn-action:hover          { background: #e0e0e0; }
.btn-action.edit:hover     { background: var(--brand); color: var(--brand-text); border-color: var(--brand); }
.btn-action.hist:hover     { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.btn-action.del:hover      { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-action[disabled]      { opacity: .4; cursor: not-allowed; }
/* Tooltip */
.btn-action::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 5px); 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 .12s; z-index: 10;
}
.btn-action:hover::after { opacity: 1; }

/* ── Bulk table ── */
.bulk-wrap  { overflow-x: auto; margin-bottom: 12px; }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--body-text); }
.bulk-table th { background: var(--brand); color: var(--brand-text); 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 #e0e0e0; vertical-align: middle; background: var(--card-bg); }
.bulk-table tr:nth-child(even):not(.readonly-row) td { background: rgba(0,0,0,.02); }
.bulk-table tr.readonly-row td { opacity: .55; }
.bulk-table tr.new-row td { background: #f0fdf4; }
.bulk-table input[type=text],.bulk-table input[type=number],.bulk-table select {
    width: 100%; padding: 5px 7px; border: 1px solid #bbb;
    font-family: Arial, Helvetica, sans-serif; font-size: 13px;
    color: var(--body-text); background: var(--card-bg); border-radius: 0;
}
.bulk-table input:focus,.bulk-table select:focus { border-color: var(--brand); outline: none; }
.bulk-table input[disabled],.bulk-table select[disabled] { background: #eee; color: #888; cursor: not-allowed; }
.bulk-del-btn { background: none; border: none; color: #999; font-size: 15px; cursor: pointer; padding: 2px 6px; }
.bulk-del-btn:hover { color: #dc2626; }

/* ── Settings page color picker ── */
input[type=color] { -webkit-appearance: none; appearance: none; cursor: pointer; }
.color-swatch { display: inline-block; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #ddd; }

@media (max-width: 600px) {
    .dns-table th:nth-child(4),.dns-table td:nth-child(4),
    .dns-table th:nth-child(5),.dns-table td:nth-child(5) { display: none; }
    .nav-links a { padding: 0 10px; font-size: 12px; }
}

/* ── Footer ── */
.footer {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center !important;
    padding: 16px 24px 20px;
    font-size: 12px;
    color: #aaa;
    border-top: 1px solid rgba(0,0,0,.08);
    margin-top: 32px;
    font-family: Arial, Helvetica, sans-serif;
}
