/* StarPainelWeb - Design System */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-0: #0d1117;
    --bg-1: #161b22;
    --bg-2: #1c2128;
    --bg-3: #21262d;
    --border: rgba(48,54,61,0.8);
    --border-light: rgba(255,255,255,0.06);
    --cyan: #00d4ff;
    --cyan-dim: rgba(0,212,255,0.15);
    --cyan-glow: rgba(0,212,255,0.4);
    --purple: #7c3aed;
    --purple-dim: rgba(124,58,237,0.15);
    --green: #3fb950;
    --green-dim: rgba(63,185,80,0.15);
    --yellow: #f0883e;
    --yellow-dim: rgba(240,136,62,0.15);
    --red: #f85149;
    --red-dim: rgba(248,81,73,0.15);
    --text-0: #e6edf3;
    --text-1: #c9d1d9;
    --text-2: #8b949e;
    --text-3: #484f58;
    --sidebar-w: 240px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --transition: 180ms cubic-bezier(0.4,0,0.2,1);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-0);
    color: var(--text-0);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Layout */
.app-container { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
}

.sidebar-logo {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border);
}

.logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--cyan-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(0,212,255,0.7)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 14px rgba(0,212,255,1)) drop-shadow(0 0 24px rgba(124,58,237,0.5)); transform: scale(1.05); }
}

.logo-text { font-size: 15px; font-weight: 700; color: var(--text-0); letter-spacing: -0.3px; }
.logo-sub { font-size: 11px; color: var(--text-2); }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-section { margin-bottom: 20px; }

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    padding: 0 8px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    margin-bottom: 1px;
}

.nav-item:hover {
    background: var(--bg-3);
    color: var(--text-0);
}

.nav-item.active {
    background: var(--cyan-dim);
    color: var(--cyan);
    border-left: 2px solid var(--cyan);
    padding-left: 8px;
}

.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; }

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    margin-bottom: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-0); }
.user-role { font-size: 11px; color: var(--text-2); }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(248,81,73,0.2);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(248,81,73,0.25);
    border-color: rgba(248,81,73,0.4);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 24px;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

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

/* ===== HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-0);
}

.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: border-color var(--transition);
}

.card:hover { border-color: rgba(48,54,61,1); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-0);
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--card-color, var(--cyan));
    opacity: 0.8;
}

.stat-card:hover {
    border-color: var(--card-color, var(--cyan));
    box-shadow: 0 0 20px rgba(0,212,255,0.08);
    transform: translateY(-1px);
}

.stat-card.cyan { --card-color: var(--cyan); }
.stat-card.purple { --card-color: var(--purple); }
.stat-card.green { --card-color: var(--green); }
.stat-card.yellow { --card-color: var(--yellow); }

.stat-icon {
    font-size: 20px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--card-color, var(--cyan));
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; }

.stat-trend {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 20px;
    background: var(--green-dim);
    color: var(--green);
}

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead tr { border-bottom: 1px solid var(--border); }

th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-2);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-1);
    font-size: 13px;
}

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

tbody tr:hover { background: var(--bg-2); }
tbody tr:last-child td { border-bottom: none; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--cyan);
    color: #000;
}
.btn-primary:hover { background: #00b8e6; box-shadow: 0 0 16px var(--cyan-glow); }

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(248,81,73,0.25);
}
.btn-danger:hover { background: rgba(248,81,73,0.25); }

.btn-success {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(63,185,80,0.25);
}
.btn-success:hover { background: rgba(63,185,80,0.25); }

.btn-ghost {
    background: var(--bg-3);
    color: var(--text-1);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text-0); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-cyan { background: var(--cyan-dim); color: var(--cyan); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-0);
    font-size: 13px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-dim);
}

.form-input::placeholder { color: var(--text-3); }

/* ===== CONSOLE ===== */
.console-wrapper {
    background: #0a0a0f;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.console-topbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.console-dot.red { background: #ff5f57; }
.console-dot.yellow { background: #ffbd2e; }
.console-dot.green { background: #28ca42; }

.console-title {
    font-size: 12px;
    color: var(--text-2);
    margin-left: 8px;
    font-family: 'Courier New', monospace;
}

.console-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--green);
}

.console-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.console-output {
    padding: 12px;
    height: 420px;
    overflow-y: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: #a8b5c5;
}

.console-line { display: block; }
.console-line.level-info { color: #a8b5c5; }
.console-line.level-warn { color: #f0883e; }
.console-line.level-error { color: #f85149; }
.console-line.level-cmd { color: #00d4ff; }
.console-line.level-success { color: #3fb950; }

.console-input-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    gap: 10px;
}

.console-prompt { color: var(--cyan); font-family: monospace; font-size: 13px; flex-shrink: 0; }

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-0);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    caret-color: var(--cyan);
}

.console-input::placeholder { color: var(--text-3); }

/* Linha de comando atribuída a um usuário */
.console-user-cmd {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    margin: 3px 0;
    background: rgba(0,212,255,0.07);
    border-left: 2px solid var(--cyan);
    border-radius: 0 5px 5px 0;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12.5px;
    flex-wrap: nowrap;
}
.console-user-cmd .cmd-avatar {
    width: 18px; height: 18px;
    border-radius: 3px;
    image-rendering: pixelated;
    flex-shrink: 0;
}
.console-user-cmd .cmd-user  { color: var(--cyan); font-weight: 700; white-space: nowrap; }
.console-user-cmd .cmd-arrow { color: var(--text-3); }
.console-user-cmd .cmd-text  { color: var(--text-0); }

/* ===== LOGIN ===== */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-0);
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: bgPulse 4s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow);
    animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1);
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
    box-shadow: 0 0 32px var(--cyan-glow);
}

