/* =========================================================================
   IzzoMail — painel administrativo
   Tokens de cor: superfícies/tinta e paleta de gráficos validada (claro/escuro)
   ========================================================================= */
:root {
    color-scheme: light;
    --bg: #f6f6f3;
    --surface: #fcfcfb;
    --surface-2: #f2f1ed;
    --surface-3: #e9e8e3;
    --border: rgba(11, 11, 11, 0.1);
    --border-strong: rgba(11, 11, 11, 0.18);
    --text: #0b0b0b;
    --text-2: #52514e;
    --muted: #6f6d68;
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --accent: #2a78d6;
    --accent-hover: #256abf;
    --accent-ink: #ffffff;
    --accent-wash: rgba(42, 120, 214, 0.1);
    --focus: rgba(42, 120, 214, 0.45);

    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;

    --good: #0ca30c;
    --good-text: #006300;
    --good-wash: rgba(12, 163, 12, 0.1);
    --warning: #fab219;
    --warning-text: #7a5300;
    --warning-wash: rgba(250, 178, 25, 0.16);
    --serious: #ec835a;
    --serious-text: #9a3f17;
    --serious-wash: rgba(236, 131, 90, 0.15);
    --critical: #d03b3b;
    --critical-text: #a32626;
    --critical-wash: rgba(208, 59, 59, 0.1);
    --neutral-wash: rgba(11, 11, 11, 0.06);

    --shadow-sm: 0 1px 2px rgba(11, 11, 11, 0.05);
    --shadow-md: 0 8px 28px rgba(11, 11, 11, 0.12);
    --radius: 10px;
    --radius-sm: 7px;
    --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, monospace;
    --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        color-scheme: dark;
        --bg: #0d0d0d;
        --surface: #1a1a19;
        --surface-2: #222220;
        --surface-3: #2c2c2a;
        --border: rgba(255, 255, 255, 0.1);
        --border-strong: rgba(255, 255, 255, 0.18);
        --text: #ffffff;
        --text-2: #c3c2b7;
        --muted: #9a988f;
        --grid: #2c2c2a;
        --axis: #383835;
        --accent: #3987e5;
        --accent-hover: #5598e7;
        --accent-ink: #ffffff;
        --accent-wash: rgba(57, 135, 229, 0.16);
        --focus: rgba(57, 135, 229, 0.55);
        --series-1: #3987e5;
        --series-2: #d95926;
        --series-3: #199e70;
        --good-text: #3fc23f;
        --good-wash: rgba(12, 163, 12, 0.16);
        --warning-text: #fab219;
        --warning-wash: rgba(250, 178, 25, 0.14);
        --serious-text: #f09a77;
        --serious-wash: rgba(236, 131, 90, 0.16);
        --critical-text: #ef7a7a;
        --critical-wash: rgba(208, 59, 59, 0.18);
        --neutral-wash: rgba(255, 255, 255, 0.07);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.5);
    }
}

:root[data-theme='dark'] {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-3: #2c2c2a;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #9a988f;
    --grid: #2c2c2a;
    --axis: #383835;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-ink: #ffffff;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --focus: rgba(57, 135, 229, 0.55);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --good-text: #3fc23f;
    --good-wash: rgba(12, 163, 12, 0.16);
    --warning-text: #fab219;
    --warning-wash: rgba(250, 178, 25, 0.14);
    --serious-text: #f09a77;
    --serious-wash: rgba(236, 131, 90, 0.16);
    --critical-text: #ef7a7a;
    --critical-wash: rgba(208, 59, 59, 0.18);
    --neutral-wash: rgba(255, 255, 255, 0.07);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------------------- base */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
}
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 650;
    letter-spacing: -0.01em;
}
h1 {
    font-size: 1.45rem;
}
h2 {
    font-size: 1.1rem;
}
h3 {
    font-size: 0.98rem;
}
p {
    margin: 0 0 0.6em;
}
code,
pre,
.mono {
    font-family: var(--mono);
    font-size: 0.86em;
}
:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}
[v-cloak] {
    display: none;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.muted {
    color: var(--muted);
}
.text-2 {
    color: var(--text-2);
}
.small {
    font-size: 0.86rem;
}
.tiny {
    font-size: 0.78rem;
}
.nowrap {
    white-space: nowrap;
}
.break {
    word-break: break-all;
}
.num {
    font-variant-numeric: tabular-nums;
}
.right {
    text-align: right;
}
.center {
    text-align: center;
}
.mt-0 {
    margin-top: 0;
}
.mt-1 {
    margin-top: 6px;
}
.mt-2 {
    margin-top: 12px;
}
.mt-3 {
    margin-top: 20px;
}
.mb-2 {
    margin-bottom: 12px;
}
.row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.row.between {
    justify-content: space-between;
}
.row.end {
    justify-content: flex-end;
}
.stack > * + * {
    margin-top: 16px;
}
.grow {
    flex: 1;
    min-width: 0;
}
.icon {
    width: 18px;
    height: 18px;
    flex: none;
    display: inline-block;
    vertical-align: middle;
}
.icon.sm {
    width: 15px;
    height: 15px;
}

/* ---------------------------------------------------------------- boot */
.boot {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    color: var(--muted);
}
.boot-spinner,
.spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid var(--surface-3);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}
.spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    display: inline-block;
    vertical-align: middle;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------------------------------------------- layout */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    z-index: 30;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 18px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}
