/* ==========================================================
   Sistema de Monitoramento de Presença Pública Eleitoral
   Stylesheet Principal — Redesign Pastel + Minimal Icons
   ========================================================== */

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

:root {
    --primary: #5B7FA5;
    --primary-light: #7A9DBF;
    --primary-dark: #3D5A80;
    --accent: #EE6C4D;
    --accent-light: #F3947C;
    --bg: #F5F0EB;
    --bg-white: #FFFFFF;
    --bg-warm: #FAF8F5;
    --text: #2D3142;
    --text-muted: #8D93AB;
    --border: #E8E2DA;
    --success: #6BAA75;
    --info: #6AABD2;
    --warning: #E8B85E;
    --danger: #D9726B;
    --secondary: #9DA3B4;
    --sidebar-bg: #2D3142;
    --sidebar-hover: rgba(255,255,255,0.07);
    --sidebar-active: rgba(238,108,77,0.15);
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(45,49,66,0.06);
    --shadow-lg: 0 8px 30px rgba(45,49,66,0.1);
    --shadow-card: 0 1px 4px rgba(45,49,66,0.04), 0 4px 16px rgba(45,49,66,0.04);
    --transition: all 0.25s cubic-bezier(.4,0,.2,1);
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Plan feature lists (public plans + home pricing) --- */
.plan-features {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 7px;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.plan-features li::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(91,127,165,0.4);
    border: 1px solid rgba(91,127,165,0.25);
    margin-top: 4px;
    flex-shrink: 0;
}

/* --- Dashboard (route-dashboard) refinements --- */
.route-dashboard .page-content {
    padding: 22px 24px;
}

.route-dashboard .dashboard-wrap {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

@media (max-width: 920px) {
    .route-dashboard .page-content {
        padding: 16px;
    }
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --- Login Page --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(91,127,165,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(238,108,77,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(107,170,117,0.06) 0%, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    border: 1px solid rgba(232,226,218,0.5);
}

.login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

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

.login-form .form-group {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* --- Layout: Sidebar + Content --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: 72px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-text {
    overflow: hidden;
    transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-brand-text {
    opacity: 0;
    width: 0;
}

.sidebar-brand-text h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sidebar-brand-text .sidebar-subtitle {
    font-size: 0.7rem;
    opacity: 0.5;
    display: block;
    margin-top: 1px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: auto;
    flex-shrink: 0;
}
.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    border-radius: var(--radius-sm);
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.95);
    text-decoration: none;
}

.sidebar-menu li a.active {
    background: var(--sidebar-active);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-menu li a .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}
.sidebar-menu li a:hover .nav-icon,
.sidebar-menu li a.active .nav-icon {
    opacity: 1;
}

.sidebar-menu li a .nav-label {
    transition: opacity 0.2s;
}
.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-footer .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(255,255,255,0.6);
}

.user-info {
    font-size: 0.82rem;
    opacity: 0.7;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar.collapsed .user-info {
    display: none;
}

.btn-logout {
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-logout:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}
.sidebar.collapsed .btn-logout {
    display: none;
}

/* --- Main Content --- */
.content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(.4,0,.2,1);
}

body.sidebar-collapsed .content {
    margin-left: var(--sidebar-collapsed);
}

.topbar {
    height: var(--topbar-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-display {
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 5px 12px;
    border-radius: 20px;
}

.page-content {
    padding: 28px 32px;
}

/* --- Alerts --- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    border: none;
    border-left: 4px solid;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: #EDF7EF; color: #3D6B47; border-left-color: var(--success); }
.alert-danger { background: #FAEDED; color: #8B4049; border-left-color: var(--danger); }
.alert-warning { background: #FDF6E8; color: #7A6230; border-left-color: var(--warning); }
.alert-info { background: #EBF4FA; color: #3A6B8A; border-left-color: var(--info); }

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.4;
    color: inherit;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}
.alert-close:hover { opacity: 1; background: rgba(0,0,0,0.05); }

/* --- Cards --- */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(232,226,218,0.4);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-warm);
}

.card-header h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.2px;
}

.card-body {
    padding: 24px;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
    border: 1px solid rgba(232,226,218,0.3);
}
.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: transparent;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: #E8F0F8; color: var(--primary); }
.stat-icon.green { background: #EDF7EF; color: var(--success); }
.stat-icon.orange { background: #FDF3E8; color: var(--accent); }
.stat-icon.purple { background: #F0ECF8; color: #7C6BAA; }

.stat-info { flex: 1; }

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -1px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 500;
}

/* --- Charts --- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card .card-body {
    padding: 16px;
    position: relative;
    height: 280px;
}

/* --- Tables --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.table th {
    background: var(--bg-warm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 12px 14px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(232,226,218,0.4);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(91,127,165,0.03);
}
.table tbody tr {
    transition: background 0.15s ease;
}

.td-title { max-width: 300px; }
.td-title a { font-weight: 500; }

.td-url { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

.actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}

.inline-form {
    display: inline;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-success { background: #EDF7EF; color: #4A8055; }
.badge-info { background: #EBF4FA; color: #4A82A0; }
.badge-warning { background: #FDF6E8; color: #9A7D3A; }
.badge-danger { background: #FAEDED; color: #A65454; }
.badge-secondary { background: #F0EDE9; color: #7A7682; }

/* --- Tags --- */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    background: #E3F2FD;
    color: var(--primary);
    margin: 2px 3px 2px 0;
}
.tag-more {
    background: #F0F0F0;
    color: var(--text-muted);
}

/* --- Score Bars --- */
.score-bar {
    display: inline-block;
    width: 60px;
    height: 8px;
    background: #E9ECEF;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 4px;
}

.score-bar-lg {
    width: 100%;
    height: 10px;
    background: #E9ECEF;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 4px;
}

.score-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.5s ease;
}

.score-low { background: var(--success); }
.score-medium { background: var(--warning); }
.score-high { background: var(--danger); }
.score-topic { background: var(--primary-light); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    gap: 7px;
    letter-spacing: -0.1px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,49,66,0.1); }

.btn-primary {
    background: var(--primary-dark);
    color: #fff;
}
.btn-primary:hover { background: var(--primary); color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #C4605A; color: #fff; }

.btn-outline {
    background: var(--bg-white);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); border-color: var(--primary-light); color: var(--primary-dark); }

.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
    padding: 15px 20px;
    font-size: 0.92rem;
    border-radius: 10px;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="search"],
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-white);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,127,165,0.12);
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.select-sm {
    padding: 4px 10px;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
}

