/* ============================================================
   MXTools - folha de estilos
   ============================================================ */

:root {
    --sidebar-w: 262px;
    --radius: 12px;
    --radius-sm: 8px;
    --bg: #0b1016;
    --bg-body: #0e141c;
    --surface: #141c26;
    --surface-2: #1a2431;
    --surface-3: #212d3b;
    --border: #263445;
    --border-soft: #1e2a38;
    --text: #e6edf5;
    --text-soft: #b7c5d5;
    --muted: #8293a8;
    --accent: #ef4444;
    --accent-dark: #dc2626;
    --accent-soft: rgba(239, 68, 68, .12);
    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --fail: #f87171;
    --fail-soft: rgba(248, 113, 113, .12);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, .12);
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

:root[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-body: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e8eef5;
    --border: #d8e1eb;
    --border-soft: #e5ebf2;
    --text: #17212e;
    --text-soft: #35465c;
    --muted: #6b7c91;
    --accent-soft: rgba(239, 68, 68, .08);
    --ok: #059669;
    --ok-soft: rgba(5, 150, 105, .1);
    --warn: #b45309;
    --warn-soft: rgba(180, 83, 9, .1);
    --fail: #dc2626;
    --fail-soft: rgba(220, 38, 38, .09);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, .09);
    --shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg-body);
    color: var(--text);
    font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 12px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
svg { width: 18px; height: 18px; flex: none; }

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--bg);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow: hidden;
}

.sidebar-brand {
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-soft);
}

.brand-link { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand-link:hover { text-decoration: none; }

.brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, .3);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { display: flex; align-items: center; gap: 6px; }
.brand-text strong { font-size: 16px; letter-spacing: -.3px; }
.brand-text small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.brand-beta {
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .6px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 2px 5px;
}

.sidebar-brand .sidebar-close { display: none; }

/* Só a lista de ferramentas rola; marca e rodapé ficam fixos. */
.sidebar-nav {
    padding: 14px 10px 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.sidebar:hover .sidebar-nav,
.sidebar-nav.is-scrolling { scrollbar-color: var(--border) transparent; }

/* Barra fina estilo YouTube: invisível em repouso, aparece ao passar o mouse. */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb,
.sidebar-nav.is-scrolling::-webkit-scrollbar-thumb { background: var(--border); }
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.nav-section,
.nav-section-toggle {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    padding: 18px 12px 7px;
}

.nav-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.nav-section-toggle:hover { color: var(--text); }
.nav-section-toggle::after {
    content: "";
    width: 6px; height: 6px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    transition: transform .18s;
    margin-right: 3px;
}
.nav-section-toggle[aria-expanded="true"]::after { transform: rotate(225deg) translate(2px, 2px); }

.nav-group[hidden] { display: none; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-weight: 500;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.nav-link svg { width: 17px; height: 17px; color: var(--muted); }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link.active svg { color: var(--accent); }
.nav-alert { color: var(--warn); }

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 11px;
}
.sidebar-footer span { display: inline-flex; align-items: center; gap: 5px; }
.sidebar-footer svg { width: 13px; height: 13px; }

.sidebar-overlay { display: none; }

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

.topbar {
    height: 66px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
}

.topbar-left, .topbar-actions, .breadcrumb, .user-menu { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }

.breadcrumb { font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb strong { color: var(--text); font-weight: 600; }
.breadcrumb .sep { opacity: .5; }

.icon-btn {
    width: 34px; height: 34px;
    display: inline-grid; place-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-dark { display: none; }
:root[data-theme="light"] .theme-icon-light { display: inline; }

.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
}
.user-name { font-size: 13px; font-weight: 500; }

.content { padding: 28px; flex: 1; max-width: 1500px; width: 100%; margin: 0 auto; }

.app-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* ----------------------------- Comuns ----------------------------- */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.5px; display: flex; align-items: center; gap: 10px; }
.page-title svg { width: 23px; height: 23px; color: var(--accent); }
.page-subtitle { color: var(--muted); margin-top: 5px; font-size: 14px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 17px; height: 17px; color: var(--accent); }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 700;
    margin: 22px 0 12px;
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-fail { color: var(--fail); }
.text-info { color: var(--info); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ----------------------------- Botões ----------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s, background .15s, border-color .15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(239, 68, 68, .22); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ----------------------------- Formulários ----------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; align-items: end; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group.grow { flex: 1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.form-hint { font-size: 11px; color: var(--muted); }

.form-control, select.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-control::placeholder { color: var(--muted); }
select.form-control { cursor: pointer; }
textarea.header-input {
    min-height: 220px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
}

.checkbox-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); cursor: pointer; font-size: 13px; }
.checkbox-label input { accent-color: var(--accent); width: 16px; height: 16px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.input-inline { display: flex; gap: 8px; align-items: stretch; }
.input-inline .form-control { flex: 1; }

/* ----------------------------- Alertas ----------------------------- */
.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    margin-bottom: 16px;
    font-size: 13px;
}
.alert > svg { margin-top: 2px; }
.alert strong { display: block; margin-bottom: 3px; }
.alert p { margin: 0; }
.alert small { display: block; margin-top: 5px; color: var(--muted); word-break: break-word; }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--text); }
.alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert-fail, .alert-error { background: var(--fail-soft); border-color: color-mix(in srgb, var(--fail) 40%, transparent); }
.alert-info > svg { color: var(--info); }
.alert-ok > svg { color: var(--ok); }
.alert-warn > svg { color: var(--warn); }
.alert-fail > svg, .alert-error > svg { color: var(--fail); }