.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
}
.brand small {
    display: block;
    font-weight: 500;
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0;
}
.nav-group {
    margin: 10px 0 4px;
    padding: 0 10px;
    font-size: 0.7rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 520;
    text-decoration: none !important;
    margin: 1px 0;
}
.nav-item:hover {
    background: var(--neutral-wash);
    color: var(--text);
}
.nav-item.active {
    background: var(--accent-wash);
    color: var(--accent);
}
.nav-item .count {
    margin-left: auto;
    font-size: 0.72rem;
    background: var(--critical);
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-weight: 650;
}
.sidebar-footer {
    margin-top: auto;
    padding: 14px 10px 4px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
}
.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 28px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}
.topbar .host {
    font-size: 0.82rem;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.menu-toggle {
    display: none;
}
.content {
    padding: 26px 28px 60px;
    max-width: 1320px;
    width: 100%;
}
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-header p {
    color: var(--text-2);
    margin: 4px 0 0;
    max-width: 760px;
}
.backlink {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------- cards & grids */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-body {
    padding: 18px 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card-header h2,
.card-header h3 {
    font-size: 0.98rem;
}
.card-header p {
    margin: 2px 0 0;
    color: var(--text-2);
    font-size: 0.85rem;
}
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}
.grid {
    display: grid;
    gap: 16px;
}
.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-tiles {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.span-2 {
    grid-column: span 2;
}

/* ---------------------------------------------------------------- stat tiles */
.tile {
    padding: 16px 18px;
}
.tile-label {
    color: var(--text-2);
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tile-value {
    font-size: 1.75rem;
    font-weight: 650;
    margin-top: 4px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.tile-sub {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 2px;
}
.tile-sub strong {
    color: var(--text-2);
    font-weight: 600;
}

/* ---------------------------------------------------------------- buttons & forms */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 560;
    cursor: pointer;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background 0.12s, border-color 0.12s;
}
.btn:hover {
    background: var(--surface-2);
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.btn.primary:hover:not(:disabled) {
    background: var(--accent-hover);
}
.btn.danger {
    color: var(--critical-text);
    border-color: color-mix(in srgb, var(--critical) 45%, transparent);
}
.btn.danger:hover:not(:disabled) {
    background: var(--critical-wash);
}
.btn.ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text-2);
}
.btn.ghost:hover {
    background: var(--neutral-wash);
    color: var(--text);
}
.btn.sm {
    padding: 4px 10px;
    font-size: 0.84rem;
}
.btn.icon-only {
    padding: 6px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}
.field > label,
.label {
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--text);
}
.hint {
    font-size: 0.8rem;
    color: var(--muted);
}
.input,
.select,
.textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 11px;
    min-height: 36px;
}
.textarea {
    min-height: 110px;
    resize: vertical;
    font-family: var(--mono);
    font-size: 0.85rem;
}
.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}
.input.inline {
    width: auto;
}
.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group .addon {
    display: flex;
    align-items: center;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-left: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.88rem;
    white-space: nowrap;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    padding: 4px 0;
}
.checkbox input {
    margin-top: 3px;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}
.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.switch .track {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    position: relative;
    transition: background 0.15s;
    flex: none;
}
.switch .track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s;
}
.switch input:checked + .track {
    background: var(--accent);
    border-color: var(--accent);
}
.switch input:checked + .track::after {
    transform: translateX(16px);
}
.switch input:focus-visible + .track {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}
.segmented {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.segmented button {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.84rem;
    padding: 4px 11px;
    border-radius: 5px;
    color: var(--text-2);
    cursor: pointer;
}
.segmented button.active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}
.filters .input,
.filters .select {
    width: auto;
    min-width: 150px;
}
.filters .input.search {
    min-width: 260px;
    flex: 1;
    max-width: 420px;
}

