/* ============================================ */
/* ROOT VARIABLES & GLOBAL RESET               */
/* ============================================ */
:root {
    --primary: #ff1f3d;
    --primary-dark: #b8102b;
    --primary-light: #ff5c5c;
    --primary-glow: rgba(255, 31, 61, 0.28);
    --primary-glow-strong: rgba(255, 31, 61, 0.45);
    --shadow-primary: 0 10px 30px rgba(255, 31, 61, 0.35);
    --shadow-primary-hover: 0 16px 44px rgba(255, 31, 61, 0.48);
    --sidebar-bg: #0c0f16;
    --sidebar-bg-2: #000000;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --surface: #ffffff;
    --surface-2: #f4f6fb;
    --surface-3: #edf0f7;
    --text: #1a1d2e;
    --text-muted: #6b7280;
    --border: #e5e9f2;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --card-shadow: 0 1px 2px rgba(24, 30, 42, 0.04), 0 4px 24px rgba(24, 30, 42, 0.07);
    --card-shadow-hover: 0 4px 8px rgba(24, 30, 42, 0.06), 0 12px 44px rgba(24, 30, 42, 0.14);
    --shadow-xs: 0 1px 3px rgba(24, 30, 42, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --sidebar-width: 240px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 70px;
    --mobile-toggle-size: 44px;
    --focus-ring: 0 0 0 3px var(--primary-glow-strong);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--surface-2);
    color: var(--text);
    overflow-x: hidden;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* Scrollbar refinado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cdd3e0;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b7bfd0;
}

/* Foco visível consistente para acessibilidade e navegação por teclado */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.class-card:focus-visible,
.upload-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================ */
/* SIDEBAR & NAVIGATION                         */
/* ============================================ */
.sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
    background-size: 200% 100%;
    animation: shimmer 3s ease infinite;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--primary-glow-strong);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.sidebar-logo-area {
    padding: 30px 20px 22px;
    text-align: center;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
}

.sidebar-logo-area img {
    width: 65%;
    max-width: 120px;
    opacity: 0.94;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.sidebar-logo-area img:hover {
    opacity: 1;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    margin-top: 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.nav-section-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    padding: 10px 12px 6px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.62);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.1px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
    position: relative;
    transition: var(--transition);
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    min-height: 44px;
    /* tap target mínimo */
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    transition: height 0.25s ease;
    flex-shrink: 0;
}

.sidebar .nav-link i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar .nav-link:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link:hover i {
    transform: scale(1.2);
    color: var(--primary-light);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(255, 31, 61, 0.32), rgba(255, 31, 61, 0.1));
    box-shadow: inset 0 0 0 1px rgba(255, 31, 61, 0.3), 0 0 20px -4px var(--primary-glow-strong);
}

.sidebar .nav-link.active::before {
    height: 70%;
    width: 4px;
    box-shadow: 0 0 10px var(--primary);
}

.sidebar .nav-link.active i {
    color: var(--primary-light);
    filter: drop-shadow(0 0 6px var(--primary-glow-strong));
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-cookie-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    margin-bottom: 8px;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Sora', sans-serif;
    font-size: 11.5px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-cookie-link:hover {
    color: #fff;
}

.btn-logout {
    width: 100%;
    background: rgba(255, 31, 61, 0.12);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 31, 61, 0.25);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    min-height: 44px;
}

.btn-logout:hover {
    background: rgba(255, 31, 61, 0.25);
    color: #fff;
    border-color: rgba(255, 31, 61, 0.5);
    transform: translateY(-1px);
}

/* ============================================ */
/* MAIN CONTENT & HEADER                        */
/* ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
}

.page-header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    box-shadow: 0 1px 0 rgba(24, 30, 42, 0.02), 0 8px 24px -12px rgba(24, 30, 42, 0.12);
    flex-wrap: wrap;
    gap: 12px;
    min-height: 70px;
}

.page-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

.page-header h1 {
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.4px;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.page-header .breadcrumb-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.6px;
    margin-top: 3px;
    text-transform: uppercase;
}

.dashboard-page-header .breadcrumb-text {
    text-transform: none;
    letter-spacing: 0.2px;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.dashboard-api-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-api-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #6b7280;
}

.dashboard-api-status[data-state="online"] .dashboard-api-status-dot {
    background: #059669;
}

.dashboard-api-status[data-state="offline"] .dashboard-api-status-dot {
    background: #dc2626;
}

:root[data-theme="dark"] .dashboard-api-status[data-state="online"] .dashboard-api-status-dot {
    background: #34d399;
}

:root[data-theme="dark"] .dashboard-api-status[data-state="offline"] .dashboard-api-status-dot {
    background: #f87171;
}

.page-body {
    padding: 30px 32px 40px;
    max-width: 100%;
    overflow-x: hidden;
}

/* ============================================ */
/* DASHBOARD CARDS                              */
/* ============================================ */
.dashboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 28px;
}

.dashboard-stats .stat-card {
    flex: 1 1 180px;
    min-width: 0;
}

