/* ==========================================================================
   RastreDesk — skin compartilhada pelo painel web e pelo app.
   Reproduz o visual do admin RastreCore v2 (menu lateral flutuante em degradê,
   barra superior em pílula, cartões brancos de 26px, botões em pílula, Inter).
   A cor principal vem de --rd-brand / --rd-brand-deep (Aparência do painel).
   Tema escuro: <html data-theme="dark">.
   ========================================================================== */

:root {
    --rd-brand: #004883;
    --rd-brand-deep: #003765;
    --rd-brand-soft: color-mix(in srgb, var(--rd-brand) 10%, #ffffff);
    --rd-side-from: color-mix(in srgb, var(--rd-brand-deep) 62%, #021024);
    --rd-side-to: var(--rd-brand-deep);
    --rd-side-label: #869aab;
    --rd-side-text: #d4dce2;
    --rd-logo-accent: #8ec0f0;
    --rd-canvas: color-mix(in srgb, var(--rd-brand) 3%, #e6e9ed);
    --rd-card: #ffffff;
    --rd-soft: #edf0f3;
    --rd-line: #eceef2;
    --rd-row-line: #f0f1f4;
    --rd-ink: #111827;
    --rd-ink-soft: #35445b;
    --rd-muted: #8a909c;
    --rd-green: #12a150;
    --rd-red: #c0353a;
    --rd-orange: #c66a1b;
    --rd-hover: color-mix(in srgb, var(--rd-brand) 4%, #ffffff);
    --rd-input-bg: #ffffff;
    --rd-input-line: #dfe3e9;
    --rd-radius: 26px;
    --rd-radius-sm: 18px;
    --rd-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .04);
    --rd-gap: 18px;
    --rd-inset: 14px;
    --rd-side-w: 244px;
    --rd-side-w-collapsed: 74px;
    --rd-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    --rd-brand-soft: color-mix(in srgb, var(--rd-brand) 22%, #111a29);
    --rd-canvas: #080d16;
    --rd-card: #111a29;
    --rd-soft: #172235;
    --rd-line: #1f2b3e;
    --rd-row-line: #1b2638;
    --rd-ink: #e8eef7;
    --rd-ink-soft: #c3cfdf;
    --rd-muted: #8d9bb0;
    --rd-green: #3fc98a;
    --rd-red: #ef7b7b;
    --rd-orange: #f0a35b;
    --rd-hover: #152034;
    --rd-input-bg: #0e1727;
    --rd-input-line: #2e3f58;
    --rd-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .3);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.rd {
    margin: 0;
    background: var(--rd-canvas);
    color: var(--rd-ink);
    font-family: var(--rd-font);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
:where(.rd) a { color: inherit; }
.rd svg.ico {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.rd [hidden] { display: none !important; }
.rd ::-webkit-scrollbar { width: 9px; height: 9px; }
.rd ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--rd-brand) 45%, transparent); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
.rd ::-webkit-scrollbar-track { background: transparent; }

/* ---------- Estrutura ---------- */
.rd-shell { display: flex; min-height: 100vh; }

/* ---------- Menu lateral flutuante ---------- */
.rd-side {
    position: fixed;
    top: var(--rd-inset);
    bottom: var(--rd-inset);
    left: var(--rd-inset);
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: var(--rd-side-w);
    overflow: hidden;
    border-radius: var(--rd-radius);
    background: linear-gradient(180deg, var(--rd-side-from), var(--rd-side-to));
    color: #fff;
    box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--rd-brand-deep) 70%, transparent);
    transition: width .2s ease;
}
.rd-side__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 76px;
    padding: 18px 14px 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.rd-side__logo { display: block; min-width: 0; }
.rd-side__logo img { display: block; width: 100%; max-width: 168px; height: auto; }
.rd-side__collapse {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.rd-side__collapse:hover { background: rgba(255, 255, 255, .10); }
.rd-side__collapse svg { width: 16px; height: 16px; }
.rd-side__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 14px; scrollbar-width: none; }
.rd-side__scroll::-webkit-scrollbar { display: none; }
.rd-side__label {
    margin: 22px 10px 8px;
    color: var(--rd-side-label);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.rd-nav { display: grid; gap: 4px; }
.rd-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.rd-nav a svg { opacity: .92; width: 17px; height: 17px; }
.rd-nav a:hover { background: rgba(255, 255, 255, .10); }
.rd-nav a.is-active {
    background: #fff;
    color: var(--rd-brand-deep);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}
.rd-nav a.is-active svg { opacity: 1; }
.rd-nav .rd-count {
    margin-left: auto;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.rd-nav a.is-active .rd-count { background: var(--rd-brand); color: #fff; }
.rd-nav__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.rd-side__foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
.rd-usercard { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; }
.rd-usercard__avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    font-weight: 800;
}
.rd-usercard b { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.rd-usercard small { display: block; overflow: hidden; color: var(--rd-side-text); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.rd-usercard > div { min-width: 0; }
.rd-side__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rd-side__btns .rd-sidebtn:first-child { grid-column: 1 / -1; }
.rd-sidebtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.rd-sidebtn:hover { background: rgba(255, 255, 255, .10); }
.rd-sidebtn svg { width: 16px; height: 16px; }

/* Recolhido */
.rd-collapsed .rd-side { width: var(--rd-side-w-collapsed); }
.rd-collapsed .rd-side__logo,
.rd-collapsed .rd-side__label,
.rd-collapsed .rd-nav__text,
.rd-collapsed .rd-nav .rd-count,
.rd-collapsed .rd-usercard > div,
.rd-collapsed .rd-sidebtn span { display: none; }
.rd-collapsed .rd-side__head { justify-content: center; padding: 18px 0; }
.rd-collapsed .rd-side__collapse svg { transform: rotate(180deg); }
.rd-collapsed .rd-nav a { justify-content: center; width: 46px; margin: 0 auto; padding: 0; }
.rd-collapsed .rd-side__scroll { padding: 6px 0; }
.rd-collapsed .rd-side__btns { grid-template-columns: 1fr; }
.rd-collapsed .rd-usercard { justify-content: center; padding: 0 0 12px; }

/* ---------- Conteúdo ---------- */
.rd-main {
    flex: 1;
    min-width: 0;
    margin-left: calc(var(--rd-side-w) + var(--rd-inset) * 2);
    padding: var(--rd-inset) var(--rd-inset) 0 0;
    transition: margin-left .2s ease;
}
.rd-collapsed .rd-main { margin-left: calc(var(--rd-side-w-collapsed) + var(--rd-inset) * 2); }
.rd-page { padding: 4px 0 64px; }
.rd-footer {
    padding: 14px 0 18px;
    color: var(--rd-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* ---------- Barra superior ---------- */
.rd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    margin-bottom: 26px;
    padding: 10px 12px 10px 14px;
    border-radius: 999px;
    background: var(--rd-card);
    box-shadow: var(--rd-shadow);
}
.rd-topnav {
    display: flex;
    gap: 4px;
    min-width: 0;
    padding: 5px;
    overflow-x: auto;
    border-radius: 999px;
    background: var(--rd-soft);
    scrollbar-width: none;
}
.rd-topnav::-webkit-scrollbar { display: none; }
.rd-topnav a, .rd-topnav button {
    flex: none;
    padding: 9px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--rd-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.rd-topnav a:hover, .rd-topnav button:hover { color: var(--rd-ink); }
.rd-topnav .is-active { background: var(--rd-card); color: var(--rd-ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.rd-topbar__tools { display: flex; flex: none; align-items: center; gap: 10px; }
.rd-iconbtn {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--rd-line);
    border-radius: 50%;
    background: var(--rd-card);
    color: var(--rd-ink);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.rd-iconbtn:hover { border-color: var(--rd-brand); background: var(--rd-brand-soft); color: var(--rd-brand); }
[data-theme="dark"] .rd-iconbtn:hover { color: var(--rd-logo-accent); }
.rd-iconbtn .rd-dot-alert { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border: 2px solid var(--rd-card); border-radius: 50%; background: var(--rd-red); }
.rd-search { position: relative; display: flex; align-items: center; margin: 0; }
.rd-search input {
    width: 44px;
    height: 44px;
    padding: 0 44px 0 16px;
    border: 1px solid var(--rd-line);
    border-radius: 999px;
    background: var(--rd-card);
    color: var(--rd-ink);
    font: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: width .25s ease, border-color .15s ease;
}
.rd-search input::placeholder { color: transparent; }
.rd-search input:focus, .rd-search input:not(:placeholder-shown) { width: 240px; border-color: var(--rd-brand); cursor: text; }
.rd-search input:focus::placeholder { color: var(--rd-muted); }
.rd-search .rd-iconbtn { position: absolute; right: 0; border-color: transparent; background: transparent; pointer-events: none; }
.rd-me { display: inline-flex; align-items: center; gap: 10px; padding-left: 4px; color: var(--rd-ink); text-decoration: none; }
.rd-me__name { max-width: 160px; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.rd-avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--rd-brand), var(--rd-brand-deep));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .02em;
}
.rd-avatar--sm { width: 36px; height: 36px; font-size: 13px; }

/* ---------- Títulos ---------- */
.rd-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin: 4px 0 26px;
}
.rd-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1.08;
}
.rd-hero h1 span { color: var(--rd-muted); font-weight: 400; }
.rd-hero p { margin: 0; color: var(--rd-muted); font-size: 14px; }
.rd-hero__group {
    display: block;
    margin-bottom: 6px;
    color: var(--rd-brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
[data-theme="dark"] .rd-hero__group { color: var(--rd-logo-accent); }
.rd-hero--page h1 { font-size: clamp(26px, 2.6vw, 34px); }
.rd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Pílulas e botões ---------- */
.rd-chip, .rd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--rd-card);
    color: var(--rd-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--rd-shadow);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.rd-chip:hover, .rd-btn:hover { background: var(--rd-brand-soft); color: var(--rd-brand); }
[data-theme="dark"] .rd-chip:hover, [data-theme="dark"] .rd-btn:hover { color: var(--rd-ink); }
.rd-chip--brand, .rd-btn--brand {
    background: var(--rd-brand);
    color: #fff;
    box-shadow: 0 8px 18px -8px var(--rd-brand);
}
.rd-chip--brand:hover, .rd-btn--brand:hover { background: var(--rd-brand-deep); color: #fff; }
[data-theme="dark"] .rd-btn--brand, [data-theme="dark"] .rd-chip--brand { background: color-mix(in srgb, var(--rd-brand) 80%, #3d8bd0); }
.rd-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--rd-line); }
.rd-btn--soft { background: var(--rd-soft); box-shadow: none; }
.rd-btn--danger { background: var(--rd-red); color: #fff; box-shadow: none; }
.rd-btn--danger:hover { background: color-mix(in srgb, var(--rd-red) 85%, #000); color: #fff; }
.rd-btn--sm { min-height: 34px; padding: 0 14px; font-size: 12.5px; box-shadow: none; }
.rd-btn--icon { width: 36px; min-height: 36px; padding: 0; box-shadow: none; background: var(--rd-soft); }
.rd-btn:disabled { opacity: .55; cursor: not-allowed; }

.rd-badge {
    --st: var(--rd-brand);
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--st);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.rd-badge.is-green { --st: var(--rd-green); }
.rd-badge.is-red { --st: var(--rd-red); }
.rd-badge.is-gray { --st: color-mix(in srgb, var(--rd-muted) 80%, var(--rd-card)); }

.rd-dot {
    --st: var(--rd-muted);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--rd-card);
    color: var(--rd-ink);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px var(--rd-line);
}
.rd-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.rd-dot.is-green { --st: var(--rd-green); }
.rd-dot.is-red { --st: var(--rd-red); }
.rd-dot.is-orange { --st: var(--rd-orange); }
.rd-dot.is-gray { --st: color-mix(in srgb, var(--rd-muted) 70%, var(--rd-card)); }

.rd-toggle { display: inline-flex; flex: none; padding: 4px; border-radius: 999px; background: var(--rd-soft); }
.rd-toggle button, .rd-toggle a {
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--rd-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.rd-toggle .is-active { background: var(--rd-brand); color: #fff; box-shadow: 0 6px 14px -6px var(--rd-brand); }

/* ---------- Cartões ---------- */
.rd-grid { display: grid; gap: var(--rd-gap); margin-bottom: var(--rd-gap); }
.rd-grid--top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(0, 1fr); }
.rd-grid--bottom { grid-template-columns: minmax(0, 2.65fr) minmax(0, 1fr); align-items: start; }
.rd-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rd-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rd-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rd-stack { display: grid; gap: var(--rd-gap); align-content: start; min-width: 0; }

.rd-card {
    position: relative;
    min-width: 0;
    padding: 22px 24px 24px;
    border-radius: var(--rd-radius);
    background: var(--rd-card);
    color: var(--rd-ink);
    box-shadow: var(--rd-shadow);
}
a.rd-card { display: block; text-decoration: none; transition: transform .16s ease; }
a.rd-card:hover { transform: translateY(-2px); }
.rd-card--flush { padding: 0; overflow: hidden; }
.rd-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.rd-card__head h2 { margin: 0 0 3px; font-size: 15.5px; font-weight: 700; letter-spacing: -.015em; }
.rd-card__head p { margin: 0; color: var(--rd-muted); font-size: 12px; line-height: 1.4; }
.rd-card__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rd-card__label { display: block; color: var(--rd-muted); font-size: 12px; font-weight: 600; }
.rd-iconbox {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--rd-soft);
    color: var(--rd-ink);
}
.rd-arrow {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rd-soft);
    color: var(--rd-ink);
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.rd-arrow:hover { background: var(--rd-brand); color: #fff; transform: rotate(45deg); }

.rd-brandcard {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 20px 22px 18px;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--rd-brand) 0%, var(--rd-brand-deep) 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 16px 30px -16px var(--rd-brand);
    isolation: isolate;
}
.rd-brandcard::before {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -90px;
    z-index: -1;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.rd-brandcard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rd-brandcard__top b { font-size: 16px; font-weight: 800; font-style: italic; letter-spacing: .02em; text-transform: uppercase; }
.rd-brandcard small { color: rgba(255, 255, 255, .78); font-size: 12px; }
.rd-brandcard strong {
    font-size: clamp(30px, 2.8vw, 40px);
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.rd-brandcard__foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; color: rgba(255, 255, 255, .9); font-size: 12px; font-weight: 600; }

.rd-metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.rd-metric strong { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rd-metric--lg { justify-content: flex-start; margin: 0 0 16px; }
.rd-metric--lg strong { font-size: 42px; }

/* Barras */
.rd-chart { display: flex; flex-direction: column; }
.rd-bars { display: grid; flex: 1; grid-template-columns: auto minmax(0, 1fr); gap: 12px; min-height: 260px; padding-top: 30px; }
.rd-bars__axis { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 26px; color: var(--rd-muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.rd-bars__axis span { line-height: 0; }
.rd-bars__plot {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: clamp(8px, 1.4vw, 18px);
    background: repeating-linear-gradient(to bottom, var(--rd-line) 0 1px, transparent 1px calc((100% - 26px) / 4)) top / 100% calc(100% - 25px) no-repeat;
}
.rd-bars__col { display: grid; grid-template-rows: minmax(0, 1fr) 26px; min-width: 0; }
.rd-bars__track { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.rd-bars__bar {
    position: relative;
    width: min(100%, 62px);
    min-height: 16px;
    border-radius: 999px;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .22) 0 2px, transparent 2px 9px), color-mix(in srgb, var(--rd-brand) 45%, var(--rd-card));
    transition: height .5s ease;
}
.rd-bars__col:hover .rd-bars__bar { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .22) 0 2px, transparent 2px 9px), color-mix(in srgb, var(--rd-brand) 65%, var(--rd-card)); }
.rd-bars__col.is-current .rd-bars__bar { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .14) 0 2px, transparent 2px 9px), var(--rd-brand-deep); }
.rd-bars__col.is-current .rd-bars__bar::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 14px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--rd-brand);
    transform: translateX(-50%);
}
.rd-bars__bar em {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--rd-brand);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
    transform: translateX(-50%);
}
.rd-bars__col:last-child .rd-bars__bar em { left: auto; right: -2px; transform: none; }
.rd-bars__col small { align-self: end; color: var(--rd-muted); font-size: 11px; font-weight: 600; text-align: center; text-transform: uppercase; }

/* Rosca */
.rd-status { display: flex; flex-direction: column; }
.rd-status__body { display: grid; justify-items: center; gap: 18px; flex: 1; }
.rd-ring {
    display: grid;
    place-items: center;
    width: min(100%, 176px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, var(--rd-card) 78%, transparent 79%),
        conic-gradient(var(--rd-green) 0 calc(var(--online, 0) * 1%), var(--rd-red) 0 calc((var(--online, 0) + var(--offline, 0)) * 1%), color-mix(in srgb, var(--rd-muted) 35%, var(--rd-card)) 0);
}
.rd-ring span { display: grid; justify-items: center; }
.rd-ring small { color: var(--rd-muted); font-size: 11px; }
.rd-ring strong { font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.rd-ring strong i { color: var(--rd-muted); font-size: 22px; font-style: normal; }
.rd-legend { display: grid; gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.rd-legend li { --st: var(--rd-muted); display: flex; align-items: center; gap: 8px; color: var(--rd-muted); font-size: 12.5px; }
.rd-legend li.is-green { --st: var(--rd-green); }
.rd-legend li.is-red { --st: var(--rd-red); }
.rd-legend li.is-gray { --st: color-mix(in srgb, var(--rd-muted) 55%, var(--rd-card)); }
.rd-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--st); }
.rd-legend b { margin-left: auto; color: var(--rd-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 20px; padding: 5px; border-radius: 999px; background: var(--rd-soft); }
.rd-pair a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 999px; color: var(--rd-ink); font-size: 13px; font-weight: 650; text-decoration: none; }
.rd-pair a.is-active { background: var(--rd-brand); color: #fff; }

/* Atenção */
.rd-attention { display: grid; gap: 2px; margin: 0; padding: 8px; border-radius: var(--rd-radius-sm); background: var(--rd-soft); list-style: none; }
.rd-attention li { --st: var(--rd-muted); }
.rd-attention li.is-red { --st: var(--rd-red); }
.rd-attention li.is-orange { --st: var(--rd-orange); }
.rd-attention li.is-green { --st: var(--rd-green); }
.rd-attention a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; color: var(--rd-ink); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.rd-attention a:hover { background: var(--rd-card); }
.rd-attention i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.rd-attention span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-attention b { min-width: 30px; padding: 2px 9px; border-radius: 999px; background: var(--rd-card); font-size: 12px; text-align: center; }

/* ---------- Tabelas ---------- */
.rd-table-wrap { overflow-x: auto; }
.rd-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.rd-table th {
    padding: 10px 14px;
    color: var(--rd-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--rd-line);
}
.rd-table td { padding: 13px 14px; border-bottom: 1px solid var(--rd-row-line); vertical-align: middle; }
.rd-table tr:last-child td { border-bottom: 0; }
.rd-table tbody tr:hover td { background: var(--rd-hover); }
.rd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rd-table .muted { color: var(--rd-muted); }
.rd-table--zebra td { border-bottom: 0; }
.rd-table--zebra tbody tr:nth-child(even) td { background: var(--rd-soft); }
.rd-table--zebra td:first-child { border-radius: 16px 0 0 16px; }
.rd-table--zebra td:last-child { border-radius: 0 16px 16px 0; }
.rd-who { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 700; }
.rd-who small { display: block; color: var(--rd-muted); font-size: 11.5px; font-weight: 500; }
.rd-who .rd-avatar { width: 36px; height: 36px; font-size: 13px; }
.rd-who__letter {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--rd-soft);
    color: var(--rd-brand);
    font-size: 13px;
    font-weight: 800;
}
[data-theme="dark"] .rd-who__letter { color: var(--rd-logo-accent); }
.rd-rowactions { display: flex; justify-content: flex-end; gap: 6px; }
.rd-empty { padding: 48px 20px; color: var(--rd-muted); text-align: center; }
.rd-empty svg { width: 30px; height: 30px; margin-bottom: 8px; }
.rd-empty b { display: block; margin-bottom: 4px; color: var(--rd-ink); }

/* Lista: faixa de busca */
.rd-listbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--rd-line); }
.rd-listbar .rd-input { flex: 1; min-width: 200px; }
.rd-listfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--rd-line); color: var(--rd-muted); font-size: 12.5px; }
.rd-pages { display: flex; gap: 6px; }
.rd-pages a, .rd-pages span { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 999px; background: var(--rd-soft); color: var(--rd-ink); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.rd-pages .is-active { background: var(--rd-brand); color: #fff; }

/* Cartões de resumo das listas */
.rd-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--rd-gap); margin-bottom: var(--rd-gap); }
.rd-summary .rd-card { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.rd-summary .rd-iconbox { width: 46px; height: 46px; color: var(--rd-brand); }
[data-theme="dark"] .rd-summary .rd-iconbox { color: var(--rd-logo-accent); }
.rd-summary small { display: block; color: var(--rd-muted); font-size: 12px; font-weight: 600; }
.rd-summary strong { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* ---------- Formulários ---------- */
.rd-form { display: grid; gap: 16px; }
.rd-form--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rd-field { display: grid; gap: 6px; min-width: 0; }
.rd-field--full { grid-column: 1 / -1; }
.rd-field label, .rd-label { color: var(--rd-ink-soft); font-size: 12.5px; font-weight: 650; }
.rd-field small, .rd-help { color: var(--rd-muted); font-size: 12px; }
.rd-input, .rd-select, .rd-textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--rd-input-line);
    border-radius: 12px;
    background: var(--rd-input-bg);
    color: var(--rd-ink);
    font: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.rd-input--pill { border-radius: 999px; padding-left: 20px; }
.rd-textarea { min-height: 96px; resize: vertical; }
.rd-input:focus, .rd-select:focus, .rd-textarea:focus { border-color: var(--rd-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rd-brand) 22%, transparent); }
.rd-input[readonly] { background: var(--rd-soft); }
.rd-check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.rd-check input { width: 18px; height: 18px; accent-color: var(--rd-brand); }
.rd-switch { position: relative; width: 42px; height: 24px; flex: none; }
.rd-switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rd-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--rd-input-line); transition: background .15s; pointer-events: none; }
.rd-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.rd-switch input:checked + span { background: var(--rd-brand); }
.rd-switch input:checked + span::after { transform: translateX(18px); }
.rd-error { color: var(--rd-red); font-size: 12px; font-weight: 600; }
.rd-formfoot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.rd-code {
    display: block;
    padding: 12px 14px;
    overflow-x: auto;
    border-radius: 12px;
    background: var(--rd-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    white-space: pre;
}
.rd-kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: 13px; }
.rd-kv dt { color: var(--rd-muted); font-weight: 600; }
.rd-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Alertas */
.rd-alert { display: flex; gap: 12px; margin-bottom: var(--rd-gap); padding: 14px 18px; border-radius: var(--rd-radius-sm); background: var(--rd-card); box-shadow: var(--rd-shadow); font-size: 13px; }
.rd-alert::before { content: ""; flex: none; width: 4px; border-radius: 4px; background: var(--rd-brand); }
.rd-alert.is-green::before { background: var(--rd-green); }
.rd-alert.is-red::before { background: var(--rd-red); }