/* --- Filters --- */
.filter-card {
    margin-bottom: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-grid .form-group {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: end;
    padding-top: 20px;
}

/* --- Page Actions --- */
.page-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: 4px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}
.page-link:hover { background: var(--bg-warm); text-decoration: none; border-color: var(--primary-light); }
.page-link.active {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
}

/* --- Detail Page --- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #F0F2F5;
    gap: 12px;
}

.detail-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    min-width: 120px;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    word-break: break-word;
}

.detail-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.detail-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.reason-list,
.evidence-list {
    list-style: none;
    padding: 0;
}

.reason-list li,
.evidence-list li {
    padding: 6px 0 6px 16px;
    position: relative;
    font-size: 0.88rem;
}

.reason-list li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.evidence-list li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: var(--info);
}

/* --- Verdict Display --- */
.verdict-display {
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 16px;
}

.verdict-display .verdict-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.verdict-display .verdict-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

.verdict-success { background: #EDF7EF; color: #4A8055; }
.verdict-info { background: #EBF4FA; color: #4A82A0; }
.verdict-warning { background: #FDF6E8; color: #9A7D3A; }
.verdict-danger { background: #FAEDED; color: #A65454; }

/* --- Topic List --- */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topic-name {
    font-weight: 600;
    font-size: 0.88rem;
    min-width: 120px;
}

.topic-score {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 40px;
}

/* --- Clean Text --- */
.clean-text-display {
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: #FAFBFC;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .sidebar.collapsed { width: 100%; }
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .sidebar-brand-text,
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .btn-logout {
        opacity: 1; width: auto; display: initial;
    }
    .sidebar-menu {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
        gap: 4px;
    }
    .sidebar-menu li a {
        padding: 8px 14px;
        white-space: nowrap;
        font-size: 0.82rem;
    }
    .sidebar-toggle { display: none; }
    .content, body.sidebar-collapsed .content {
        margin-left: 0;
    }
    .topbar {
        position: relative;
    }
    .page-content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .filter-grid {
        grid-template-columns: 1fr;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .detail-row {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-value { font-size: 1.4rem; }
}

/* --- Action Panel (Crawler / Fact-Check Buttons) --- */
.action-panel {
    margin-bottom: 24px;
    border-left: 4px solid var(--accent);
    border-color: var(--accent);
}

.btn-action {
    padding: 10px 22px;
    font-size: 0.92rem;
    font-weight: 600;
    gap: 8px;
    transition: all 0.25s ease;
}
.btn-action:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-action:disabled {
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-factcheck {
    background: var(--success);
    color: #fff;
}
.btn-factcheck:hover:not(:disabled) {
    background: #5C9A66;
    color: #fff;
}

.action-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 16px;
    background: #EBF4FA;
    border-radius: var(--radius-sm);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.action-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(91,127,165,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.action-result {
    flex-basis: 100%;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.action-success {
    background: #EDF7EF;
    color: #3D6B47;
    border: 1px solid #D5E8D9;
}

.action-error {
    background: #FAEDED;
    color: #8B4049;
    border: 1px solid #EEDADA;
}

/* --- User Avatar (Sidebar + Profile) --- */
.sidebar-footer .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    overflow: hidden;
    transition: var(--transition);
}
.sidebar-footer .user-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px rgba(238,108,77,0.3);
}
.sidebar-footer .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.user-info-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.82rem;
}
.user-info-link:hover {
    color: #fff;
    text-decoration: none;
}

/* --- Profile Page --- */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.profile-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(45,49,66,0.12);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-initials {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.profile-avatar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- Table Avatar (Users list) --- */
.table-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    overflow: hidden;
}
.table-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Settings: Toggle password visibility --- */
.btn-toggle-pass {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-toggle-pass:hover {
    opacity: 1;
}

/* --- Sidebar Separator --- */
.sidebar-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 16px;
    list-style: none;
}