.stat-card {
    border-radius: var(--radius);
    padding: 26px;
    position: relative;
    overflow: hidden;
    border: none;
    transition: var(--transition);
    animation: fadeUp 0.6s ease both;
    background: var(--surface);
    box-shadow: var(--card-shadow);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 140%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.stat-card-connected {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
}

.stat-card-blue {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    color: #fff;
}

.stat-card-red {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: var(--card-shadow), 0 0 0 1px rgba(255, 31, 61, 0.15);
}

.stat-card-red:hover {
    box-shadow: var(--shadow-primary-hover);
}

.stat-card-icon {
    font-size: 30px;
    opacity: 0.9;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    position: relative;
    z-index: 1;
}

.stat-card-value {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -1px;
    overflow-wrap: break-word;
    word-break: break-word;
    position: relative;
    z-index: 1;
}

.stat-card-label {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.stat-card-sub {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 8px;
    overflow-wrap: break-word;
    position: relative;
    z-index: 1;
}

/* ============================================ */
/* CARDS GERAIS                                 */
/* ============================================ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    background: var(--surface);
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card:hover {
    border-color: #d8dded;
}

.card-text {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 60px;
}

.card-header h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.1px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    overflow-wrap: break-word;
}

.card-header h5 i {
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 31, 61, 0.1);
    border-radius: 8px;
}

.card-header.success-header {
    background: linear-gradient(135deg, #059669, #10b981);
}

.card-header.success-header h5 {
    color: #fff;
}

.card-header.success-header h5 i {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.card-body {
    padding: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================ */
/* SYNC CARD                                    */
/* ============================================ */
.sync-card {
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.sync-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.sync-icon {
    font-size: 24px;
    margin-right: 12px;
    color: #3b82f6;
}

.sync-icon.syncing {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.sync-status-text {
    font-weight: 600;
    font-size: 16px;
}

.sync-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.connection-online {
    background: #10b981;
    color: white;
}

.connection-offline {
    background: #ef4444;
    color: white;
}

/* ============================================ */
/* BUTTONS & FORMS                              */
/* ============================================ */
.btn {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    letter-spacing: 0.2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    border: none;
    min-height: 38px;
    padding: 8px 16px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(255, 31, 61, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-outline-secondary {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background: var(--surface-3);
    border-color: #c8cdd9;
    color: var(--text);
}

.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
    min-height: 32px;
}

.btn-danger {
    background: var(--primary-dark);
    color: white;
}

.btn-danger:hover {
    background: #a71d2a;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    display: block;
}

.form-control,
.form-select {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition-fast);
    width: 100%;
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:hover,
.form-select:hover {
    border-color: #c8cdd9;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
    outline: none;
}

.form-control::placeholder {
    color: #9aa1b2;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input {
    min-width: 18px;
    min-height: 18px;
}

/* ============================================ */
/* TABLES & BADGES                              */
/* ============================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-radius: 0 0 var(--radius) var(--radius);
}

.table {
    font-size: 13.5px;
    color: var(--text);
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
}

.table thead th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
    background: var(--surface-2);
    white-space: nowrap;
}

.table tbody td {
    padding: 13px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    overflow-wrap: break-word;
    max-width: 200px;
    transition: background 0.15s ease;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:nth-child(even) td {
    background: rgba(244, 246, 251, 0.5);
}

.table tbody tr:hover td {
    background: var(--surface-3);
}

.badge {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.4px;
    padding: 4px 11px;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
    line-height: 1.4;
    box-shadow: var(--shadow-xs);
}

.badge.bg-primary {
    background: var(--primary) !important;
    color: #fff;
}

.badge.bg-success {
    background: var(--success) !important;
    color: #fff;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: #1a1d2e;
}

.badge.bg-danger {
    background: var(--primary-dark) !important;
    color: #fff;
}

.badge.bg-secondary {
    background: var(--text-muted) !important;
    color: #fff;
}

.badge.bg-info {
    background: var(--info) !important;
    color: #fff;
}

/* ============================================ */
/* MOBILE COMPONENTS (HAMBURGER & OVERLAY)     */
/* ============================================ */

.mobile-menu-toggle {
    display: none;
    /* Ativado via media query */
    position: fixed;
    top: 13px;
    left: 13px;
    z-index: 1200;
    background: var(--sidebar-bg);
    color: white;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-sm);
    width: var(--mobile-toggle-size);
    height: var(--mobile-toggle-size);
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.15s ease;
    overflow: hidden;
}

/* Ícones internos do botão – hambúrguer e seta ficam sobrepostos */
.mobile-menu-toggle i {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

/* Estado padrão: hambúrguer visível, seta escondida */
.mobile-menu-toggle .icon-open {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.mobile-menu-toggle .icon-close {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

/* Quando sidebar está aberta: vira seta ← */
.mobile-menu-toggle.is-open .icon-open {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.mobile-menu-toggle.is-open .icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Move o botão para dentro do sidebar + muda visual */
.mobile-menu-toggle.is-open {
    left: calc(var(--sidebar-width) - var(--mobile-toggle-size) - 8px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

.mobile-menu-toggle:hover {
    background: #242c3d;
}

.mobile-menu-toggle.is-open:hover {
    background: rgba(255, 255, 255, 0.16);
}

.mobile-menu-toggle:active {
    transform: scale(0.92);
}

/* ── Overlay ────────────────────────────────────────── */
/* Sempre renderizado mas invisível e sem interação por padrão.
   pointer-events:none quando oculto CORRIGE o bug de "clique
   fora do nada abrindo o menu". */
.sidebar-overlay {
    display: block !important;
    /* Sempre no DOM */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1040;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================ */
/* ANIMATIONS & UTILITIES                       */
/* ============================================ */
.tab-pane {
    animation: fadeIn 0.35s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}

.markdown-preview {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: var(--surface-2);
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.alert-image-preview {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    box-shadow: var(--card-shadow);
    display: block;
}

.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13.5px;
    padding: 12px 16px;
    overflow-wrap: break-word;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border-left: 3px solid #3b82f6;
}

.alert-danger {
    background: rgba(255, 31, 61, 0.08);
    color: var(--primary-dark);
    border-left: 3px solid var(--primary);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-left: 3px solid var(--warning);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border-left: 3px solid var(--success);
}

/* ============================================ */
/* ESCALA & AVISOS SPECIFICS                    */
/* ============================================ */
.escala-item {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    transition: var(--transition);
    animation: fadeUp 0.3s ease both;
}

.escala-item:hover {
    border-color: #c8cdd9;
    box-shadow: var(--card-shadow);
}

.escala-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    border-radius: 3px 0 0 3px;
    box-shadow: 2px 0 8px var(--primary-glow);
}

.alert-card {
    border: 1.5px solid var(--border) !important;
    transition: var(--transition);
}

.alert-card:hover {
    box-shadow: var(--card-shadow-hover) !important;
}

.list-group-item {
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-family: 'Sora', sans-serif;
    transition: var(--transition);
    word-break: break-word;
    overflow-wrap: break-word;
}

.list-group-item:hover {
    background: var(--surface-2);
    padding-left: 24px;
}

.dev-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--surface);
    outline: 2px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: var(--transition);
}

.dev-avatar:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-primary-hover);
}

/* ============================================ */
/* MODALS                                       */
/* ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px rgba(15, 20, 30, 0.28);
    overflow: hidden;
    font-family: 'Sora', sans-serif;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header.bg-primary {
    background: linear-gradient(120deg, var(--primary-dark), var(--primary) 60%, var(--primary-light)) !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.2px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overflow-x: hidden;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    flex-wrap: wrap;
    gap: 8px;
}

.modal-footer .btn {
    flex: 1 1 auto;
    min-width: 100px;
}

pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: var(--sidebar-bg);
    color: #a8c7fa;
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs .nav-link {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 18px;
    border-radius: 0;
    transition: var(--transition);
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.nav-tabs {
    border-bottom: 1.5px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    display: flex;
}

.nav-tabs::-webkit-scrollbar {
    height: 0;
}

.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.table-info>td {
    background-color: rgba(255, 31, 61, 0.06) !important;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 6px;
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }
}

/* ============================================ */
/* UPLOADS GRID & CARDS                         */
/* ============================================ */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.upload-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    touch-action: manipulation;
}

.upload-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary);
}

.upload-thumbnail {
    width: 100%;
    height: 160px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.upload-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-icon {
    font-size: 48px;
    color: var(--text-muted);
}

.upload-info {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.upload-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.upload-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.empty-uploads {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.file-viewer-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

.file-viewer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    max-height: 70vh;
    overflow: auto;
}

.file-viewer-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.file-viewer-content .file-info {
    text-align: center;
    padding: 20px;
}

/* ============================================ */
/* CLASS SELECTOR MODAL                         */
/* ============================================ */
.class-selector-modal .modal-dialog {
    max-width: 700px;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.class-card {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 80px;
    justify-content: center;
}

.class-card:hover {
    border-color: var(--primary);
    background: rgba(255, 31, 61, 0.07);
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

.class-card i {
    font-size: 24px;
    color: var(--primary);
    display: block;
    flex-shrink: 0;
}

.class-selector-icon {
    color: var(--primary);
    display: block;
    flex-shrink: 0;
}

.page-header h1 > .class-selector-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
    vertical-align: -0.15em;
}

.nav-turmas-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.4rem;
    vertical-align: -0.12em;
    flex-shrink: 0;
}

.class-card span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
}

.nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.admin-badge {
    background: rgba(255, 31, 61, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    vertical-align: middle;
}

/* ============================================ */
/* SOBRE PAGE SPECIFIC                          */
/* ============================================ */
#sobre .card-body {
    overflow-x: visible;
}

#sobre p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 16px;
    overflow-wrap: break-word;
}

#sobre .list-group-item {
    font-size: 13px;
    padding: 12px 16px;
}

#sobre h3 {
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 700;
}

#sobre h4 {
    font-size: 15px;
    margin: 20px 0 12px;
    font-weight: 700;
}