/* ---------------------------------------------------------------- tables */
.table-wrap {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-2);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 9px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td {
    border-bottom: 0;
}
.table tbody tr.clickable {
    cursor: pointer;
}
.table tbody tr.clickable:hover td {
    background: var(--neutral-wash);
}
.table td.num,
.table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.table .ellipsis {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- badges, chips */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--neutral-wash);
    color: var(--text-2);
    white-space: nowrap;
    line-height: 1.6;
}
.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}
.badge.no-dot::before {
    display: none;
}
.badge.good {
    background: var(--good-wash);
    color: var(--good-text);
}
.badge.warning {
    background: var(--warning-wash);
    color: var(--warning-text);
}
.badge.serious {
    background: var(--serious-wash);
    color: var(--serious-text);
}
.badge.critical {
    background: var(--critical-wash);
    color: var(--critical-text);
}
.badge.info {
    background: var(--accent-wash);
    color: var(--accent);
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    border-radius: 999px;
    padding: 3px 11px;
    font: inherit;
    font-size: 0.82rem;
    color: var(--text-2);
    cursor: pointer;
}
.chip.active {
    border-color: var(--accent);
    background: var(--accent-wash);
    color: var(--accent);
    font-weight: 600;
}
.chip .n {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.tag {
    display: inline-block;
    font-size: 0.76rem;
    padding: 1px 7px;
    border-radius: 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-family: var(--mono);
}

/* ---------------------------------------------------------------- alerts */
.alert {
    display: flex;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    align-items: flex-start;
}
.alert .icon {
    margin-top: 1px;
}
.alert.info {
    background: var(--accent-wash);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.alert.info .icon {
    color: var(--accent);
}
.alert.warning {
    background: var(--warning-wash);
    border-color: color-mix(in srgb, var(--warning) 45%, transparent);
}
.alert.warning .icon {
    color: var(--warning-text);
}
.alert.error {
    background: var(--critical-wash);
    border-color: color-mix(in srgb, var(--critical) 40%, transparent);
}
.alert.error .icon {
    color: var(--critical-text);
}
.alert.success {
    background: var(--good-wash);
    border-color: color-mix(in srgb, var(--good) 40%, transparent);
}
.alert.success .icon {
    color: var(--good-text);
}
.alert p:last-child {
    margin-bottom: 0;
}
.alert strong {
    font-weight: 650;
}

/* ---------------------------------------------------------------- checklist */
.checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}
.checklist li {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}
.checklist li:last-child {
    border-bottom: 0;
}
.status-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: none;
    margin-top: 1px;
}
.status-icon .icon {
    width: 14px;
    height: 14px;
}
.status-icon.ok {
    background: var(--good-wash);
    color: var(--good-text);
}
.status-icon.warning {
    background: var(--warning-wash);
    color: var(--warning-text);
}
.status-icon.error {
    background: var(--critical-wash);
    color: var(--critical-text);
}
.fix {
    margin-top: 6px;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 0.86rem;
    color: var(--text);
}

/* ---------------------------------------------------------------- DNS records */
.record {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--surface);
}
.record-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.record-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 8px 14px;
    align-items: start;
}
.record-body dt {
    color: var(--muted);
    font-size: 0.82rem;
    padding-top: 6px;
}
.record-body dd {
    margin: 0;
    min-width: 0;
}
.copybox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 6px 6px 10px;
}
.copybox code {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    padding-top: 3px;
    line-height: 1.45;
}

/* ---------------------------------------------------------------- code */
pre.code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    overflow-x: auto;
    margin: 8px 0 14px;
    line-height: 1.5;
    font-size: 0.82rem;
    white-space: pre;
}
.code-wrap {
    position: relative;
}
.code-wrap .btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ---------------------------------------------------------------- key/value, timeline */
.kv {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 8px 16px;
    margin: 0;
}
.kv dt {
    color: var(--muted);
    font-size: 0.85rem;
}
.kv dd {
    margin: 0;
    word-break: break-word;
}
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.timeline li {
    position: relative;
    padding: 0 0 16px 26px;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 16px;
    bottom: -2px;
    width: 2px;
    background: var(--grid);
}
.timeline li:last-child::before {
    display: none;
}
.timeline .dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--surface);
    background: var(--muted);
    box-shadow: 0 0 0 1px var(--border-strong);
}
.timeline .dot.good {
    background: var(--good);
}
.timeline .dot.critical {
    background: var(--critical);
}
.timeline .dot.warning {
    background: var(--warning);
}
.timeline .dot.info {
    background: var(--accent);
}
.timeline .when {
    color: var(--muted);
    font-size: 0.8rem;
}
.timeline .detail {
    margin-top: 4px;
    font-size: 0.84rem;
    color: var(--text-2);
    word-break: break-word;
}

/* ---------------------------------------------------------------- meter */
.meter {
    height: 8px;
    border-radius: 999px;
    background: var(--accent-wash);
    overflow: hidden;
}
.meter > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}
.meter.warn > span {
    background: var(--warning);
}
.meter.full > span {
    background: var(--critical);
}

