/* DBR Licence — Glassmorphism Dashboard */

:root {
    --bg: #080a12;
    --bg-elevated: rgba(255, 255, 255, 0.04);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-strong: rgba(255, 255, 255, 0.14);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --blue: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.45);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.4);
    --orange: #f97316;
    --orange-glow: rgba(249, 115, 22, 0.4);
    --green: #22c55e;
    --red: #ef4444;
    --radius: 20px;
    --radius-sm: 12px;
    --sidebar-w: 80px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --blur: blur(20px);
    --content-pad: 2rem 2.5rem 2.5rem;
    --grid-gap: 1.35rem;
}

*, *::before, *::after { box-sizing: border-box; }

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

[hidden] { display: none !important; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: #60a5fa; }

code {
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
    background: rgba(255,255,255,0.06);
    padding: 0.15em 0.45em;
    border-radius: 6px;
    color: #cbd5e1;
}

.muted { color: var(--text-muted); }
.center { text-align: center; }

/* ── Background glows ── */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

.bg-glow-orange {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.25) 0%, transparent 70%);
    top: -100px;
    right: -80px;
}

.bg-glow-blue {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
    bottom: 10%;
    left: 15%;
}

/* ── Glass card base ── */
.glass-card {
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem 1.65rem;
    min-height: 0;
}

.card-title {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: capitalize;
}

.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-head-row .card-title { margin: 0; }

/* ── Auth ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.auth-page::before,
.auth-page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.auth-page::before {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.3), transparent 70%);
    top: -80px;
    right: -60px;
}

.auth-page::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 70%);
    bottom: 5%;
    left: 10%;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.auth-brand { text-align: center; margin-bottom: 1.75rem; }

.auth-brand h1 {
    margin: 0.85rem 0 0.3rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.auth-brand p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.brand-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 0 24px var(--blue-glow);
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-hint {
    margin: 1.25rem 0 0;
    font-size: 0.78rem;
    color: var(--text-dim);
    text-align: center;
}

/* ── App shell ── */
.app-body { min-height: 100vh; position: relative; }

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ── */
.app-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0;
    gap: 0.5rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    background: rgba(8, 10, 18, 0.6);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding-top: 0.5rem;
}

.nav-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text);
    background: var(--glass-hover);
    border-color: var(--glass-border);
    text-decoration: none;
}

.nav-item.active,
.nav-home.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.25));
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 20px var(--blue-glow);
}

.nav-item i { font-size: 1.1rem; }

.sidebar-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding-bottom: 0.5rem;
}

.user-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: default;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 0 16px var(--blue-glow);
}

.user-name {
    font-size: 0.65rem;
    color: var(--text-dim);
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.user-chevron { display: none; }

.nav-logout { color: var(--text-dim); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
    backdrop-filter: blur(4px);
}

.sidebar-backdrop:not([hidden]) { display: block; }

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 300;
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass);
    backdrop-filter: var(--blur);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ── Main ── */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    padding: var(--content-pad);
    width: calc(100% - var(--sidebar-w));
}

.app-content {
    width: 100%;
    max-width: none;
}

