/* ═══════════════════════════════════════════════════════════════════
   Canal Educação v3.0 — Design System
   Premium Dark Mode with Glassmorphism, Gradients, Micro-animations
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────────────── */

:root {
    /* Backgrounds */
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f23;
    --bg-card: rgba(26, 26, 62, 0.6);
    --bg-card-hover: rgba(36, 36, 82, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.10);

    /* Accent Gradient */
    --accent-start: #4f46e5;
    --accent-end: #06b6d4;
    --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    --accent-glow: 0 0 30px rgba(79, 70, 229, 0.3);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #818cf8;

    /* Status Colors */
    --status-green: #10b981;
    --status-yellow: #f59e0b;
    --status-red: #ef4444;
    --status-gray: #6b7280;
    --status-blue: #3b82f6;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(79, 70, 229, 0.5);

    /* Shadows */
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);

    /* Sizes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ───────────────────────────────────────────────── */

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: gradientShift 20s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

/* ─── Typography ─────────────────────────────────────────────────── */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #a5b4fc;
}

/* ─── Layout ─────────────────────────────────────────────────────── */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-smooth);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--accent-glow);
}

.sidebar-logo h2 {
    font-size: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.nav-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.15);
    color: var(--text-accent);
    border-left: 3px solid var(--accent-start);
}

.nav-link .icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

/* ─── Cards ──────────────────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* ─── Stats Grid ─────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Forms ──────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

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

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

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

/* Conditional fields (hidden by default) */
.conditional-field {
    display: none;
    animation: slideDown 0.3s ease;
}

.conditional-field.visible {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Buttons ────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

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

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── Status Badges ──────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-green);
}

.badge-green::before {
    background: var(--status-green);
}

.badge-yellow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-yellow);
}

.badge-yellow::before {
    background: var(--status-yellow);
}

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-red);
}

.badge-red::before {
    background: var(--status-red);
}

.badge-gray {
    background: rgba(107, 114, 128, 0.15);
    color: var(--status-gray);
}

.badge-gray::before {
    background: var(--status-gray);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-blue);
}

.badge-blue::before {
    background: var(--status-blue);
}

/* ─── Outline Badges ─────────────────────────────────────────────── */

.badge-outline-green {
    border: 1px solid var(--status-green);
    color: var(--status-green);
    background: transparent;
}
.badge-outline-green::before { background: var(--status-green); }

.badge-outline-yellow {
    border: 1px solid var(--status-yellow);
    color: var(--status-yellow);
    background: transparent;
}
.badge-outline-yellow::before { background: var(--status-yellow); }

.badge-outline-red {
    border: 1px solid var(--status-red);
    color: var(--status-red);
    background: transparent;
}
.badge-outline-red::before { background: var(--status-red); }

.badge-outline-gray {
    border: 1px solid var(--status-gray);
    color: var(--status-gray);
    background: transparent;
}
.badge-outline-gray::before { background: var(--status-gray); }

/* ─── Tables ─────────────────────────────────────────────────────── */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

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

thead th {
    background: var(--bg-glass);
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
}

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

tbody tr:hover {
    background: var(--bg-glass);
}

/* ─── Grade / Schedule Grid ──────────────────────────────────────── */

.grade-grid {
    display: grid;
    grid-template-columns: 100px repeat(var(--studios, 10), 1fr);
    gap: 2px;
    background: var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.grade-header {
    background: rgba(79, 70, 229, 0.15);
    padding: 0.6rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-accent);
}

.grade-time {
    background: var(--bg-card);
    padding: 0.6rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.grade-slot {
    background: var(--bg-card);
    padding: 0.5rem;
    min-height: 60px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-size: 0.7rem;
}

.grade-slot:hover {
    background: var(--bg-card-hover);
    z-index: 2;
}

.grade-slot.occupied {
    border-left: 3px solid var(--accent-start);
}

.grade-slot.locked {
    background: rgba(239, 68, 68, 0.1);
    border: 1px dashed var(--status-red);
    cursor: not-allowed;
}

.grade-slot.locked::after {
    content: '🔒';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
}

.grade-slot .slot-turma {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.7rem;
}

.grade-slot .slot-disciplina {
    color: var(--text-secondary);
    font-size: 0.65rem;
    margin-top: 2px;
}

/* ─── Login Page ─────────────────────────────────────────────────── */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-elevated);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--accent-glow);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.5);
    }
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