.note {
    padding: 11px 14px;
    border-left: 3px solid var(--info);
    background: var(--info-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-soft);
    font-size: 12px;
    margin-top: 16px;
}

/* ----------------------------- Badges ----------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-fail, .badge-error { background: var(--fail-soft); color: var(--fail); }
.badge-info { background: var(--info-soft); color: var(--info); }

.chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 600;
}

/* ----------------------------- Tabelas ----------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left;
    padding: 11px 16px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td.mono { font-size: 12px; }
.data-table td.actions { white-space: nowrap; }
.mx-actions { display: flex; align-items: center; gap: 6px; }
.mx-actions .btn { padding: 5px 8px; font-size: 11px; }
.header-hops td:nth-child(3), .header-hops td:nth-child(4), .header-hops td:nth-child(5) { max-width: 260px; overflow-wrap: anywhere; }
.header-value { max-width: 720px; overflow-wrap: anywhere; }
.auth-detail { font-size: 11px; color: var(--text-soft); line-height: 1.55; word-break: break-word; }
.data-table .num, .data-table th.num { text-align: right; white-space: nowrap; }
.blacklist-table th:first-child, .blacklist-table td:first-child { width: 110px; }
.blacklist-host { font-size: 11px; margin-top: 2px; }

/* ----------------------------- Resultados ----------------------------- */
.result-card { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; overflow: hidden; }
.result-head {
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
}
.result-head strong { font-size: 13px; }
.result-body { padding: 16px; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kv-item { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 11px 13px; min-width: 0; }
.kv-key { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; font-weight: 700; }
.kv-value { font-size: 13px; margin-top: 3px; word-break: break-word; }
.kv-value.mono { font-size: 12px; }

.code-block {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 430px;
    overflow: auto;
    margin: 0;
}

.copy-btn { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 5px; }
.copy-btn:hover { color: var(--text); background: var(--surface-3); }
.copy-btn svg { width: 15px; height: 15px; }

.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.check-item > svg { width: 18px; height: 18px; margin-top: 2px; }
.check-item.ok > svg { color: var(--ok); }
.check-item.warn > svg { color: var(--warn); }
.check-item.fail > svg { color: var(--fail); }
.check-item.info > svg { color: var(--info); }
.check-item.mx-redundancy {
    border: 1px solid var(--accent);
    border-left-width: 4px;
    background: linear-gradient(90deg, var(--accent-soft), var(--surface-2) 70%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, .12);
}
.check-item.mx-redundancy > svg { width: 20px; height: 20px; color: var(--accent); }
.check-item.mx-redundancy strong { font-size: 14px; }
.check-item.mx-redundancy .check-info span { color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.mx-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2px;
    box-shadow: 0 5px 18px rgba(239, 68, 68, .35);
}
.mx-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(239, 68, 68, .45); }
.check-info { flex: 1; min-width: 0; }
.check-info strong { font-size: 13px; display: block; }
.check-info span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.fix-guide { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); margin-top: 10px; }
.fix-guide summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 14px; font-size: 12px; font-weight: 650; color: var(--accent); list-style: none; }
.fix-guide summary::-webkit-details-marker { display: none; }
.fix-guide summary svg { width: 15px; height: 15px; flex: none; }
.fix-guide[open] summary { border-bottom: 1px solid var(--border-soft); }
.fix-guide-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.fix-guide-body > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.fix-step .result-head { margin-bottom: 6px; }
.fix-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.fix-note .mono { color: var(--text-soft); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 12px; }
.empty-state strong { display: block; color: var(--text-soft); font-size: 15px; margin-bottom: 4px; }