/* ── Dashboard grid ── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--grid-gap);
    width: 100%;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

/* Greeting card */
.card-greeting {
    padding: 1.75rem 2rem 0.75rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.greeting-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.greeting-label {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.greeting-name {
    margin: 0.15rem 0 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.greeting-sub {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.greeting-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.glow-stat {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.glow-stat.warn {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.25);
}

.glow-stat strong { color: var(--text); }

.sparkline-wrap {
    margin-top: 0.75rem;
    height: 80px;
    opacity: 0.9;
}

.sparkline {
    width: 100%;
    height: 100%;
    display: block;
}

/* Weather / status card */
.card-weather {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.weather-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.weather-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(139,92,246,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 1.1rem;
}

.weather-temp {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-muted);
}

.weather-temp strong { color: var(--text); font-weight: 600; }

.weather-range {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.weather-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: auto;
}

.weather-meta i { margin-right: 0.3rem; color: var(--blue); }

/* Ring charts */
.card-ring,
.card-timer {
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.ring-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.ring-chart {
    --pct: 0;
    width: 115px;
    height: 115px;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        var(--blue) 0%,
        var(--purple) calc(var(--pct) * 1%),
        rgba(255,255,255,0.06) calc(var(--pct) * 1%),
        rgba(255,255,255,0.06) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 24px var(--blue-glow);
    flex-shrink: 0;
}

.ring-chart::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: rgba(8, 10, 18, 0.85);
}

.ring-chart.ring-orange {
    background: conic-gradient(
        from -90deg,
        var(--orange) 0%,
        var(--purple) calc(var(--pct) * 1%),
        rgba(255,255,255,0.06) calc(var(--pct) * 1%),
        rgba(255,255,255,0.06) 100%
    );
    box-shadow: 0 0 24px var(--orange-glow);
}

.ring-chart.ring-small {
    width: 92px;
    height: 92px;
}

.ring-value {
    position: relative;
    z-index: 1;
    font-size: 1.35rem;
    font-weight: 700;
}

.ring-value.sm { font-size: 1rem; }

.ring-legend {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ring-legend strong { color: var(--text); }

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.dot-blue { background: var(--blue); box-shadow: 0 0 8px var(--blue-glow); }
.dot-purple { background: var(--purple); box-shadow: 0 0 8px var(--purple-glow); }
.dot-orange { background: var(--orange); box-shadow: 0 0 8px var(--orange-glow); }
.dot-red { background: var(--red); }
.dot-muted { background: var(--text-dim); }

.card-timer .btn-glow { margin-top: 0.85rem; width: 100%; }

/* Bar chart */
.card-bars {
    min-height: 240px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.65rem;
    height: 190px;
    padding-top: 1.75rem;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
    max-width: 72px;
}

.bar {
    width: 100%;
    max-width: 40px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--blue), rgba(59, 130, 246, 0.3));
    box-shadow: 0 0 16px var(--blue-glow);
    margin-top: auto;
    transition: height 0.4s ease;
}

.bar-col.highlight .bar {
    background: linear-gradient(180deg, #60a5fa, var(--purple));
    box-shadow: 0 0 24px var(--purple-glow);
}

.bar-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bar-tooltip {
    position: absolute;
    top: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}

/* Shortcuts */
.card-shortcuts {
    min-height: 240px;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1rem 0.5rem;
    min-height: 72px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.shortcut:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.15);
}

.shortcut i { font-size: 1.15rem; color: var(--blue); }

/* Events list */
.card-events {
    min-height: 240px;
}
.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.event-item:last-child { border-bottom: none; }

.event-item.muted-item { color: var(--text-dim); font-size: 0.85rem; }

.event-date {
    text-align: center;
    min-width: 36px;
}

.event-date strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.event-date span {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.event-body {
    flex: 1;
    min-width: 0;
}

.event-body strong {
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-body span {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* System status */
.card-system {
    min-height: 240px;
}

.system-row {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.system-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.gauge-label {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.system-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sys-bar-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.sys-bar-track {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
}

.sys-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.sys-bar-fill.blue { background: linear-gradient(90deg, var(--blue), #60a5fa); box-shadow: 0 0 10px var(--blue-glow); }
.sys-bar-fill.purple { background: linear-gradient(90deg, var(--purple), #a78bfa); box-shadow: 0 0 10px var(--purple-glow); }
.sys-bar-fill.orange { background: linear-gradient(90deg, var(--orange), #fb923c); box-shadow: 0 0 10px var(--orange-glow); }

/* Page headers (inner pages) */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.35rem 1.5rem;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.page-licencas,
.page-mods,
.page-logs,
.page-admins {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-info {
    padding: 1rem 1.35rem;
}

.admin-info i { margin-right: 0.35rem; color: var(--blue); }

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-control {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control option { background: #1e293b; }

textarea.form-control { resize: vertical; min-height: 60px; }

.form-hint {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin: 0;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-form .flex-grow { flex: 1; min-width: 180px; }

.filter-actions { display: flex; gap: 0.5rem; align-items: center; }

.filter-panel { margin-bottom: 0; }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-head h2 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Buttons */
.btn, .btn-glow, .btn-ghost, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-glow {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    box-shadow: 0 4px 20px var(--blue-glow);
}

.btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px var(--blue-glow);
    color: #fff;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    box-shadow: 0 4px 20px var(--blue-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
    text-decoration: none;
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
.btn-block { width: 100%; }

.btn-icon, .btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.15s;
}

.btn-icon { width: 36px; height: 36px; font-size: 0.95rem; }
.btn-icon-sm { width: 30px; height: 30px; font-size: 0.75rem; }

.btn-icon:hover, .btn-icon-sm:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--text);
    border-color: rgba(59, 130, 246, 0.3);
}

.btn-icon-sm.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
}

.inline-form { display: inline; }

/* Table */
.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
    color: var(--text-muted);
}

.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

.row-actions { display: flex; gap: 4px; white-space: nowrap; }

.token-preview { margin-right: 0.25rem; color: #94a3b8; }

/* Badges & tags */
.badge {
    display: inline-block;
    padding: 0.25em 0.7em;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: capitalize;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.25); }
.badge-warning { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.25); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-secondary { background: rgba(255,255,255,0.06); color: var(--text-dim); }

.tag {
    display: inline-block;
    padding: 0.2em 0.65em;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.code-block {
    display: block;
    background: rgba(0,0,0,0.35);
    color: #94a3b8;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid var(--glass-border);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: var(--blur);
}

.alert-success { background: rgba(34, 197, 94, 0.12); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.25); }
.alert-danger { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.alert-warning { background: rgba(249, 115, 22, 0.12); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.25); }

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-dim);
}

.empty-state i { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.3; }
.empty-state p { margin: 0; }

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay:not([hidden]) { display: flex; }

.modal {
    background: rgba(15, 18, 30, 0.95);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-head h3 { margin: 0; font-size: 1rem; font-weight: 600; }

.modal-close {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    width: 32px;
    height: 32px;
}

.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.modal-body { padding: 1.35rem; }

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

/* Confirm */
#confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#confirm-overlay:not([hidden]) { display: flex; }

.confirm-box {
    background: rgba(15, 18, 30, 0.95);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.confirm-box p { margin: 0 0 1.25rem; color: var(--text-muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(15, 18, 30, 0.95);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.7rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    z-index: 700;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toast-in 0.2s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Legacy panel alias */
.panel {
    background: var(--glass);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
}

/* Responsive */
@media (min-width: 1600px) {
    html, body { font-size: 16px; }

    .dash-grid { gap: 1.5rem; }

    .greeting-name { font-size: 2.15rem; }

    .ring-chart {
        width: 125px;
        height: 125px;
    }

    .bar-chart { height: 210px; }
}

@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
    .span-2, .span-3, .span-4 { grid-column: span 2; }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: 72px;
    }

    .app-sidebar.open { transform: translateX(0); }

    .app-main { margin-left: 0; padding: 4rem 1rem 1.5rem; }

    .sidebar-toggle { display: flex; }

    .dash-grid { grid-template-columns: 1fr; }
    .span-2, .span-3, .span-4 { grid-column: span 1; }

    .greeting-top { flex-direction: column; }
    .greeting-stats { flex-direction: row; align-items: flex-start; }
    .system-row { flex-direction: column; align-items: stretch; }
    .form-row { grid-template-columns: 1fr; }

    .page-header { flex-direction: column; align-items: flex-start; }

    .licencas-table-desktop { display: none; }
    .licencas-cards-mobile { display: flex; flex-direction: column; gap: 0.75rem; }
}

/* ── Extra features ── */
.header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.global-search-wrap {
    position: relative;
    margin-bottom: 1.25rem;
    max-width: 480px;
}

.global-search-wrap > i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.global-search {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: var(--blur);
    color: var(--text);
    font-family: inherit;
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(15, 18, 30, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    z-index: 400;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.search-item {
    display: block;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-decoration: none;
    color: var(--text);
}

.search-item:hover { background: rgba(59,130,246,0.1); text-decoration: none; }
.search-item span { display: block; font-size: 0.75rem; color: var(--text-dim); margin-top: 0.15rem; }
.search-empty { padding: 1rem; color: var(--text-dim); font-size: 0.85rem; }

.alert-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.08);
}

.alert-banner i { color: var(--orange); font-size: 1.25rem; }

.detail-panel {
    position: fixed;
    inset: 0;
    z-index: 550;
    display: flex;
    justify-content: flex-end;
}

.detail-panel[hidden] { display: none !important; }

.detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.detail-panel-inner {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 100%;
    overflow-y: auto;
    border-radius: 0;
    margin: 0;
    z-index: 1;
}

.detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.licencas-cards-mobile { display: none; }

.page-perfil .simple-list { list-style: none; padding: 0; margin: 0; }

/* Light theme */
html[data-theme="light"] {
    --bg: #e8edf5;
    --glass: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
}

html[data-theme="light"] .app-sidebar {
    background: rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .nav-item { color: #64748b; }
html[data-theme="light"] .nav-item.active { color: #1d4ed8; }

html[data-theme="light"] .search-results {
    background: #fff;
    color: #0f172a;
}