#sobre .list-group {
    margin-bottom: 20px;
}

#sobre .alert {
    margin-top: 20px;
}

/* Version Badge */
.version-badge {
    display: flex;
    align-items: center;
}

.version-number {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 30px;
    box-shadow: var(--shadow-primary);
}

/* Typing Animation */
.typing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.typing-name {
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 22px;
    color: var(--text);
    margin: 0;
    word-break: break-word;
}

.cursor {
    font-size: 22px;
    font-weight: 400;
    color: var(--primary);
    animation: blink 0.8s infinite;
    flex-shrink: 0;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.role-badge {
    background: linear-gradient(135deg, rgba(255, 31, 61, 0.15), rgba(255, 31, 61, 0.08));
    color: var(--primary);
    font-size: 12px;
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid rgba(255, 31, 61, 0.2);
    display: inline-block;
    text-align: center;
}

/* Stats Highlight Cards */
.stats-highlight {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-highlight-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.5s ease both;
}

.stat-highlight-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-highlight-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-highlight-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-highlight-card:nth-child(4) {
    animation-delay: 0.4s;
}

.stat-highlight-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    box-shadow: 0 0 12px var(--primary-glow-strong);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-highlight-card:hover::before {
    transform: scaleX(1);
}

.stat-highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.stat-highlight-icon {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 12px;
}

.stat-highlight-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -1px;
    overflow-wrap: break-word;
}

.stat-highlight-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
}

.stat-highlight-trend {
    font-size: 10px;
    color: var(--success);
    margin-top: 6px;
    font-weight: 500;
    overflow-wrap: break-word;
}

/* Tech Ticker */
.tech-ticker-container {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    height: 200px;
    position: relative;
    margin-top: 12px;
}

.tech-ticker {
    animation: scrollTech 20s linear infinite;
    padding: 8px 0;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
}

.tech-item:last-child {
    border-bottom: none;
}

.tech-item i {
    font-size: 18px;
    color: var(--primary);
    width: 28px;
    flex-shrink: 0;
}

.tech-item:hover {
    background: var(--surface-2);
    padding-left: 24px;
    color: var(--primary);
}