/* ----------------------------- Dashboard ----------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 34px;
    margin-bottom: 22px;
    background:
        radial-gradient(circle at 90% 15%, rgba(239, 68, 68, .17), transparent 42%),
        radial-gradient(circle at 10% 90%, rgba(96, 165, 250, .12), transparent 40%),
        var(--surface);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow);
}
.hero-ip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    vertical-align: middle;
}
.hero-ip svg { width: 16px; height: 16px; color: var(--accent); }
.hero-ip strong { color: var(--text); font-size: 14px; }
.hero h1 { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 30px; letter-spacing: -.7px; margin-bottom: 8px; line-height: 1.35; }
.hero p { color: var(--muted); max-width: 650px; margin-bottom: 22px; }
.hero .form-control { background: var(--bg-body); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.tool-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex: none; }
.tool-card strong { display: block; font-size: 14px; }
.tool-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.4; }

.score-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.score-ring {
    width: 116px; height: 116px;
    border-radius: 50%;
    display: grid; place-items: center;
    position: relative;
    flex: none;
    background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--surface-3) 0);
}
.score-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.score-inner { position: relative; z-index: 1; text-align: center; }
.score-value { font-size: 30px; font-weight: 800; line-height: 1; }
.score-grade { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.score-info { flex: 1; min-width: 220px; }

.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }

/* ----------------------------- Autenticação ----------------------------- */
.auth-page { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.auth-header { padding: 28px 28px 6px; text-align: center; }
.auth-header .brand-mark { width: 46px; height: 46px; margin: 0 auto 14px; }
.auth-header h1 { font-size: 21px; }
.auth-header p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.auth-body { padding: 22px 28px 28px; }
.auth-body .form-group { margin-bottom: 14px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }

/* ----------------------------- Utilidades ----------------------------- */
.loader {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}
.btn.is-loading .loader { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.mark { background: var(--warn-soft); color: var(--warn); border-radius: 3px; padding: 1px 4px; }

/* ----------------------------- Responsivo ----------------------------- */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
    .sidebar-brand .sidebar-close, .menu-toggle { display: inline-grid; }
    .main-wrap { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .content { padding: 20px 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .hero { padding: 24px 20px; }
    .hero h1 { font-size: 23px; }
}

@media (max-width: 560px) {
    .user-name { display: none; }
    .breadcrumb a { display: none; }
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .app-footer { padding: 14px 16px; }
    .form-actions .btn { width: 100%; }
}