/* ─── Toast / Alerts ─────────────────────────────────────────────── */

.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    animation: toastIn 0.4s ease;
    max-width: 400px;
    box-shadow: var(--shadow-elevated);
}

.toast-success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.toast-error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.toast-info {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─── Connected Users Indicator ──────────────────────────────────── */

.ws-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-green);
}

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

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ─── Loading Spinner ────────────────────────────────────────────── */

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-start);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

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

/* ─── Page Header ────────────────────────────────────────────────── */

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ─── Empty State ────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ─── Report Drawer (Gaveta Lateral) ─────────────────────────────── */

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Update drawer base */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    /* Align to right edge */
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    z-index: 201;
    /* Above sidebar (100) and overlay (200) */
    overflow-y: auto;
    padding: 2rem;
    transition: transform var(--transition-smooth), visibility var(--transition-smooth);
    box-shadow: var(--shadow-elevated);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.drawer.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

/* Fix detail item overflow */
.detail-item span {
    word-break: break-word;
    /* Ensure long words wrap */
    overflow-wrap: break-word;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.drawer-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--status-red);
}

/* Section separators in form */
.form-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

/* ─── Tabs (Admin Panel) ────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.tab-btn.active {
    color: var(--text-accent);
    border-bottom-color: var(--accent-start);
}

/* ─── Naming Engine Preview (§5.2) ──────────────────────────────────── */

.naming-preview {
    background: #0f172a;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Mono', monospace;
    font-size: 0.75rem;
    color: #4ade80;
    word-break: break-all;
    line-height: 1.6;
    overflow-x: auto;
}

/* ─── Detail Grid (Report Slide-over) ───────────────────────────────── */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Drawer Wide (Reports Audit Detail) ────────────────────────────── */

.drawer-wide {
    width: 600px;
    max-width: 95vw;
}

/* Drawer form padding and header refinement */
.drawer-header h3 {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer form {
    padding: 0 0.5rem;
}

/* ─── Responsive ─────────────────────────────────────────────────── */

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

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

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

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

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

    .drawer {
        width: 100vw;
    }
}

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

    .login-card {
        padding: 1.5rem;
    }
}

/* Grade Row & Slot Actions */
.row-actions {
    opacity: 0.4;
    transition: opacity 0.2s;
}

td:hover .row-actions {
    opacity: 1;
}

.slot-delete {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.slot-delete:hover {
    background: var(--status-red);
    color: white !important;
}

.grade-slot {
    position: relative;
    min-width: 120px;
    transition: all 0.2s ease;
}

.grade-slot.occupied:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.table-container {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

/* ─── Responsividade ────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .main-content {
        margin-left: 80px;
        padding: 1.5rem;
    }
    .sidebar {
        width: 80px;
        padding: 1rem 0.5rem;
    }
    .sidebar-logo h2, 
    .nav-link span:not(.icon), 
    .sidebar > div > div > div:last-child {
        display: none;
    }
    .sidebar-logo {
        justify-content: center;
        padding-bottom: 1rem;
    }
    .nav-link {
        justify-content: center;
        padding: 0.75rem 0;
    }
    .nav-link .icon {
        margin: 0;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .main-content {
        margin-left: 0;
        margin-bottom: 70px;
        padding: 1rem;
    }
    .sidebar {
        width: 100%;
        height: 70px;
        bottom: 0;
        top: auto;
        flex-direction: row;
        padding: 0.5rem;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        align-items: center;
        justify-content: space-between;
    }
    .sidebar-logo,
    .sidebar > div > button.btn-secondary {
        display: none;
    }
    .sidebar-nav {
        flex-direction: row;
        gap: 0;
        justify-content: space-around;
        width: 100%;
    }
    .nav-link {
        padding: 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}