.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text-0); }
.login-logo p { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.login-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    margin-top: 4px;
    justify-content: center;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 14px;
    cursor: pointer;
    user-select: none;
}
.remember-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-top: 14px;
    display: none;
}

.alert-error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,81,73,0.25); display: block; }
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(63,185,80,0.25); display: block; }

/* ===== LOADING / EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-2);
}

.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-text { font-size: 14px; }

.skeleton {
    background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 14px;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 440px;
    transform: scale(0.95) translateY(8px);
    transition: transform var(--transition);
}

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

.modal-title { font-size: 17px; font-weight: 600; color: var(--text-0); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ===== TAGS / CHIPS ===== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-3);
    color: var(--text-2);
    border: 1px solid var(--border);
}

/* ===== CHART ===== */
.chart-container {
    position: relative;
    padding-top: 8px;
}

canvas.sparkline { width: 100%; height: 80px; }

/* ===== SEARCH ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-0);
    font-size: 13px;
}

.search-bar input::placeholder { color: var(--text-3); }

/* ===== MISC ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.text-muted { color: var(--text-2); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-cyan { color: var(--cyan); }

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mb-3 { margin-bottom: 12px; }

/* ===== SERVER LOGO ===== */
.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(0,212,255,0.7));
    animation: logoPulse 2.5s ease-in-out infinite;
    image-rendering: pixelated;
}

@keyframes loginLogoPulse {
    0%, 100% { filter: drop-shadow(0 0 18px rgba(0,212,255,0.9)) drop-shadow(0 0 40px rgba(0,212,255,0.4)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 28px rgba(0,212,255,1)) drop-shadow(0 0 60px rgba(0,212,255,0.6)) drop-shadow(0 0 80px rgba(124,58,237,0.4)); transform: scale(1.06); }
}

.logo-icon-fallback {
    display: none;
}

/* ===== SKIN AVATAR ===== */
.user-skin-wrap {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.user-skin-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    image-rendering: pixelated;
    display: block;
}

.user-skin-fallback {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

/* ===== FILE EDITOR ===== */
.editor-modal {
    max-width: 900px;
    width: 95vw;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.editor-filename {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--cyan);
    background: var(--bg-0);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.editor-textarea {
    width: 100%;
    min-height: 400px;
    background: #0a0a0f;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #a8b5c5;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    padding: 12px;
    resize: vertical;
    outline: none;
    tab-size: 2;
}

.editor-textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-dim);
}