@keyframes scrollTech {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

.tech-ticker:hover {
    animation-play-state: paused;
}

/* Info Cards */
.info-card {
    transition: var(--transition);
    height: 100%;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.info-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    overflow-wrap: break-word;
}

.info-card-text {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
    overflow-wrap: break-word;
}

/* Contact List */
.contact-list {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.contact-list .list-group-item {
    display: flex;
    align-items: center;
    transition: var(--transition);
    border-left: 3px solid transparent;
    overflow: hidden;
    gap: 8px;
}

.contact-list .list-group-item:hover {
    background: var(--surface-3);
    border-left-color: var(--primary);
    padding-left: 20px;
}

.contact-list .list-group-item span,
.contact-list .list-group-item {
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-updated {
    font-size: 11px;
    opacity: 0.7;
}

/* Loading animation for stats */
@keyframes statPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        color: var(--primary);
    }

    100% {
        transform: scale(1);
    }
}

.stat-updated {
    animation: statPulse 0.4s ease;
}

/* ============================================ */
/* RESPONSIVE — DESKTOP LARGO (min-width: 1440px) */
/* ============================================ */
@media (min-width: 1440px) {
    .page-body {
        padding: 32px 40px 48px;
    }

    .stat-card-value {
        font-size: 38px;
    }
}

/* ============================================ */
/* RESPONSIVE — TABLET (max-width: 1199px)     */
/* ============================================ */
@media (max-width: 1199px) {
    .page-body {
        padding: 24px 28px;
    }

    .stat-card-value {
        font-size: 32px;
    }

    .stat-card {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ============================================ */
/* RESPONSIVE — TABLET/MOBILE (max-width: 991px) */
/* ============================================ */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 260px;
    }

    /* Sidebar oculto por padrão, desliza ao abrir */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1060;
        width: var(--sidebar-width);
        box-shadow: none;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 6px 0 32px rgba(0, 0, 0, 0.35);
    }

    /* Botão hambúrguer ativo */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Conteúdo principal ocupa tela toda */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Header — padding-left para não cobrir o botão hambúrguer */
    .page-header {
        padding: 0 14px 0 calc(var(--mobile-toggle-size) + 28px);
        min-height: 64px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-header>div:first-child {
        flex: 1 1 0;
        min-width: 0;
    }

    .page-header h1 {
        font-size: 17px;
    }

    .page-body {
        padding: 16px;
    }

    .card-header {
        padding: 14px 16px;
    }

    .card-body {
        padding: 16px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card-value {
        font-size: 28px;
    }

    .stat-card-icon {
        font-size: 26px;
    }

    /* Todas colunas Bootstrap → full width */
    .col-md-4,
    .col-md-5,
    .col-md-6,
    .col-md-7,
    .col-md-8,
    .col-md-auto {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Exceção: botão "Atualizar" ao lado do select fica inline */
    .col-auto {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Stats cards: 2 por linha no tablet */
    .row.mb-4.g-3>[class*="col-md-"] {
        flex: 0 0 calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
        width: calc(50% - 8px) !important;
    }

    /* Sync card */
    .sync-card .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .sync-card #manualSyncBtn {
        width: 100%;
    }

    /* Rows */
    .row.g-3,
    .row.g-4 {
        --bs-gutter-x: 0;
        --bs-gutter-y: 0.75rem;
    }

    /* Tabela */
    .table tbody td {
        max-width: 150px;
    }

    /* Stats grid — sobre page */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ============================================ */
/* RESPONSIVE — MOBILE (max-width: 767px)      */
/* ============================================ */
@media (max-width: 767px) {
    .dashboard-page-header {
        align-items: flex-start;
    }

    .dashboard-header-actions {
        flex: 0 0 100%;
        justify-content: flex-end;
        padding-bottom: 8px;
    }

    .page-header {
        padding: 0 12px 0 60px;
        min-height: 58px;
        gap: 6px;
    }

    .page-header h1 {
        font-size: 15px;
    }

    .page-header .breadcrumb-text {
        font-size: 10px;
    }

    .page-body {
        padding: 12px;
    }

    /* Stats: 1 por linha no mobile */
    .row.mb-4.g-3>[class*="col-md-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .stat-card-value {
        font-size: 24px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .stat-card-label {
        font-size: 11px;
    }

    /* Cards */
    .card {
        margin-bottom: 14px;
    }

    .card-header {
        padding: 12px 14px;
        min-height: 50px;
    }

    .card-header h5 {
        font-size: 13px;
    }

    .card-body {
        padding: 14px;
    }

    /* Forms — font-size 16px evita zoom automático no iOS */
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    .form-label {
        font-size: 11px;
    }

    /* Botões */
    .btn {
        font-size: 12px;
    }

    .btn-sm {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* Modais */
    .modal-body {
        padding: 14px;
        max-height: 80dvh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-footer {
        padding: 12px 14px;
        gap: 8px;
    }

    .modal-title {
        font-size: 14px;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Action buttons */
    .action-buttons {
        flex-wrap: wrap;
        gap: 4px;
    }

    .action-buttons .btn {
        flex: 0 0 auto;
    }

    /* Upload grid */
    .upload-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .upload-thumbnail {
        height: 110px;
    }

    .upload-name {
        font-size: 11px;
    }

    /* Nav tabs com scroll horizontal */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        padding: 8px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Pre */
    pre {
        font-size: 10px;
        padding: 12px;
    }

    /* Alerts */
    .alert {
        font-size: 12px;
        padding: 10px 14px;
    }

    .markdown-preview {
        font-size: 12px;
    }

    /* Tabela */
    .table {
        min-width: 340px;
    }

    .table-responsive {
        margin: 0 -14px;
        width: calc(100% + 28px);
        padding: 0;
    }

    /* Alert image preview */
    .alert-image-preview {
        max-width: 100%;
        height: auto;
    }

    .card-text {
        font-size: 13px;
    }

    /* Sobre page mobile */
    #sobre .dev-avatar {
        width: 88px;
        height: 88px;
    }

    #sobre h3 {
        font-size: 18px;
    }

    #sobre h4 {
        font-size: 14px;
    }

    #sobre p {
        font-size: 13px;
    }

    #sobre .list-group-item {
        font-size: 12px;
        padding: 10px 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-highlight-number {
        font-size: 24px;
    }

    .stat-highlight-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .typing-name {
        font-size: 18px;
    }

    .cursor {
        font-size: 18px;
    }

    .tech-ticker-container {
        height: 180px;
    }

    .info-card-title {
        font-size: 14px;
    }

    .info-card-text {
        font-size: 13px;
    }

    .contact-list .list-group-item {
        font-size: 12px;
        padding: 10px 12px;
    }

    /* Class grid */
    .class-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .class-card {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        padding: 12px 14px;
        min-height: 56px;
        justify-content: flex-start;
    }

    .class-card i {
        font-size: 20px;
    }

    .class-card span {
        font-size: 13px;
    }

    /* Admin badge */
    .admin-badge {
        display: none;
    }

    /* Connection status */
    .connection-status {
        bottom: 12px;
        right: 12px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* ============================================ */
/* RESPONSIVE — SMALL MOBILE (max-width: 575px)*/
/* ============================================ */
@media (max-width: 575px) {
    :root {
        --mobile-toggle-size: 40px;
    }

    .mobile-menu-toggle {
        width: var(--mobile-toggle-size);
        height: var(--mobile-toggle-size);
        top: 9px;
        left: 9px;
        font-size: 20px;
    }

    /* Quando aberto, reposiciona seta */
    .mobile-menu-toggle.is-open {
        left: calc(var(--sidebar-width) - var(--mobile-toggle-size) - 6px);
    }

    .page-header {
        padding: 0 10px 0 calc(var(--mobile-toggle-size) + 18px);
        min-height: 54px;
    }

    .page-header h1 {
        font-size: 14px;
    }

    .page-body {
        padding: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card-value {
        font-size: 20px;
        letter-spacing: -0.5px;
    }

    .stat-card-label {
        font-size: 10px;
    }

    .stat-card-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .card-body {
        padding: 12px;
    }

    .card-header {
        padding: 10px 12px;
    }

    .card-header h5 {
        font-size: 12px;
    }

    .upload-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .upload-thumbnail {
        height: 95px;
    }

    .upload-icon {
        font-size: 32px;
    }

    .table thead th,
    .table tbody td {
        padding: 8px 10px;
        font-size: 11px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .btn-sm {
        font-size: 10px;
        padding: 4px 8px;
        min-height: 30px;
    }

    .modal-dialog {
        margin: 6px;
        max-width: calc(100vw - 12px);
    }

    .modal-title {
        font-size: 13px;
    }

    .class-selector-modal .modal-dialog {
        margin: 6px;
        max-width: calc(100vw - 12px);
    }

    #sobre .dev-avatar {
        width: 80px;
        height: 80px;
    }

    #sobre h3 {
        font-size: 15px;
    }

    #sobre h4 {
        font-size: 13px;
    }

    #sobre p,
    #sobre .list-group-item {
        font-size: 12px;
    }

    #sobre .list-group {
        margin-bottom: 12px;
    }

    #sobre .alert {
        font-size: 11px;
        padding: 8px 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-highlight-number {
        font-size: 20px;
    }

    .stat-highlight-label {
        font-size: 9px;
    }

    .stat-highlight-icon {
        font-size: 20px;
    }

    .stat-highlight-card {
        padding: 12px 8px;
    }

    /* Escala items full-width */
    .escala-item {
        padding: 12px;
    }

    .escala-item .row>[class*="col-md-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .escala-item .row>.col-md-2 .btn {
        width: 100%;
    }

    /* Sync card botão full width */
    .sync-status-text {
        font-size: 14px;
    }
}

/* ============================================ */
/* RESPONSIVE — EXTRA SMALL (max-width: 380px) */
/* ============================================ */
@media (max-width: 380px) {
    :root {
        --mobile-toggle-size: 36px;
    }

    .mobile-menu-toggle {
        top: 9px;
        left: 9px;
        font-size: 17px;
    }

    .mobile-menu-toggle.is-open {
        left: calc(var(--sidebar-width) - var(--mobile-toggle-size) - 6px);
    }

    .page-header {
        padding: 0 8px 0 calc(var(--mobile-toggle-size) + 16px);
        min-height: 52px;
    }

    .page-header h1 {
        font-size: 13px;
    }

    .page-body {
        padding: 8px;
    }

    .btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    .card-body {
        padding: 10px;
    }

    .card-header {
        padding: 9px 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-highlight-card {
        padding: 10px 8px;
    }

    .stat-highlight-number {
        font-size: 18px;
    }

    .stat-highlight-icon {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .upload-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-name {
        font-size: 10px;
    }

    .upload-meta {
        font-size: 9px;
    }

    .connection-status {
        display: none;
    }

    .modal-dialog {
        margin: 4px;
        max-width: calc(100vw - 8px);
    }
}

/* ============================================ */
/* LANDSCAPE ORIENTATION FIX                    */
/* ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
    }

    .sidebar-logo-area {
        padding: 14px 20px;
    }

    .modal-body {
        max-height: 55vh;
    }

    .page-header {
        position: static;
    }

    .mobile-menu-toggle {
        top: 8px;
        left: 8px;
    }

    .page-header {
        padding-left: 60px;
    }

    .stat-card {
        padding: 12px 16px;
    }

    .stat-card-value {
        font-size: 22px;
    }
}

/* ============================================ */
/* TOUCH DEVICE IMPROVEMENTS                    */
/* ============================================ */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }

    .stat-highlight-card:hover {
        transform: none;
    }

    .upload-card:hover {
        transform: none;
    }

    .info-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .btn-logout:hover {
        transform: none;
    }

    .list-group-item:hover {
        padding-left: 16px;
    }

    .contact-list .list-group-item:hover {
        padding-left: 12px;
    }

    .tech-item:hover {
        padding-left: 16px;
    }

    .sidebar .nav-link:hover i {
        transform: none;
    }

    /* Mantém o feedback visual nos taps */
    .btn:active {
        opacity: 0.85;
    }

    .upload-card:active {
        opacity: 0.85;
    }

    .class-card:active {
        background: rgba(255, 31, 61, 0.08);
        border-color: var(--primary);
    }

    .sidebar .nav-link:active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ==============================================
   PATCH JS — Cole este script no seu HTML,
   substituindo a função toggleMobileMenu existente
   ================================================

function toggleMobileMenu() {
    const sidebar = elements.sidebar;
    const overlay = elements.sidebarOverlay;
    const btn     = elements.mobileMenuToggle;

    const isOpen = sidebar.classList.contains('show');

    if (isOpen) {
        // Fechar
        sidebar.classList.remove('show');
        overlay.classList.remove('show');
        btn.classList.remove('is-open');
        document.body.style.overflow = '';
    } else {
        // Abrir
        sidebar.classList.add('show');
        overlay.classList.add('show');
        btn.classList.add('is-open');
        document.body.style.overflow = 'hidden';
    }
}

// IMPORTANTE: substitua o HTML do botão hamburger por:
// <button class="mobile-menu-toggle" id="mobileMenuToggle">
//     <i class="bi bi-list icon-open"></i>
//     <i class="bi bi-arrow-left icon-close"></i>
// </button>

*/

/* ============================================ */
/* PRINT                                        */
/* ============================================ */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay,
    .btn,
    .page-header .btn,
    .connection-status {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .page-header {
        position: static;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

@view-transition {
    navigation: auto;
}

/* ============================================ */
/* LANDING PAGE INSTITUCIONAL (index.html)      */
/* Reaproveita as variáveis globais do projeto   */
/* ============================================ */
.landing-page {
    min-height: 100vh;
    background: var(--surface-2);
    font-family: 'Sora', sans-serif;
    color: var(--text);
}

.landing-shell {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
}

/* No desktop a página não rola: tudo cabe em uma única tela (100vh) */
@media (min-width: 993px) {

    html.landing-html,
    body.landing-page {
        height: 100vh;
        overflow: hidden;
    }

    body.landing-page .landing-shell {
        height: 100vh;
    }
}

/* -------- Coluna institucional (esquerda) -------- */
.landing-info {
    position: relative;
    flex: 1 1 55%;
    min-width: 320px;
    background: linear-gradient(160deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: #fff;
    padding: 4vh 5vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.landing-info::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 15%, var(--primary-glow) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(59, 130, 246, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

.landing-info-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

.landing-brand {
    margin-bottom: 12px;
}

.landing-brand img {
    width: clamp(120px, 16vh, 190px);
    max-width: 60%;
    height: auto;
    opacity: 0.96;
}

.landing-info h1 {
    font-size: clamp(26px, 3.3vh, 44px);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 18px;
    word-wrap: break-word;
}

.landing-info h1 em {
    font-style: normal;
    color: #ff5c5c;
}

.landing-lead {
    font-size: clamp(15px, 2.1vh, 18px);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: clamp(20px, 3.4vh, 36px);
}

.landing-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.8vh, 18px);
    margin-bottom: clamp(20px, 3.4vh, 36px);
}

.landing-features li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.landing-features .feat-icon {
    flex-shrink: 0;
    width: clamp(34px, 4.6vh, 42px);
    height: clamp(34px, 4.6vh, 42px);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 2.2vh, 20px);
    color: #ff8080;
}

.landing-features .feat-text strong {
    display: block;
    font-size: clamp(15px, 1.85vh, 16.5px);
    font-weight: 600;
    margin-bottom: 2px;
    color: #fff;
}

.landing-features .feat-text span {
    font-size: clamp(13px, 1.6vh, 14.5px);
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.45;
}

.landing-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    padding-top: clamp(16px, 2.6vh, 26px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.landing-stats>div {
    opacity: 0;
    animation: statFadeIn 0.6s ease-out forwards;
}

.landing-stats>div:nth-child(1) {
    animation-delay: 0.15s;
}

.landing-stats>div:nth-child(2) {
    animation-delay: 0.3s;
}

.landing-stats>div:nth-child(3) {
    animation-delay: 0.45s;
}

@keyframes statFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-stats div strong {
    display: block;
    font-size: clamp(21px, 3vh, 25px);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
    position: relative;
}

.landing-stats div strong::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary);
    margin-top: 6px;
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    animation: statBarGrow 0.5s ease-out forwards;
    animation-delay: inherit;
}

@keyframes statBarGrow {
    to {
        transform: scaleX(1);
    }
}

.landing-stats div span {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.5);
}

/* -------- Coluna de login (direita) -------- */
.landing-login {
    flex: 1 1 45%;
    min-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 5vw;
    background:
        radial-gradient(circle at 80% 0%, var(--primary-glow) 0%, transparent 45%),
        var(--surface-2);
}

.landing-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(24, 30, 42, 0.05), 0 20px 50px rgba(24, 30, 42, 0.12);
    padding: clamp(26px, 4.5vh, 40px) clamp(24px, 3.5vw, 38px);
    transition: box-shadow 0.3s ease;
}

.login-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: clamp(20px, 3.4vh, 30px);
}

.landing-login-card .lock-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(24, 30, 42, 0.14);
    border: 1px solid var(--border);
    overflow: hidden;
}

.landing-login-card .lock-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.landing-login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.landing-login-sub {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
}

.landing-login-card .form-label {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}

.landing-login-card .form-control {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
    background: var(--surface-2);
    transition: var(--transition);
}

/* Estas regras vêm DEPOIS da regra genérica acima de propósito,
   para que o padding lateral extra (espaço do ícone) não seja sobrescrito */
.input-icon-group .form-control {
    padding-left: 44px;
}

#password.form-control {
    padding-right: 46px;
}

