/* ============================================================
   WARTK CONTROL CENTER v4.0 — "BLACKOUT" THEME
   Preto neutro real · hairlines · mono-labels técnicos
   Display: Schibsted Grotesk · Corpo: Archivo · Dados: JetBrains Mono
   ============================================================ */

/* --- Reset & Variables --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Backgrounds — neutro grafite, sem azul */
    --bg-body: #070708;
    --bg-sidebar: #0a0a0c;
    --bg-card: #101013;
    --bg-card-hover: #16161a;
    --bg-input: #0b0b0e;
    --bg-hover: rgba(34, 197, 94, 0.07);
    --bg-surface: #131317;
    --bg-overlay: rgba(0, 0, 0, 0.72);

    /* Aliases legados */
    --bg-soft: #131317;
    --border-soft: rgba(255, 255, 255, 0.08);
    --card-bg: #101013;

    /* Borders — hairlines */
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --border-focus: #22c55e;

    /* Colors */
    --accent: #22c55e;
    --accent-hover: #4ade80;
    --accent-soft: rgba(34, 197, 94, 0.10);
    --accent-glow: rgba(34, 197, 94, 0.28);
    --purple: #a78bfa;
    --purple-soft: rgba(167, 139, 250, 0.10);
    --cyan: #22d3ee;
    --cyan-soft: rgba(34, 211, 238, 0.10);

    /* Semantic */
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.10);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.10);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.10);
    --info: #22c55e;
    --info-soft: rgba(34, 197, 94, 0.10);

    /* Text — zinc neutro */
    --text: #f4f4f5;
    --text-secondary: #d4d4d8;
    --text-soft: #a1a1aa;
    --text-muted: #6b6b74;

    /* Layout */
    --sidebar-w: 260px;
    --sidebar-collapsed-w: 72px;
    --header-h: 64px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows — duras e curtas, sem borrão */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow: 0 1px 2px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 2px 4px rgba(0,0,0,0.5), 0 16px 48px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 24px rgba(34,197,94,0.18);

    /* Typography */
    --font: 'Archivo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Schibsted Grotesk', 'Archivo', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

    /* Transitions */
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.1s ease;
    --transition-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Atmosfera: glow vermelho no topo + malha técnica sutil */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(880px 420px at 72% -12%, rgba(34,197,94,0.08), transparent 62%),
        linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
    background-size: auto, 44px 44px, 44px 44px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
pre { font-family: var(--font-mono); }

::selection { background: rgba(34,197,94,0.35); color: #fff; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 1000;
    transition: transform var(--transition-slow), width var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(34,197,94,0.05), transparent);
}

.sidebar-brand-logo {
    width: 38px; height: 38px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(34,197,94,0.55));
}

.sidebar-brand-text h1 {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
}

.sidebar-brand-text span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    white-space: nowrap;
}

/* "Wartk Menu" centralizado na linha do icone; subtitulo (Painel v3.0) fora do fluxo, logo abaixo */
.sidebar-brand-text { position: relative; }
.sidebar-brand-text > span { position: absolute; top: calc(100% + 1px); left: 0; }

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0 1rem;
}

.sidebar-section {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    padding: 1.15rem 1.25rem 0.4rem;
    white-space: nowrap;
}

.sidebar-section::before { content: '// '; color: rgba(34,197,94,0.55); }

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 1.25rem;
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 2px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.03);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(34,197,94,0.13), transparent 80%);
    border-left-color: var(--accent);
    font-weight: 600;
}

.nav-link.active i { color: var(--accent); }

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color var(--transition);
}

.nav-link .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 10px rgba(34,197,94,0.35);
}

.sidebar-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
    background: rgba(255,255,255,0.012);
}

