/* ===== Prime TI Backup — painel (tema roxo escuro premium, Fluent/Win11) ===== */
:root {
    --bg: #14101f;
    --surface: #1d1730;
    --surface-2: #251d3a;
    --surface-3: #2c2346;
    --border: #342b4d;
    --border-soft: #2a2340;
    --text: #ece9f5;
    --muted: #a79fc4;
    --faint: #7d7599;
    --accent: #7c5cff;
    --accent-2: #9d7bff;
    --accent-soft: rgba(124, 92, 255, .14);
    --good: #3fbf87;
    --good-soft: rgba(63, 191, 135, .14);
    --warn: #e0a63a;
    --warn-soft: rgba(224, 166, 58, .14);
    --crit: #e5484d;
    --crit-soft: rgba(229, 72, 77, .15);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 30px rgba(0, 0, 0, .35);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }

.tnum { font-variant-numeric: tabular-nums; }

/* ===================== layout ===================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 224px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--surface) 0%, #191327 100%);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #5b3fd6);
    display: grid; place-items: center; font-size: 20px;
    box-shadow: 0 4px 14px rgba(124, 92, 255, .4);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }

.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 500; text-decoration: none;
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); }
.nav-ico { width: 18px; text-align: center; opacity: .9; }

.sidebar-foot { margin-top: auto; color: var(--faint); font-size: 12px; padding: 12px 10px 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 62px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; border-bottom: 1px solid var(--border-soft);
    background: rgba(29, 23, 48, .6); backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 5;
}
.topbar-title { font-weight: 600; font-size: 15px; }
.userbox { display: flex; align-items: center; gap: 14px; }
.user-email { color: var(--muted); font-size: 13px; }
.logout-form { margin: 0; }

.content { padding: 28px; max-width: 1200px; width: 100%; }

/* ===================== page header ===================== */
.page-head { margin-bottom: 22px; }
.page-title { font-size: 22px; }
.page-sub { color: var(--muted); margin-top: 4px; }

/* ===================== cards ===================== */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px 22px; }

.grid { display: grid; gap: 16px; }
.grid-clients { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }

.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
}
.stat-num { font-size: 26px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* client cards */
.client-card {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px; color: var(--text);
    transition: border-color .12s, transform .12s; text-decoration: none;
}
.client-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.client-name { font-weight: 600; font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.client-meta { display: flex; gap: 18px; color: var(--muted); font-size: 13px; }
.client-meta b { color: var(--text); font-weight: 600; }

/* ===================== tables ===================== */
.table-wrap { overflow-x: auto; }
table.pb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.pb th {
    text-align: left; color: var(--faint); font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: .4px;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
}
table.pb td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
table.pb tr:last-child td { border-bottom: none; }
table.pb tr:hover td { background: var(--surface-2); }

/* ===================== badges ===================== */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--good); background: var(--good-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.crit { color: var(--crit); background: var(--crit-soft); }
.badge.idle { color: var(--muted); background: var(--surface-3); }

/* ===================== buttons ===================== */
.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-family: var(--font); font-size: 13.5px; font-weight: 600;
    background: var(--accent); color: #fff; transition: filter .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost {
    background: transparent; border: 1px solid var(--border); color: var(--muted);
    padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
    font-family: var(--font); font-size: 13px; font-weight: 500;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

/* ===================== forms ===================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input {
    width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    font-family: var(--font); font-size: 14px; outline: none; transition: border-color .12s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===================== login ===================== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(1200px 600px at 50% -10%, #221a3a 0%, var(--bg) 60%); }
.login-card { width: 100%; max-width: 380px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
    width: 56px; height: 56px; border-radius: 15px; margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--accent), #5b3fd6); display: grid; place-items: center;
    font-size: 30px; box-shadow: 0 6px 22px rgba(124, 92, 255, .45);
}
.login-title { font-size: 19px; font-weight: 700; }
.login-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

/* ===================== misc ===================== */
.alert-box {
    padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px;
    background: var(--crit-soft); color: #ffb3b5; border: 1px solid rgba(229, 72, 77, .3);
}
.key-box {
    padding: 16px 18px; border-radius: var(--radius-sm); margin-bottom: 20px;
    background: var(--good-soft); border: 1px solid rgba(63, 191, 135, .3);
}
.key-box .key-code {
    font-family: "Cascadia Code", Consolas, monospace; font-size: 16px; font-weight: 700;
    color: var(--good); letter-spacing: .5px; word-break: break-all; margin-top: 6px;
}
.empty { color: var(--faint); text-align: center; padding: 40px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mono { font-family: "Cascadia Code", Consolas, monospace; }
.inline-form { display: inline; margin: 0; }

@media (max-width: 720px) {
    .sidebar { width: 64px; padding: 16px 8px; }
    .brand-text, .nav-item span:not(.nav-ico), .sidebar-foot { display: none; }
    .content { padding: 18px; }
}