/* ===== MINI STATS BAR (console) ===== */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.mini-stat {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.mini-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mini-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-2);
}

.mini-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-0);
    font-variant-numeric: tabular-nums;
}

/* ===== ACTIVITY TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}
.timeline-item:last-child { border-bottom: none; }

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}
.dot-login    { background: var(--green-dim);  color: var(--green); }
.dot-logout   { background: var(--red-dim);    color: var(--red); }
.dot-comando  { background: var(--cyan-dim);   color: var(--cyan); }
.dot-arquivo  { background: var(--purple-dim); color: var(--purple); }
.dot-kick     { background: var(--yellow-dim); color: var(--yellow); }
.dot-whitelist{ background: var(--cyan-dim);   color: var(--cyan); }
.dot-usuario  { background: var(--purple-dim); color: var(--purple); }
.dot-backup   { background: #431407;           color: #fb923c; }
.dot-other    { background: var(--bg-3);       color: var(--text-3); }

.timeline-content { flex: 1; min-width: 0; }
.timeline-action { font-size: 13px; font-weight: 600; color: var(--text-0); }
.timeline-details { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-time { font-size: 11px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; margin-top: 4px; }
.timeline-user { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--cyan); background: var(--cyan-dim); padding: 1px 7px; border-radius: 20px; margin-top: 4px; }

/* ===== TOAST ===== */
/* ── Diff viewer syntax colors ── */
.dhl-key     { color: #79b8ff; }
.dhl-str     { color: #9ecbff; }
.dhl-num     { color: #f8c555; }
.dhl-kw      { color: #ff7b72; }
.dhl-comment { color: #6a737d; font-style: italic; }

/* ── Diff line hover ── */
.diff-line { transition: filter .1s; }
.diff-add:hover  { filter: brightness(1.15); }
.diff-rem:hover  { filter: brightness(1.15); }
.diff-same:hover { background: var(--bg-2) !important; }

.panel-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-2);
    border: 1px solid var(--accent);
    color: var(--text-0);
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s, transform .3s;
    z-index: 9999;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.panel-toast.visible { opacity: 1; transform: translateY(0); }

/* ===== NOTIFICAÇÕES EM TEMPO REAL ===== */
.notif-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 8900;
    pointer-events: none;
    align-items: flex-end;
}

.notif-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--notif-accent, var(--accent));
    border-radius: 10px;
    padding: 10px 14px 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 320px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity .3s ease, transform .3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.notif-card.visible  { opacity: 1; transform: translateX(0); }
.notif-card.leaving  { opacity: 0; transform: translateX(30px); }

.notif-avatar {
    width: 32px; height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    image-rendering: pixelated;
}
.notif-avatar-init {
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
}
.notif-body { flex: 1; min-width: 0; }
.notif-label { font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
.notif-msg   { font-size: 13px; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* barra de progresso animada na base do card */
.notif-bar {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    width: 100%;
    background: var(--notif-accent, var(--accent));
    transform-origin: left;
    animation: notif-bar-shrink 8s linear forwards;
    border-radius: 0 0 10px 0;
}
@keyframes notif-bar-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ===== MOBILE TOPBAR ===== */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    z-index: 150;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
}

.mobile-title { font-size: 14px; font-weight: 700; color: var(--text-0); flex: 1; }

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-1);
    flex-shrink: 0;
    transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-2); color: var(--text-0); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 190;
    backdrop-filter: blur(2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mobile-topbar { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
        width: 260px;
        z-index: 200;
    }

    body.sidebar-open .sidebar { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.7); }
    body.sidebar-open .sidebar-backdrop { display: block; }

    .main-content {
        margin-left: 0;
        padding: 72px 14px 20px;
    }

    .page-header { flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
    .page-title { font-size: 18px; }
    .header-actions { flex-wrap: wrap; gap: 6px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .mini-stats  { grid-template-columns: 1fr; }

    .card { padding: 14px; }
    .modal { margin: 12px; max-width: calc(100vw - 24px); }

    /* Login */
    .login-card { margin: 16px; padding: 28px 20px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .main-content { padding: 66px 12px 16px; }
}