.sidebar-footer strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* --- Mobile sidebar toggle --- */
.menu-toggle {
    display: none;
    position: fixed;
    top: 0.75rem; left: 0.75rem;
    z-index: 1100;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    background: rgba(16,16,19,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.menu-toggle:hover { border-color: var(--accent); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0; /* permite encolher abaixo da largura do conteudo (tabela larga) -> .table-wrapper rola sozinho, sem scroll na pagina */
    min-height: 100vh;
    padding: 1.75rem;
    transition: margin-left var(--transition-slow);
    max-width: 100%;
    position: relative;
    z-index: 1;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.page-header-left h2 {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    line-height: 1.25;
}

.page-header-left h2 i {
    color: var(--accent);
    font-size: 1.1rem;
}

.page-header-left p {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-top: 0.2rem;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-soft);
    white-space: nowrap;
}

.pill i { color: var(--text-muted); font-size: 0.65rem; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.user-chip-avatar {
    width: 26px; height: 26px;
    border-radius: 5px;
    background: linear-gradient(150deg, var(--accent), #14532d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
}

.user-chip span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.25);
    background: transparent;
    transition: all var(--transition);
    text-decoration: none;
    cursor: pointer;
}

.btn-logout:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.022), transparent 38%),
        var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}

.card-header h3 {
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--accent);
    font-size: 0.85rem;
}

.card-header span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-header > div > span {
    display: block;
    margin-top: 0.15rem;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.022), transparent 42%),
        var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.15;
    margin-top: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.stat-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.stat-icon.blue    { background: var(--accent-soft);  color: var(--accent);  border-color: rgba(34,197,94,0.18); }
.stat-icon.green   { background: var(--success-soft); color: var(--success); border-color: rgba(34,197,94,0.18); }
.stat-icon.red     { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(239,68,68,0.18); }
.stat-icon.yellow  { background: var(--warning-soft); color: var(--warning); border-color: rgba(245,158,11,0.18); }
.stat-icon.purple  { background: var(--purple-soft);  color: var(--purple);  border-color: rgba(167,139,250,0.18); }
.stat-icon.cyan    { background: var(--cyan-soft);    color: var(--cyan);    border-color: rgba(34,211,238,0.18); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    margin: 0 -1.25rem;
    padding: 0 1.25rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

tbody td {
    padding: 0.62rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: rgba(34, 197, 94, 0.035);
}

tbody tr:last-child td {
    border-bottom: none;
}

.td-mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-soft);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label,
.form-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.58rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    transition: all var(--transition);
    outline: none;
}

.form-control:hover { border-color: var(--border-strong); }

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.14);
    background: #0d0d10;
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-control[type="checkbox"] {
    width: auto;
    accent-color: var(--accent);
}

small, .form-help {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 1.05rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #fff;
    border-color: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 3px rgba(0,0,0,0.5);
}
.btn-primary:hover {
    background: linear-gradient(180deg, #4ade80, #22c55e);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 16px rgba(34, 197, 94, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(180deg, #25d066, #16a34a);
    color: #fff;
    border-color: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 3px rgba(0,0,0,0.5);
}
.btn-success:hover {
    filter: brightness(1.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 16px rgba(34, 197, 94, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(180deg, #f25050, #dc2626);
    color: #fff;
    border-color: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 1px 3px rgba(0,0,0,0.5);
}
.btn-danger:hover {
    filter: brightness(1.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 4px 16px rgba(239, 68, 68, 0.32);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
    color: #1a1203;
    border-color: rgba(255,255,255,0.15);
}
.btn-warning:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-purple {
    background: linear-gradient(180deg, #a78bfa, #8b5cf6);
    color: #fff;
    border-color: rgba(255,255,255,0.12);
}
.btn-purple:hover {
    filter: brightness(1.07);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-soft);
    border-color: var(--border-strong);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border-color: var(--accent);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.5rem;
}
.btn-ghost:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.btn-sm {
    padding: 0.32rem 0.7rem;
    font-size: 0.72rem;
}

.btn-lg {
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
}

.btn-icon {
    padding: 0.4rem;
    width: 34px; height: 34px;
    justify-content: center;
}

.w-full { width: 100%; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.badge-active  { background: var(--success-soft); color: var(--success); border-color: rgba(34,197,94,0.22); }
.badge-expired { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(239,68,68,0.22); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(245,158,11,0.22); }
.badge-info    { background: var(--info-soft);    color: #4ade80;        border-color: rgba(34,197,94,0.22); }
.badge-purple  { background: var(--purple-soft);  color: var(--purple);  border-color: rgba(167,139,250,0.22); }
.badge-cyan    { background: var(--cyan-soft);    color: var(--cyan);    border-color: rgba(34,211,238,0.22); }
.badge-neutral { background: rgba(255,255,255,0.05); color: var(--text-soft); border-color: var(--border); }

.badge i { font-size: 0.55rem; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-left-width: 3px;
    line-height: 1.5;
}

.alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-soft);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.18);
    border-left-color: var(--success);
}

.alert-error {
    background: var(--danger-soft);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.18);
    border-left-color: var(--danger);
}

.alert-warning {
    background: var(--warning-soft);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.18);
    border-left-color: var(--warning);
}

.alert-info {
    background: var(--info-soft);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.18);
    border-left-color: var(--accent);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px; height: 32px;
    padding: 0 0.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a {
    color: var(--text-soft);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.pagination a:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.pagination span.current {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(34,197,94,0.3);
}

.pagination .ellipsis {
    color: var(--text-muted);
    border: none;
}

/* Barra: total + seletor de quantidade por pagina */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.018);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}
.pagination-info { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-soft); }
.pagination-info i { color: var(--accent); }
.pagination-info strong { color: var(--text); font-family: var(--font-mono); }
.per-page-form { margin: 0; }
.per-page-label { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.75rem; }
.per-page-label select {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    cursor: pointer;
}
.per-page-label select:focus { outline: none; border-color: var(--accent); }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-wrapper {
    position: relative;
    height: 250px;
    padding: 0.5rem 0;
}

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

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