.input-icon-group>i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    line-height: 1;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.landing-login-card .form-control:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary);
    background: var(--primary-glow);
}

.landing-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-check-row .form-check-label {
    font-size: 13px;
    color: var(--text-muted);
}

.landing-check-row .form-check-input {
    box-shadow: 0 3px 8px rgba(24, 30, 42, 0.28);
    transition: var(--transition);
}

.landing-check-row .form-check-input:checked {
    box-shadow: 0 4px 12px var(--primary-glow), 0 3px 8px rgba(24, 30, 42, 0.28);
}

.landing-check-row .form-check-input:focus {
    box-shadow: 0 4px 12px rgba(24, 30, 42, 0.32), 0 0 0 3px var(--primary-glow);
}

.btn-landing-submit {
    width: 100%;
    background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    padding: 13px;
    border-radius: 10px;
    transition: var(--transition);
    margin-top: 6px;
    box-shadow: var(--shadow-primary);
}

.btn-landing-submit:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
    color: #fff;
}

.btn-landing-submit:active {
    transform: translateY(0);
}

.btn-landing-submit:disabled {
    opacity: 0.7;
    transform: none;
}

.landing-footer-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin: 22px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* -------- Responsividade -------- */
@media (max-width: 992px) {
    .landing-shell {
        flex-direction: column;
    }

    .landing-info,
    .landing-login {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
    }

    .landing-info {
        padding: 44px 24px 40px;
    }

    .landing-login {
        padding: 40px 24px 56px;
        background: var(--surface-2);
    }

    .landing-brand img {
        width: 150px;
    }
}

@media (max-width: 560px) {
    .landing-info {
        padding: 36px 20px 32px;
        text-align: left;
    }

    .landing-brand {
        margin-bottom: 14px;
        text-align: center;
    }

    .landing-brand img {
        width: 130px;
    }

    .landing-info h1 {
        font-size: 24px;
    }

    .landing-lead {
        font-size: 14px;
        margin-bottom: 28px;
    }

    .landing-features {
        gap: 14px;
        margin-bottom: 28px;
    }

    .landing-stats {
        gap: 20px;
    }

    .landing-login {
        padding: 32px 18px 48px;
    }

    .landing-login-card {
        padding: 28px 22px;
        border-radius: 16px;
    }

    .login-card-header {
        gap: 12px;
        margin-bottom: 24px;
    }

    .landing-login-card .lock-icon {
        width: 44px;
        height: 44px;
    }

    .landing-login-card h2 {
        font-size: 18px;
    }
}