/* Modal */
.rd-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(8, 13, 22, .45); backdrop-filter: blur(3px); }
.rd-modal__box { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 24px 26px; border-radius: var(--rd-radius); background: var(--rd-card); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.rd-modal__box h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.02em; }
.rd-modal__box p { margin: 0 0 18px; color: var(--rd-muted); font-size: 13px; }

/* Toast */
.rd-toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; padding: 12px 18px; border-radius: 999px; background: var(--rd-ink); color: var(--rd-card); font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.25); }

/* ---------- Login ---------- */
.rd-login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); min-height: 100vh; padding: var(--rd-inset); gap: var(--rd-inset); }
.rd-login__art {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 44px;
    overflow: hidden;
    border-radius: var(--rd-radius);
    background: linear-gradient(160deg, var(--rd-side-from), var(--rd-side-to));
    color: #fff;
    isolation: isolate;
}
.rd-login__art::before, .rd-login__art::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: rgba(255,255,255,.06); }
.rd-login__art::before { right: -120px; bottom: -160px; width: 520px; height: 520px; }
.rd-login__art::after { right: 120px; bottom: 140px; width: 180px; height: 180px; }
.rd-login__art img { width: 220px; }
.rd-login__art h2 { max-width: 520px; margin: 0 0 12px; font-size: clamp(28px, 3vw, 42px); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.rd-login__art p { max-width: 460px; margin: 0; color: var(--rd-side-text); font-size: 15px; }
.rd-login__panel { display: grid; place-items: center; padding: 30px; border-radius: var(--rd-radius); background: var(--rd-card); box-shadow: var(--rd-shadow); }
.rd-login__form { width: min(360px, 100%); }
.rd-login__form h1 { margin: 0 0 6px; font-size: 30px; font-weight: 600; letter-spacing: -.04em; }
.rd-login__form > p { margin: 0 0 26px; color: var(--rd-muted); }
.rd-login__form .rd-btn { width: 100%; margin-top: 6px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
    .rd-grid--top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
    .rd-grid--top > :last-child { grid-column: 1 / -1; }
    .rd-grid--bottom { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .rd-side { width: var(--rd-side-w-collapsed); }
    .rd-side__logo, .rd-side__label, .rd-nav__text, .rd-nav .rd-count, .rd-usercard > div, .rd-sidebtn span { display: none; }
    .rd-side__head { justify-content: center; padding: 18px 0; }
    .rd-nav a { justify-content: center; width: 46px; margin: 0 auto; padding: 0; }
    .rd-side__scroll { padding: 6px 0; }
    .rd-side__btns { grid-template-columns: 1fr; }
    .rd-main { margin-left: calc(var(--rd-side-w-collapsed) + var(--rd-inset) * 2); }
    .rd-grid--top, .rd-grid--2, .rd-grid--3, .rd-grid--4, .rd-form--2 { grid-template-columns: 1fr; }
    .rd-topnav { display: none; }
    .rd-login { grid-template-columns: 1fr; }
    .rd-login__art { display: none; }
}

/* ---------- Sessão remota (visualizador) ---------- */
.rd-session { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: #05080e; }
.rd-session__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px auto 8px;
    padding: 6px 8px 6px 14px;
    max-width: calc(100% - 20px);
    overflow-x: auto;
    border-radius: 999px;
    background: var(--rd-card);
    color: var(--rd-ink);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    scrollbar-width: none;
}
.rd-session__bar::-webkit-scrollbar { display: none; }
.rd-session__who { display: flex; align-items: center; gap: 10px; padding-right: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.rd-session__who small { display: block; color: var(--rd-muted); font-size: 11px; font-weight: 600; }
.rd-session__sep { width: 1px; height: 26px; background: var(--rd-line); flex: none; }
.rd-session__limit { flex: none; padding: 6px 11px; border-radius: 999px; background: rgba(245, 165, 36, .16); color: #9a5b00; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-session__limit.is-ending { background: rgba(192, 53, 58, .14); color: var(--rd-red, #c0353a); }
[data-theme="dark"] .rd-session__limit { color: #f5b453; }
.rd-session__bar .rd-iconbtn { width: 38px; height: 38px; }
.rd-session__bar .rd-select { width: auto; min-height: 38px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; }
.rd-session__stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.rd-session__stage video { width: 100%; height: 100%; object-fit: contain; outline: none; cursor: default; background: #05080e; }
.rd-session__status {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    color: #d4dce2;
    font-size: 14px;
    text-align: center;
    pointer-events: none;
}
.rd-spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--rd-logo-accent); border-radius: 50%; animation: rd-spin .8s linear infinite; }
@keyframes rd-spin { to { transform: rotate(360deg); } }
.rd-route { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--rd-soft); color: var(--rd-muted); }
.rd-route.is-direct { color: var(--rd-green); }
.rd-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: min(360px, 100%);
    padding: 18px;
    border-radius: var(--rd-radius) 0 0 var(--rd-radius);
    background: var(--rd-card);
    color: var(--rd-ink);
    box-shadow: -20px 0 50px rgba(0, 0, 0, .35);
}
.rd-drawer h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; font-size: 15px; }
.rd-chat { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 8px; padding: 4px 0 12px; }
.rd-chat p { margin: 0; padding: 9px 13px; max-width: 85%; border-radius: 16px; background: var(--rd-soft); font-size: 13px; }
.rd-chat p.is-me { justify-self: end; background: var(--rd-brand); color: #fff; }
.rd-chat small { display: block; opacity: .7; font-size: 10.5px; font-weight: 700; }
.rd-filelist { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.rd-filelist li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; font-size: 13px; cursor: pointer; }
.rd-filelist li:hover { background: var(--rd-soft); }
.rd-filelist li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-filelist li small { color: var(--rd-muted); }
.rd-progress { height: 6px; border-radius: 6px; background: var(--rd-soft); overflow: hidden; }
.rd-progress i { display: block; height: 100%; background: var(--rd-brand); }
.rd-session:fullscreen .rd-session__bar { margin-top: 6px; }