.grid-main-side {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
}

.grid-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* ============================================================
   INFO PANEL (key details, system info, etc.)
   ============================================================ */
.info-panel {
    display: flex;
    flex-direction: column;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.info-value {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.info-value.mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ============================================================
   MINI STATS (compact horizontal stats)
   ============================================================ */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.mini-stat {
    text-align: center;
    padding: 0.8rem 0.5rem;
    background: rgba(255,255,255,0.018);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.mini-stat:hover { border-color: var(--border-strong); }

.mini-stat-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.mini-stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   DAY MANAGER & BULK ACTIONS
   ============================================================ */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.018);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bulk-toolbar .bulk-label {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.25rem;
}

.bulk-toolbar .bulk-count {
    background: var(--accent);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.bulk-toolbar .form-control {
    max-width: 80px;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
}

.bulk-separator {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
    margin: 0 0.25rem;
}

.select-all-filtered-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
}

.select-all-filtered-toggle:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--accent);
}

.select-all-filtered-toggle input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

/* Day manager (edit_key page) */
.day-manager {
    padding: 0.85rem;
    background: rgba(255,255,255,0.018);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.day-manager-title {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.day-manager-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   OPTION CARDS (radio/checkbox styled cards)
   ============================================================ */
.option-cards {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.8rem;
    color: var(--text-soft);
}

.option-card:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.option-card.selected,
.option-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(34,197,94,0.3);
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    accent-color: var(--accent);
    flex-shrink: 0;
}

.option-card span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ============================================================
   TOGGLE CARD (checkbox toggle)
   ============================================================ */
.toggle-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.82rem;
    color: var(--text-soft);
}

.toggle-card.checked {
    border-color: var(--warning);
    background: var(--warning-soft);
    color: var(--warning);
}

.toggle-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   AUTOCOMPLETE
   ============================================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #141418;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}

.autocomplete-list.open {
    display: block;
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-soft);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.autocomplete-item:hover {
    background: var(--accent-soft);
    color: var(--text);
}

/* ============================================================
   CUSTOM DURATION (create_key)
   ============================================================ */
.custom-duration {
    display: none;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.018);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 2.75rem 1rem;
    color: var(--text-muted);
}

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

.empty-state p {
    font-size: 0.82rem;
}

/* ============================================================
   DELETE CARD
   ============================================================ */
.delete-card {
    max-width: 480px;
    width: 100%;
}

.delete-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius-lg);
    background: var(--danger-soft);
    border: 1px solid rgba(239,68,68,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.delete-icon i {
    font-size: 1.35rem;
    color: var(--danger);
}

/* ============================================================
   ACTION GRID (dashboard quick actions)
   ============================================================ */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.action-grid .btn {
    justify-content: center;
    padding: 0.65rem;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.025), transparent 30%),
        #131316;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.96) translateY(12px);
    transition: transform var(--transition);
}

