/*
 * Finalidade: definir identidade, componentes e responsividade compartilhados do sistema.
 * Nota revisada em: 24/07/2026 14:20:00 -03:00 (America/Sao_Paulo).
 */
:root {
    color-scheme: dark;
    --bg: #080b10;
    --panel: #111722;
    --line: #273143;
    --text: #edf3ff;
    --muted: #94a3b8;
    --brand: #38bdf8;
    --brand-strong: #2563eb;
    --ok: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
}

* { box-sizing: border-box; }
html { font-family: Inter, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 15% 0, #12233d 0, transparent 32%), var(--bg);
}
a { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: white; color: #111; }
.skip-link:focus { top: 12px; }
.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 11, 16, .9);
    backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; text-decoration: none; }
.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: white;
}
.navigation { position: relative; }
.menu-trigger {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #151c28;
    color: var(--text);
    cursor: pointer;
}
.menu-trigger-lines,
.menu-trigger-lines::before,
.menu-trigger-lines::after { width: 20px; height: 2px; display: block; background: currentColor; content: ""; }
.menu-trigger-lines::before { transform: translateY(-6px); }
.menu-trigger-lines::after { transform: translateY(4px); }
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 40;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #0f1520;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.menu-link { display: block; padding: 10px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; }
.menu-link:hover, .menu-link:focus-visible, .menu-link.active { color: var(--text); background: #17202d; }
.page-shell { width: min(1180px, calc(100% - 40px)); flex: 1; margin: 48px auto; }
.hero { max-width: 760px; }
.eyebrow { margin: 0; color: var(--brand); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
h1 { margin: 9px 0 12px; font-size: clamp(32px, 6vw, 58px); line-height: 1.03; }
.lead { margin: 0; color: var(--muted); line-height: 1.7; font-size: 18px; }
.card { margin-top: 32px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.muted { color: var(--muted); }
.alert { margin-bottom: 16px; padding: 14px 16px; border: 1px solid; border-radius: 11px; }
.alert-success { border-color: rgba(52, 211, 153, .4); background: rgba(6, 78, 59, .25); color: #a7f3d0; }
.alert-warning { border-color: rgba(251, 191, 36, .4); background: rgba(113, 63, 18, .25); color: #fde68a; }
.alert-error { border-color: rgba(248, 113, 113, .4); background: rgba(127, 29, 29, .22); color: #fecaca; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pagination a { min-width: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; text-align: center; text-decoration: none; }
.pagination a:hover, .pagination a:focus-visible, .pagination a.active { border-color: var(--brand); background: #172b42; }
.footer { padding: 24px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
    .topbar { padding: 12px 18px; }
    .page-shell { width: min(100% - 28px, 1180px); margin: 32px auto; }
    .menu-panel { right: 0; min-width: min(220px, calc(100vw - 28px)); }
}

.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(11, 15, 22, .94); box-shadow: 0 35px 90px rgba(0, 0, 0, .48); }
.login-intro { min-height: 580px; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, rgba(20, 43, 72, .9), rgba(10, 15, 24, .85)); }
.login-intro h1 { font-size: clamp(34px, 5vw, 56px); }
.login-form-side { padding: 64px 48px; align-self: center; }
.login-form-side label { display: block; margin: 18px 0 8px; font-weight: 700; }
.login-form-side input[type="email"], .login-form-side input[type="password"] { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #0a0f17; color: var(--text); }
.login-form-side button { width: 100%; margin-top: 24px; }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(2, 6, 12, .8); }
.modal { width: min(460px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }

@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .login-form-side { padding: 44px 28px; }
}

.dashboard-shell h1 { font-size: clamp(30px, 5vw, 48px); }
.tile-grid, .sensor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.tile-card, .sensor-card, .table-panel { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); text-decoration: none; }
.tile-card:hover { border-color: var(--brand); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.pill { display: inline-block; margin: 4px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; }
.online, .state-ok { color: var(--ok); border-color: rgba(52,211,153,.45); }
.offline, .state-warn { color: var(--warning); border-color: rgba(251,191,36,.45); }
.source-strip { margin: 18px 0; }
.sensor-live-value { margin: 10px 0; color: var(--brand); font-size: 30px; font-weight: 800; }
.sensor-live-value.no-data { color: var(--muted); }
.btn { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #17202d; color: var(--text); cursor: pointer; }
.table-panel { margin-top: 26px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.configure-action { margin-top: 8px; }
@media (max-width: 640px) { .panel-head { flex-direction: column; } }
