:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #10b981;
    --secondary-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --bg-color: #f3f4f6;
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Typography */
h1, h2, h3 {
    color: var(--text-main);
    font-weight: 600;
}

h1 { font-size: 2rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; }

/* Cards & Forms */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Modals Overlay & Styling */
.card.hidden { display: none !important; }

#gradeModal, #editSubmissionModal, #editUserModal, #editSubjectModal, #editClassModal, #editAssignModal, #editNoticeModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

/* Background Overlay when modal is open */
.modal-open-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-family: inherit;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary { background-color: var(--secondary); color: white; }
.btn-secondary:hover { background-color: var(--secondary-hover); }

.btn-danger { background-color: var(--danger); color: white; }
.btn-danger:hover { background-color: var(--danger-hover); }

.btn-block { width: 100%; }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
    display: none;
}
.alert.show { display: block; }
.alert-success { background-color: #d1fae5; color: #065f46; border: 1px solid #34d399; }
.alert-danger { background-color: #fee2e2; color: #991b1b; border: 1px solid #f87171; }

/* Navbar */
.navbar {
    background: var(--primary);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.navbar-brand { font-size: 1.25rem; font-weight: 600; color: white; text-decoration: none; }
.nav-links { display: flex; align-items: center; }
.nav-links a { color: white; text-decoration: none; margin-left: 1.5rem; font-weight: 500; opacity: 0.9; transition: opacity 0.2s;}
.nav-links a:hover { opacity: 1; }
.hamburger { display: none; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: white; }

@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-links { display: none; width: 100%; flex-direction: column; text-align: center; margin-top: 1rem; }
    .nav-links.active { display: flex; }
    .nav-links a { margin: 0.5rem 0; margin-left: 0; width: 100%; padding: 0.5rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Tables */
.table-container { overflow-x: auto; margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
thead { background-color: #f9fafb; border-bottom: 2px solid var(--border); }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
tbody tr:hover { background-color: #f9fafb; }

/* Layout Grid */
.dashboard-grid { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; min-height: calc(100vh - 64px); }
.sidebar { background: var(--surface); padding: 2rem; border-right: 1px solid var(--border); }
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 0.5rem; }
.sidebar-nav a { display: block; padding: 0.75rem 1rem; color: var(--text-main); text-decoration: none; border-radius: var(--radius); transition: background 0.2s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--primary); color: white; }

.main-content { padding: 2rem; }

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.hidden { display: none !important; }

/* Badges & Status */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-pending { background-color: #fef3c7; color: #92400e; border: 1px solid #fcd34d; } /* Amarelo para Em Andamento */
.badge-resolved { background-color: #d1fae5; color: #065f46; border: 1px solid #34d399; } /* Verde para Concluído */

/* Utilities Extra */
.flex-wrap { flex-wrap: wrap; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* Loading Spinner */
.loader { border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