.modal-backdrop.open .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
    transition: opacity 0.3s ease;
    border: 1px solid transparent;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.toast-success {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

.toast-error {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-info {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.3);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    background:
        radial-gradient(720px 420px at 50% -8%, rgba(34, 197, 94, 0.12) 0%, transparent 60%),
        var(--bg-body);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent 32%),
        var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.4s ease both;
}

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

.login-brand-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(150deg, #4ade80, #14532d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.85rem;
    box-shadow: 0 0 0 1px rgba(34,197,94,0.4), 0 8px 28px rgba(34, 197, 94, 0.3);
}

.login-brand-logo i {
    font-size: 1.4rem;
    color: #fff;
}

.login-brand h1 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.login-brand p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ============================================================
   COMMAND FORMS (painel_admin)
   ============================================================ */
.command-form {
    display: none;
    margin-top: 0.75rem;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.018);
    border: 1px dashed var(--border-strong);
}

.command-form.active { display: block; }

/* Players list (painel_admin) */
.players-list {
    max-height: 380px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

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

.player-hwid {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-soft);
}

.player-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.key-info { font-size: 0.72rem; margin-top: 2px; }
.key-valid { color: var(--success); }
.key-invalid { color: var(--danger); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-soft    { color: var(--text-soft); }

.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.25rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.25rem; }

