* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
}

/* ── Top navbar ──────────────────────────────────────────────────────── */
nav {
    background: #1a1a2e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
}

main {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* ── Toast notifications ─────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #1b5e20;
    color: #fff;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: auto;
    max-width: 320px;
}

.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }
.toast.warning { background: #e65100; }
.toast.info    { background: #1565c0; }

/* ── Global form base ────────────────────────────────────────────────── */
form label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

form input[type="text"],
form input[type="email"],
form input[type="number"],
form input[type="password"],
form select,
form textarea {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
button[type="submit"],
.btn-primary {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.6rem 1.5rem;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
}

button[type="submit"]:hover,
.btn-primary:hover {
    background: #2d2d5e;
}

.btn-secondary {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.2rem;
    background: transparent;
    color: #1a1a2e;
    border: 1px solid #1a1a2e;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #f0f0f8;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────── */
.breadcrumb {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: #1a1a2e;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ── Card list (turmas / apostilas / atividades) ─────────────────────── */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

a.card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
}

a.card:hover {
    background: #f5f5fa;
    border-color: #aab;
}

a.card strong {
    display: block;
    font-size: 1rem;
    color: #1a1a2e;
}

.card-meta {
    font-size: 0.85rem;
    color: #666;
    display: block;
    margin-top: 0.2rem;
}

.card-arrow {
    font-size: 1.3rem;
    color: #aaa;
    flex-shrink: 0;
    margin-left: 1rem;
}

.role-badge {
    display: inline-block;
    background: #e8eaf6;
    color: #3949ab;
    border-radius: 12px;
    padding: 0.2rem 0.75rem;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.empty-state {
    color: #888;
    font-style: italic;
    margin-top: 0.5rem;
}

/* ── Form sections ───────────────────────────────────────────────────── */
.form-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.form-section h2 {
    margin-top: 0;
}

.section-hint {
    color: #666;
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.form-field {
    margin-top: 1.25rem;
}

.field-label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.4rem;
    margin-top: 0;
}

.form-error {
    color: #c62828;
    font-size: 0.875rem;
    margin-top: 0.3rem;
}

.form-error-box {
    background: #ffebee;
    border-left: 3px solid #c62828;
    padding: 0.75rem 1rem;
    border-radius: 0 4px 4px 0;
    color: #c62828;
    margin-bottom: 1rem;
}

/* ── File drop zone ──────────────────────────────────────────────────── */
.file-drop-zone {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border: 2px dashed #ccc;
    border-radius: 6px;
    background: #fafafa;
    cursor: default;
    transition: border-color 0.15s, background 0.15s;
}

.file-drop-zone.drag-over {
    border-color: #1a1a2e;
    background: #eef;
}

.drop-hint {
    width: 100%;
    margin: 0;
    font-size: 0.8rem;
    color: #999;
}

.file-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #1a1a2e;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    white-space: nowrap;
}

.file-btn:hover {
    background: #2d2d5e;
}

.file-name {
    font-size: 0.9rem;
    color: #555;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-clear-file {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.btn-clear-file:hover {
    color: #c62828;
}

/* ── File preview (shown after selection) ────────────────────────────── */
.file-preview {
    margin-top: 0.75rem;
}

.file-preview img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
}

.file-badge {
    display: inline-block;
    background: #e8eaf6;
    color: #1a1a2e;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin: 0;
}

/* ── Gabarito status badge ───────────────────────────────────────────── */
.gabarito-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #166534;
}

.gabarito-ok-icon {
    font-size: 1rem;
    color: #16a34a;
    flex-shrink: 0;
}

/* ── Score card ──────────────────────────────────────────────────────── */
.score-card {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 1.5rem 0;
}

.score-value {
    font-size: 3rem;
    font-weight: bold;
    color: #1a1a2e;
}

.score-sep {
    font-size: 2rem;
    color: #999;
}

.score-max {
    font-size: 2rem;
    color: #555;
}

.edited-badge {
    font-size: 0.75rem;
    background: #fff3e0;
    color: #e65100;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

/* ── Feedback list ───────────────────────────────────────────────────── */
.feedback-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feedback-list li {
    padding: 0.75rem 1rem;
    border-left: 3px solid #1a1a2e;
    margin-bottom: 0.75rem;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.feedback-list li strong {
    margin-right: 0.5rem;
}

.q-score {
    font-size: 0.85rem;
    color: #555;
    background: #e8eaf6;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}

.feedback-list li p {
    margin: 0.4rem 0 0;
    color: #444;
}

/* ── Professor comment ───────────────────────────────────────────────── */
.professor-comment {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fffde7;
    border-left: 3px solid #f9a825;
    border-radius: 0 4px 4px 0;
}

.professor-comment p {
    margin: 0.4rem 0 0;
}

/* ── Data tables (coordinator dashboard, management views) ──────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.data-table th,
.data-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table tbody tr:hover {
    background: #f5f5fa;
}

.data-table a {
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 500;
}

.data-table a:hover {
    text-decoration: underline;
}

/* ── Small buttons (table actions) ──────────────────────────────────── */
.btn-small {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #1a1a2e;
    color: #1a1a2e;
    background: transparent;
    cursor: pointer;
}

.btn-small:hover {
    background: #f0f0f8;
}

.btn-small.btn-danger {
    border-color: #c62828;
    color: #c62828;
}

.btn-small.btn-danger:hover {
    background: #ffebee;
}

/* ── Pendente badge ─────────────────────────────────────────────────── */
.pendente-badge {
    color: #e65100;
    font-weight: bold;
}

/* ── Turma group on professor dashboard ─────────────────────────────── */
.turma-group {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.turma-group h3 {
    margin: 0 0 0.5rem;
}

.turma-group h3 a {
    color: #1a1a2e;
    text-decoration: none;
}

.turma-group h3 a:hover {
    text-decoration: underline;
}

.disciplina-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.disciplina-list li {
    padding: 0.4rem 0;
}

.disciplina-list li a {
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 500;
}

.disciplina-list li a:hover {
    text-decoration: underline;
}

/* ── Status badges (envio status) ───────────────────────────────────── */
.status-badge {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 0.4rem;
}

.status-badge.pendente {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.erro {
    background: #ffebee;
    color: #c62828;
}

/* ── Turma grid (parent dashboard) ─────────────────────────────────── */
.turma-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.turma-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}

.turma-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.turma-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #1a1a2e;
}

/* ── Review queue table ─────────────────────────────────────────────── */
.envios-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.envios-table th,
.envios-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.envios-table th {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.envios-table tbody tr:hover {
    background: #f5f5fa;
}