@media (max-width: 380px) {
    .landing-login-card {
        padding: 24px 18px;
    }
}

/* ============================================ */
/* MASCOTE                                      */
/* ============================================ */

.mascote-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    margin: 0.5rem 0;
    position: relative;
}

.mascote-container .mascote-text {
    flex: 1;
    padding-right: 0;
    position: relative;
    z-index: 2;
}

.mascote-container .mascote-text .landing-lead {
    margin-bottom: 0;
    font-size: 1.1rem;
    margin-top: 0;
    line-height: 1.4;
}

.mascote-container .mascote-img {
    flex-shrink: 0;
    width: 300px;
    height: auto;
    object-fit: contain;
    margin-left: -20px;
    margin-top: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.35)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* ============================================ */
/* RESPONSIVIDADE                               */
/* ============================================ */

@media (max-width: 992px) {
    .mascote-container .mascote-img {
        width: 230px;
        margin-left: -10px;
    }

    .mascote-container .mascote-text h1 {
        font-size: 1.8rem;
        margin-top: 12px;
    }
}

@media (max-width: 768px) {
    .landing-info-content {
        text-align: center;
    }

    .landing-brand {
        display: flex;
        justify-content: center;
    }

    .mascote-container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 14px;
        margin: 1rem 0 1.5rem;
    }

    .mascote-container .mascote-text {
        padding-right: 0;
        width: 100%;
    }

    .mascote-container .mascote-img {
        width: 190px;
        margin: 0 auto;
    }

    .mascote-container .mascote-text h1 {
        font-size: 1.6rem;
        margin-top: 0;
    }

    .landing-stats {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .mascote-container .mascote-img {
        width: 150px;
    }

    .mascote-container .mascote-text h1 {
        font-size: 1.4rem;
    }

    .mascote-container .mascote-text .landing-lead {
        font-size: 0.95rem;
    }

    .landing-stats {
        justify-content: center;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .login-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .landing-check-row {
        justify-content: center;
    }
}

/* ============================================ */
/* LOGIN                                        */
/* ============================================ */

.landing-login-card {
    background: transparent;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    padding: 0;
    border-radius: 0;
}

.landing-login-card * {
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.landing-login-card .form-control,
.landing-login-card .btn {
    box-shadow: none !important;
}

.landing-login {
    background: transparent !important;
}

/* ============================================ */
/* IMAGENS                                      */
/* ============================================ */

img {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

.landing-brand img,
.lock-icon img {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* ============================================ */
/* HONEYPOT                                     */
/* ============================================ */

.honeypot-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ============================================ */
/* INDICADOR DE SCROLL                          */
/* ============================================ */

.scroll-indicator {
    display: none;
    position: fixed;
    right: 18px;
    bottom: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 20px;
    z-index: 500;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, color 0.3s ease;
    animation: scrollIndicatorBounce 1.8s ease-in-out infinite;
}

.scroll-indicator i {
    transition: transform 0.4s ease;
}

.scroll-indicator.flipped i {
    transform: rotate(180deg);
}

.scroll-indicator.over-dark {
    background: #ffffff;
    color: #16181d;
}

.scroll-indicator.over-light {
    background: #16181d;
    color: #ffffff;
}

@keyframes scrollIndicatorBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-indicator {
        animation: none;
    }
}

@media (max-width: 992px) {
    .scroll-indicator {
        display: flex;
    }
}

/* ============================================ */
/* MENSAGEM DE ERRO DO LOGIN                   */
/* ============================================ */

#loginError {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 8px 0 14px;
    padding: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #dc2626 !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#loginError.is-visible {
    display: flex !important;
    opacity: 1;
}

#loginError i {
    color: #dc2626 !important;
    font-size: 14px;
    flex-shrink: 0;
}

#loginError span {
    color: #dc2626 !important;
}

#loginError.is-visible {
    animation: loginErrorFadeIn 0.3s ease;
}

@keyframes loginErrorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #loginError {
        transition: none;
    }
    #loginError.is-visible {
        animation: none;
    }
}

/* ==========================================================================
   INRB.ia - Assistente Virtual (Chat Popup)
   ========================================================================== */

.inrbia-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--surface);
    box-shadow: var(--shadow-primary, 0 10px 30px rgba(255, 31, 61, 0.35));
    cursor: pointer;
    z-index: 1150;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.inrbia-fab:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: var(--shadow-primary-hover, 0 16px 44px rgba(255, 31, 61, 0.48));
}

.inrbia-fab:active {
    transform: translateY(0) scale(0.97);
}

.inrbia-fab-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.inrbia-fab-close-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--primary);
    font-size: 20px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.inrbia-fab.is-open .inrbia-fab-img {
    opacity: 0;
    transform: scale(0.6);
}

.inrbia-fab.is-open .inrbia-fab-close-icon {
    opacity: 1;
    transform: scale(1);
}

.inrbia-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 var(--primary-glow-strong, rgba(255, 31, 61, 0.45));
    animation: inrbia-pulse 2.6s ease-out infinite;
    pointer-events: none;
}

@keyframes inrbia-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--primary-glow-strong, rgba(255, 31, 61, 0.45));
    }

    70% {
        box-shadow: 0 0 0 14px rgba(255, 31, 61, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 31, 61, 0);
    }
}

/* ---------- Janela do chat ---------- */

.inrbia-chat-window {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 140px);
    background: var(--surface);
    border-radius: var(--radius-lg, 20px);
    box-shadow: 0 20px 60px rgba(24, 30, 42, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1140;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    font-family: 'Sora', sans-serif;
}

.inrbia-chat-window.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.inrbia-chat-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.inrbia-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.inrbia-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.15);
}

.inrbia-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inrbia-chat-title {
    font-weight: 400;
    font-size: 15px;
    line-height: 1.2;
}

.inrbia-chat-title .bia-bold {
    font-weight: 700;
}
.inrbia-chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.inrbia-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    display: inline-block;
}

.inrbia-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.inrbia-chat-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.inrbia-chat-transcript {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.inrbia-chat-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface-2);
    scroll-behavior: smooth;
}

.inrbia-chat-scroll-bottom {
    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--surface-3);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 3px 12px rgba(24, 30, 42, 0.16);
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.inrbia-chat-scroll-bottom:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.inrbia-chat-scroll-bottom:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.inrbia-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 100%;
    flex-wrap: nowrap;
}

.inrbia-msg-user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.inrbia-msg-col {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 44px);
    flex: 1 1 auto;
    min-width: 0; /* allow shrinking */
}

.inrbia-msg-user .inrbia-msg-col {
    align-items: flex-end;
}

.inrbia-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.inrbia-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inrbia-msg-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 3px;
    padding: 0 4px;
}

.inrbia-msg-bubble {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm, 10px);
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
    hyphens: auto;
    overflow-wrap: anywhere;
    -webkit-font-smoothing: antialiased;
}

/* Ensure long words or links wrap and don't overflow */
.inrbia-msg-bubble a {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Responsive adjustments for small screens */
@media (max-width: 520px) {
    .inrbia-chat-window {
        width: calc(100vw - 16px);
        right: 8px;
        left: 8px;
        max-height: calc(100vh - 80px);
    }
    .inrbia-msg-col {
        max-width: calc(100% - 36px);
    }
    .inrbia-msg-avatar { width: 26px; height: 26px; }
    .inrbia-msg-bubble { font-size: 13px; padding: 8px 12px; }
}

.inrbia-msg-bot .inrbia-msg-bubble {
    background: var(--surface);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-xs, 0 1px 3px rgba(24, 30, 42, 0.06));
}