/* ---------------------------------------------------------------- charts */
.chart-box {
    position: relative;
}
.chart-canvas {
    position: relative;
    height: 260px;
    transition: opacity 0.2s;
}
.chart-canvas.loading {
    opacity: 0.45;
}
.chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-2);
}
.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

/* ---------------------------------------------------------------- modal & drawer */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.45);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 16px 16px;
    overflow-y: auto;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-md);
}
.modal.wide {
    max-width: 860px;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-body {
    padding: 18px 20px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.35);
    z-index: 90;
}
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(680px, 100%);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 95;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.drawer-header {
    position: sticky;
    top: 0;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    z-index: 1;
}
.drawer-body {
    padding: 18px 20px 40px;
}
.secret {
    background: var(--warning-wash);
    border: 1px dashed color-mix(in srgb, var(--warning) 60%, transparent);
    border-radius: var(--radius-sm);
    padding: 12px;
}

/* ---------------------------------------------------------------- toasts */
.toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 36px));
}
.toast {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
}
.toast.success {
    border-left-color: var(--good);
}
.toast.error {
    border-left-color: var(--critical);
}
.toast.info {
    border-left-color: var(--accent);
}

/* ---------------------------------------------------------------- empty, login */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty .icon {
    width: 34px;
    height: 34px;
    opacity: 0.6;
    margin-bottom: 8px;
}
.empty h3 {
    color: var(--text);
    margin-bottom: 4px;
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    padding: 30px 28px;
}
.login-card .brand {
    justify-content: center;
    padding-bottom: 6px;
}
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
    overflow-x: auto;
}
.tabs button {
    border: 0;
    background: transparent;
    font: inherit;
    padding: 9px 14px;
    color: var(--text-2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    font-weight: 550;
}
.tabs button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.provider-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 150px;
    gap: 14px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.provider-row:last-child {
    border-bottom: 0;
}
.docs h2 {
    margin: 28px 0 10px;
}
.docs h3 {
    margin: 20px 0 8px;
}
.docs table {
    margin-bottom: 14px;
}
.docs p,
.docs li {
    color: var(--text-2);
    max-width: 860px;
}
.docs ul {
    padding-left: 20px;
}

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1100px) {
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 860px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 270px;
        transform: translateX(-100%);
        transition: transform 0.2s;
        box-shadow: var(--shadow-md);
    }
    .sidebar.open {
        transform: none;
    }
    .menu-toggle {
        display: inline-flex;
    }
    .topbar {
        padding: 10px 16px;
    }
    .content {
        padding: 18px 16px 50px;
    }
    .grid-2,
    .grid-3,
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .span-2 {
        grid-column: auto;
    }
    .kv {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px 0;
    }
    .kv dd {
        margin-bottom: 8px;
    }
    .record-body {
        grid-template-columns: minmax(0, 1fr);
    }
    .record-body dt {
        padding-top: 0;
    }
    .provider-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
    .filters .input.search {
        min-width: 0;
        max-width: none;
        width: 100%;
        flex: 1 1 100%;
    }
    .filters .select,
    .filters .input:not(.search) {
        flex: 1 1 40%;
        min-width: 0;
        max-width: none !important;
    }
    .topbar .host {
        display: none;
    }
}

/* ---------------------------------------------------------------- enviar e-mail (compositor) */
.compose-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--surface-2);
}
.editor-toolbar button {
    border: 0;
    background: transparent;
    color: var(--text-2);
    min-width: 32px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.editor-toolbar button:hover {
    background: var(--surface);
    color: var(--text);
}
.editor-toolbar .sep {
    width: 1px;
    margin: 4px 4px;
    background: var(--border-strong);
}
.editor-area {
    min-height: 340px;
    max-height: 640px;
    overflow-y: auto;
    padding: 18px 20px;
    border: 1px solid var(--border-strong);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: #ffffff;
    color: #1f2933;
    font: 16px/1.6 Arial, Helvetica, sans-serif;
    outline: none;
}
.editor-area:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}
.editor-area img {
    max-width: 100%;
}
.editor-area a {
    color: #2a78d6;
}
.preview-meta {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.86rem;
    display: grid;
    gap: 2px;
    word-break: break-word;
}
.preview-stage {
    background: var(--surface-3);
    padding: 16px;
    display: flex;
    justify-content: center;
    border-radius: 0 0 var(--radius) var(--radius);
}
.preview-frame {
    width: 100%;
    height: 620px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #ffffff;
    transition: width 0.2s;
}
.preview-frame.mobile {
    width: 375px;
    max-width: 100%;
}
@media (max-width: 1100px) {
    .compose-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