.mono { font-family: var(--font-mono); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

/* Selection highlight */
.row-selected {
    background: var(--accent-soft) !important;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade { animation: fadeIn 0.35s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Entrada suave em cascata dos blocos principais */
.main-content > .card,
.main-content > .stats-grid,
.main-content > .grid-2,
.main-content > .grid-3,
.main-content > .grid-main-side,
.main-content > .gh-activity-wrap {
    animation: fadeIn 0.4s ease both;
}
.main-content > *:nth-child(2) { animation-delay: 0.03s; }
.main-content > *:nth-child(3) { animation-delay: 0.06s; }
.main-content > *:nth-child(4) { animation-delay: 0.09s; }
.main-content > *:nth-child(5) { animation-delay: 0.12s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Live indicator */
.live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s ease-in-out infinite;
}

/* Foco acessivel e consistente */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- Status dot (online/offline de device) ---- */
.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; vertical-align:middle; flex-shrink:0; }
.status-dot--on   { background:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,0.16); animation: wkDotPulse 2s ease-in-out infinite; }
.status-dot--off  { background:#ef4444; box-shadow:0 0 0 3px rgba(239,68,68,0.12); }
.status-dot--none { background:#6b6b74; opacity:0.7; }
.status-dot-lbl   { font-size:0.7rem; margin-left:0.3rem; color:var(--text-muted); vertical-align:middle; }
@keyframes wkDotPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ============================================================
   NOVIDADES — atividade GitHub (heatmap + commits)
   ============================================================ */
.gh-activity-wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 760px) { .gh-activity-wrap { grid-template-columns: 1fr; } }
/* min-width:0 deixa o card encolher abaixo da largura do heatmap */
.gh-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.022), transparent 38%),
        var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    min-width: 0; max-width: 100%; overflow: hidden;
    transition: border-color var(--transition);
}
.gh-card:hover { border-color: var(--border-strong); }
.gh-card-head { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; color: var(--text); margin-bottom: 0.9rem; }
.gh-card-head i { color: var(--accent); }
.gh-total { margin-left: auto; font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-muted); font-weight: 500; }
.gh-scroll { overflow-x: auto; padding-bottom: 0.3rem; }
.gh-scroll::-webkit-scrollbar { height: 6px; }
.gh-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.gh-grid { display: flex; gap: 3px; min-width: max-content; }
.gh-week { display: flex; flex-direction: column; gap: 3px; }
.gh-cell { width: 11px; height: 11px; border-radius: 2px; display: block; }
.gh-cell.gh-empty { background: transparent; }
.gh-l0 { background: rgba(255,255,255,0.05); }
.gh-l1 { background: rgba(34,197,94,0.30); }
.gh-l2 { background: rgba(34,197,94,0.50); }
.gh-l3 { background: rgba(34,197,94,0.75); }
.gh-l4 { background: var(--accent); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.gh-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 0.68rem; color: var(--text-muted); margin-top: 0.6rem; }
.gh-legend .gh-cell { width: 10px; height: 10px; }
.gh-commits-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.gh-commit { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.5rem 0.1rem; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.gh-commit:last-child { border-bottom: none; }
.gh-commit > i { color: var(--accent); font-size: 0.7rem; margin-top: 0.25rem; }
.gh-commit-text { color: var(--text-secondary); flex: 1; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.gh-commit-date { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted); white-space: nowrap; margin-top: 0.15rem; }
.gh-empty-msg { font-size: 0.78rem; color: var(--text-muted); padding: 1.2rem 0.2rem; text-align: center; }

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 1024px) {
    .grid-main-side {
        grid-template-columns: 1fr;
    }
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    html { font-size: 13px; }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

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

    .menu-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 3.75rem;
    }

    .page-header {
        flex-direction: column;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .page-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }

    .stat-card { padding: 1rem; }

    .stat-value {
        font-size: 1.45rem;
    }

    .grid-2, .grid-sidebar {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    /* Responsive table: card layout on mobile */
    .table-responsive-cards thead {
        display: none;
    }

    .table-responsive-cards tbody tr {
        display: block;
        padding: 0.85rem;
        margin-bottom: 0.6rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: rgba(255,255,255,0.018);
    }

    .table-responsive-cards tbody tr:hover {
        background: rgba(255,255,255,0.03);
        border-color: var(--border-strong);
    }

    .table-responsive-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
        border-bottom: 1px solid var(--border);
        gap: 0.75rem;
    }

    .table-responsive-cards tbody td:last-child {
        border-bottom: none;
    }

    .table-responsive-cards tbody td::before {
        content: attr(data-label);
        font-family: var(--font-mono);
        font-size: 0.62rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        flex-shrink: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .bulk-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .bulk-separator {
        display: none;
    }

    .option-cards {
        flex-direction: column;
    }

    .option-card {
        width: 100%;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .modal {
        max-width: none;
        margin: 0.5rem;
    }

    /* Touch targets confortaveis */
    .btn { min-height: 38px; }
    .btn-sm { min-height: 32px; }
    .form-control { min-height: 40px; }
    textarea.form-control { min-height: 80px; }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.85rem;
    }

    .stat-value { font-size: 1.3rem; }

    .card {
        padding: 1rem;
        border-radius: var(--radius);
    }

    .page-header-left h2 {
        font-size: 1.2rem;
    }

    .mini-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn {
        font-size: 0.75rem;
        padding: 0.45rem 0.8rem;
    }

    .page-header-right .pill { display: none; }
    .page-header-right .pill:first-child { display: inline-flex; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .sidebar, .menu-toggle, .sidebar-overlay,
    .page-header-right, .form-actions, .bulk-toolbar,
    .btn-logout { display: none !important; }

    .main-content { margin-left: 0; }

    body { background: #fff; color: #000; }
    body::before { display: none; }

    .card { border: 1px solid #ddd; box-shadow: none; background: #fff; }
}

/* ============================================================
   REDESIGN v4 — presença do logo (vibe hacker) + View Transitions
   (migrado do redesign Astro; só apresentação, sem lógica)
   ============================================================ */
.bg-hacker { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-hacker::before {
    content: ""; position: absolute; right: -60px; top: -70px; width: 360px; height: 360px;
    background: url("logo.png") center / contain no-repeat;
    opacity: 0.14; filter: drop-shadow(0 0 50px rgba(34, 197, 94, 0.55));
}
.bg-hacker::after {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 3px);
}
@media (prefers-reduced-motion: no-preference) {
    .bg-hacker::before { animation: wkBreathe 9s ease infinite alternate; }
}
@keyframes wkBreathe { from { opacity: 0.10; } to { opacity: 0.18; } }
@media (prefers-reduced-motion: reduce) { .bg-hacker::before { animation: none; } }