.inrbia-msg-user .inrbia-msg-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.inrbia-msg-bubble ul,
.inrbia-msg-bubble ol {
    margin: 6px 0;
    padding-left: 20px;
}

.inrbia-msg-bubble a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

.inrbia-msg-bot .inrbia-msg-bubble a {
    color: var(--primary);
}

.inrbia-msg-bubble code {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
}

/* ---------- Indicador "digitando..." ---------- */

.inrbia-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 10px;
    background: var(--surface-2);
    flex-shrink: 0;
}

.inrbia-typing-bubble {
    background: var(--surface);
    border-radius: var(--radius-sm, 10px);
    border-bottom-left-radius: 4px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xs, 0 1px 3px rgba(24, 30, 42, 0.06));
}

.inrbia-typing-dots {
    display: inline-flex;
    gap: 3px;
}

.inrbia-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
    animation: inrbia-typing-bounce 1.1s infinite ease-in-out;
}

.inrbia-typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.inrbia-typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes inrbia-typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.inrbia-typing-timer {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---------- Alerta / erro ---------- */

.inrbia-chat-alert {
    margin: 0 16px 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm, 10px);
    background: #fee2e2;
    color: #b8102b;
    font-size: 12.5px;
    flex-shrink: 0;
}

/* ---------- Rodapé / envio ---------- */

.inrbia-chat-footer {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--surface-3);
    background: var(--surface);
    flex-shrink: 0;
}

.inrbia-chat-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inrbia-chat-input {
    flex: 1;
    border: 1px solid var(--surface-3);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: 'Sora', sans-serif;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inrbia-chat-input:focus {
    border-color: var(--primary);
    box-shadow: var(--focus-ring, 0 0 0 3px var(--primary-glow-strong));
}

.inrbia-chat-input:disabled {
    opacity: 0.6;
}

.inrbia-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.inrbia-chat-send:hover:not(:disabled) {
    transform: scale(1.06);
}

.inrbia-chat-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inrbia-chat-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- Animação de entrada ---------- */

@keyframes inrbia-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Aviso de cookies (modal centralizado) ---------- */

.inrbia-cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 14, 24, 0.62);
    backdrop-filter: blur(2px);
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: inrbia-overlay-fade 0.25s ease;
}

@keyframes inrbia-overlay-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.inrbia-cookie-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 20px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    outline: none;
    font-family: 'Sora', sans-serif;
    animation: inrbia-fade-up 0.3s ease;
}

.inrbia-cookie-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.inrbia-cookie-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.inrbia-cookie-title {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    margin: 0;
}

.inrbia-cookie-text {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

.inrbia-cookie-text p {
    margin: 0 0 10px;
}

.inrbia-cookie-text strong {
    color: var(--text);
}

.inrbia-cookie-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.inrbia-cookie-actions .btn {
    flex: 1;
    min-height: 44px;
    font-family: 'Sora', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
}

.inrbia-cookie-customize {
    display: block;
    margin: 12px auto 0;
    padding: 6px 10px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-family: 'Sora', sans-serif;
    font-size: 12.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.inrbia-cookie-customize:hover {
    color: var(--primary);
}

.inrbia-cookie-category {
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.inrbia-cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 13.5px;
    color: var(--text);
}

.inrbia-cookie-category-header label {
    margin: 0;
    cursor: pointer;
}

.inrbia-cookie-category-header .form-check {
    min-height: 0;
    margin: 0;
}

.inrbia-cookie-category-header .form-check-input {
    width: 2.4em;
    height: 1.3em;
    cursor: pointer;
}

.inrbia-cookie-category-header .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.inrbia-cookie-category-header .form-check-input:focus {
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.inrbia-cookie-category p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

.inrbia-cookie-category code {
    color: inherit;
    font-size: 12px;
}

.inrbia-cookie-always {
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
}

body.inrbia-modal-open {
    overflow: hidden;
}

/* ---------- Responsivo ---------- */

@media (max-width: 576px) {
    .inrbia-fab {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }

    .inrbia-chat-window {
        right: 10px;
        left: 10px;
        bottom: 84px;
        width: auto;
        max-width: none;
        height: auto;
        max-height: calc(100vh - 110px);
    }

    .inrbia-cookie-modal {
        padding: 20px 18px 16px;
        max-width: none;
    }

    .inrbia-cookie-actions {
        flex-direction: column-reverse;
    }

    .inrbia-msg-col {
        max-width: 85%;
    }
}

@media (max-width: 380px) {
    .inrbia-chat-window {
        bottom: 78px;
        max-height: calc(100vh - 100px);
    }

    .inrbia-cookie-title {
        font-size: 15.5px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .inrbia-fab-pulse,
    .inrbia-typing-dots span,
    .inrbia-chat-window,
    .inrbia-cookie-overlay,
    .inrbia-cookie-modal {
        animation: none;
        transition: none;
    }
}

/* Dashboard 2027 */
#dashboard {
    --dash-card-radius: 18px;
    --dash-accent: #d71935;
    --dash-surface: var(--surface);
    --dash-subtle: var(--surface-2);
    --dash-border: var(--border);
}

#dashboard .dashboard-page-header {
    align-items: flex-start;
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
}

#dashboard .dashboard-greeting-block {
    flex: 1 1 300px;
    min-width: 0;
}

#dashboard .dashboard-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

#dashboard .dashboard-title-row h1 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    font-size: clamp(20px, 2vw, 26px);
}

#dashboard .dashboard-title-row h1 > i {
    color: var(--dash-accent);
    flex: 0 0 auto;
}

#dashboard .admin-badge {
    margin-left: 2px;
    font-size: 11px;
}

#dashboard .dashboard-title-row .theme-toggle {
    flex: 0 0 auto;
}

#dashboard .dashboard-page-header .breadcrumb-text {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

#dashboard .dashboard-header-actions {
    flex: 1 1 560px;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

#dashboard .dashboard-api-status {
    flex: 0 0 auto;
    width: max-content;
    max-width: none;
    white-space: nowrap;
    padding: 7px 10px;
    font-size: 11px;
}

#dashboard .dashboard-api-status > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

#dashboard .dashboard-api-status > span:first-child {
    width: 8px;
    height: 8px;
}

#dashboard .dashboard-weather {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 220px;
    width: 220px;
    height: 50px;
    min-width: 0;
    padding: 7px 10px;
    overflow: hidden;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    background: var(--dash-surface);
}

#dashboard .dashboard-weather > i {
    color: #e89b11;
    font-size: 19px;
}

#dashboard .dashboard-weather-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    line-height: 1.3;
}

#dashboard .dashboard-weather-city {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
}

#dashboard .dashboard-weather-details {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 10px;
}

#dashboard .dashboard-page-body {
    max-width: 1440px;
    margin: 0 auto;
}

#dashboard .dashboard-summary {
    display: grid;
    grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.6fr);
    gap: 18px;
    margin-bottom: 28px;
}

#dashboard .dashboard-metric-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-card-radius);
    background: var(--dash-surface);
    box-shadow: var(--card-shadow);
}

#dashboard .dashboard-students-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 178px;
    background: linear-gradient(145deg, var(--dash-surface), var(--dash-subtle));
}

#dashboard .dashboard-metric-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

#dashboard .dashboard-student-count {
    margin-top: 8px;
    color: var(--text);
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1.5px;
}

#dashboard .dashboard-attendance-card {
    position: relative;
    min-height: 178px;
}

#dashboard .dashboard-attendance-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

#dashboard .dashboard-attendance-month {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: capitalize;
}

#dashboard .dashboard-attendance-total {
    position: relative;
    text-align: right;
    padding-right: 30px;
}

#dashboard .dashboard-attendance-filter-toggle {
    position: absolute;
    top: -9px;
    right: -9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0 0 5px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

#dashboard .dashboard-attendance-filter-toggle:hover,
#dashboard .dashboard-attendance-filter-toggle[aria-expanded="true"] {
    color: var(--primary);
    background: var(--dash-subtle);
}

#dashboard .dashboard-attendance-filter-menu {
    position: absolute;
    top: 31px;
    right: -9px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    min-width: 160px;
    max-width: min(250px, calc(100vw - 48px));
    max-height: 250px;
    padding: 6px;
    overflow: auto;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--card-shadow-hover);
}

#dashboard .dashboard-attendance-filter-menu[hidden] {
    display: none;
}

#dashboard .dashboard-attendance-filter-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    overflow: hidden;
    color: var(--text);
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

#dashboard .dashboard-attendance-filter-option:hover,
#dashboard .dashboard-attendance-filter-option[aria-checked="true"] {
    color: var(--primary);
    background: var(--dash-subtle);
}

#dashboard .dashboard-attendance-filter-empty {
    padding: 8px 10px;
    color: var(--text-muted);
    font-size: 11px;
}

#dashboard .dashboard-attendance-percent {
    display: block;
    color: var(--text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

#dashboard .dashboard-attendance-trend {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 10px;
}

#dashboard .dashboard-attendance-trend[data-direction="up"] {
    color: #07805b;
}

#dashboard .dashboard-attendance-trend[data-direction="down"] {
    color: #c62828;
}

#dashboard .dashboard-attendance-message {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 12px;
}

#dashboard .dashboard-attendance-content {
    margin-top: 20px;
}

#dashboard .dashboard-attendance-bar {
    display: flex;
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-3);
}

#dashboard .dashboard-attendance-segment {
    display: block;
    height: 100%;
    transition: width 0.3s ease;
}

#dashboard .dashboard-attendance-segment.is-present {
    background: #10a875;
}

#dashboard .dashboard-attendance-segment.is-excused {
    background: #e3a322;
}

#dashboard .dashboard-attendance-segment.is-absent {
    background: #dc4652;
}

#dashboard .dashboard-attendance-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 11px;
}

#dashboard .dashboard-attendance-counts strong {
    color: var(--text);
}

#dashboard .dashboard-section-title {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

#dashboard .dashboard-shortcuts-section {
    margin-bottom: 28px;
}

#dashboard .dashboard-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

#dashboard .dashboard-shortcut {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 70px;
    padding: 12px;
    color: var(--text);
    text-align: left;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition-fast);
}

#dashboard .dashboard-shortcut[hidden] {
    display: none !important;
}

#dashboard .dashboard-shortcut:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

#dashboard .dashboard-shortcut-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    color: var(--primary);
    background: rgba(255, 31, 61, 0.09);
    border-radius: 11px;
    font-size: 16px;
}

#dashboard .dashboard-activity {
    overflow: hidden;
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-card-radius);
    background: var(--dash-surface);
    box-shadow: var(--card-shadow);
}

#dashboard .dashboard-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
}

#dashboard .dashboard-activity-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

#dashboard .dashboard-history-link {
    padding: 4px 0;
    color: var(--primary);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

#dashboard .dashboard-activity-table-wrap,
.dashboard-history-modal .dashboard-activity-table-wrap {
    width: 100%;
    overflow-x: auto;
}

#dashboard .dashboard-activity-table,
.dashboard-history-modal .dashboard-activity-table {
    width: 100%;
    min-width: 600px;
    margin: 0;
    border-collapse: collapse;
    color: var(--text);
    font-size: 11px;
}

#dashboard .dashboard-activity-table th,
#dashboard .dashboard-activity-table td,
.dashboard-history-modal .dashboard-activity-table th,
.dashboard-history-modal .dashboard-activity-table td {
    padding: 11px 16px;
    border-top: 1px solid var(--dash-border);
    text-align: left;
    vertical-align: middle;
}

#dashboard .dashboard-activity-table th,
.dashboard-history-modal .dashboard-activity-table th {
    color: var(--text-muted);
    background: var(--dash-subtle);
    font-size: 10px;
    font-weight: 700;
}

.dashboard-history-modal .modal-content {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-card-radius);
}

#activityHistoryModal.modal {
    z-index: 1250;
}

body.activity-history-modal-open .modal-backdrop {
    z-index: 1240;
}

.dashboard-history-modal .dashboard-history-message {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.sidebar-group[hidden] {
    display: none !important;
}

:root[data-theme="dark"] #dashboard .dashboard-metric-card,
:root[data-theme="dark"] #dashboard .dashboard-activity,
:root[data-theme="dark"] #dashboard .dashboard-weather,
:root[data-theme="dark"] #dashboard .dashboard-shortcut {
    background-color: var(--surface);
    border-color: var(--border);
}

:root[data-theme="dark"] #dashboard .dashboard-students-card {
    background: linear-gradient(145deg, var(--surface), var(--surface-3));
}

:root[data-theme="dark"] #dashboard .dashboard-attendance-trend[data-direction="up"] {
    color: #6ee7b7;
}

:root[data-theme="dark"] #dashboard .dashboard-attendance-trend[data-direction="down"] {
    color: #fca5a5;
}

:root[data-theme="dark"] #dashboard .dashboard-activity-table th,
:root[data-theme="dark"] .dashboard-history-modal .dashboard-activity-table th {
    background: var(--surface-3);
}

.inrbia-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0 9px;
}

.inrbia-chat-suggestion {
    padding: 6px 9px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.inrbia-chat-suggestion:hover {
    border-color: var(--primary);
}

@media (max-width: 991px) {
    #dashboard .dashboard-header-actions {
        flex-basis: 100%;
        justify-content: flex-start;
    }

    #dashboard .dashboard-shortcuts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    #dashboard .dashboard-page-header {
        padding: 14px 12px 12px 60px;
        gap: 12px;
    }

    #dashboard .dashboard-greeting-block {
        flex-basis: 100%;
    }

    #dashboard .dashboard-title-row h1 {
        font-size: 19px;
    }

    #dashboard .dashboard-header-actions {
        justify-content: flex-start;
        gap: 8px;
    }

    #dashboard .dashboard-api-status {
        margin-right: auto;
    }

    #dashboard .dashboard-summary {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 22px;
    }

    #dashboard .dashboard-metric-card {
        padding: 17px;
    }

    #dashboard .dashboard-students-card {
        min-height: 132px;
    }

    #dashboard .dashboard-attendance-card {
        min-height: 165px;
    }

    #dashboard .dashboard-shortcuts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #dashboard .dashboard-shortcut {
        min-height: 62px;
        padding: 9px;
        font-size: 11px;
    }

    #dashboard .dashboard-activity-header {
        align-items: flex-start;
        padding: 16px 14px 10px;
    }
}

@media (max-width: 380px) {
    #dashboard .dashboard-title-row h1 {
        font-size: 17px;
    }

    #dashboard .dashboard-attendance-counts {
        gap: 7px 10px;
        font-size: 10px;
    }
}
