:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #fee2e2;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
}

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

body {
    font-family: "Open Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: var(--gray-900);
    border-bottom: none;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    white-space: nowrap;
}

.brand-logo {
    width: 94px;
    height: 30px;
    object-fit: contain;
    object-position: left center;
}

.brand-staff {
    background: var(--primary);
    color: white;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    line-height: 1.5;
}

.impersonation-bar {
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
    color: #9a3412;
}

.impersonation-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
}

.btn-light {
    background: white;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.alert-prominent {
    border: 2px solid #dc2626;
    background: #fef2f2;
    color: #991b1b;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.alert-receipt {
    animation: receipt-alert-pulse 1.1s ease-in-out infinite;
}

@keyframes receipt-alert-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
    50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0.28); }
}

.reminder-item {
    border-left: 4px solid var(--primary);
    padding-left: 0.85rem;
    margin-bottom: 1rem;
}

.reminder-item:last-child { margin-bottom: 0; }
.reminder-actions { display: flex; gap: 0.5rem; align-items: flex-start; }
.inline-form { display: inline; }

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.dashboard-actions .btn-hero,
.dashboard-actions .btn-secondary-action {
    width: 100%;
    min-height: 58px;
    margin-bottom: 0;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
}

.button-icon {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 1.15em;
    line-height: 0;
}

.btn-secondary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    background: #e2e8f0;
    color: #475569;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.btn-secondary-action:hover {
    background: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
}

.dashboard-reminders {
    padding: 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    background: #fffdf5;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.section-heading > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0;
    font-size: 1rem;
}

.section-kicker {
    display: none;
}

.heading-icon {
    color: #d97706;
    font-size: 1rem;
    transform: rotate(-12deg);
}

.section-count {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #a16207;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

.reminder-board {
    display: grid;
    grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.7fr);
    gap: 0.75rem;
    align-items: start;
}

.reminder-composer {
    position: relative;
    padding: 0.9rem;
    border-color: #eee1b0;
    box-shadow: none;
}

.composer-icon {
    display: grid;
    width: 28px;
    height: 28px;
    margin-bottom: 0.45rem;
    place-items: center;
    border-radius: 8px;
    background: #fef3c7;
    color: #b45309;
}

.composer-icon svg,
.post-it-icon svg {
    width: 17px;
    height: 17px;
}

.reminder-composer h3 {
    margin-bottom: 0.15rem;
    font-size: 0.92rem;
}

.reminder-composer .text-muted {
    margin-bottom: 0.65rem;
}

.reminder-notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.7rem;
}

.reminder-note {
    min-height: 146px;
    padding: 0.75rem;
    border: 1px solid #f3d36b;
    border-radius: 4px 4px 12px 4px;
    background: #fff4a8;
    box-shadow: 2px 3px 0 rgba(180, 132, 35, 0.12);
    transform: rotate(-1deg);
}

.reminder-note:nth-child(even) {
    background: #ffef91;
    transform: rotate(1.2deg);
}

.reminder-note:nth-child(3n) {
    background: #fff8c9;
    transform: rotate(-0.3deg);
}

.reminder-note-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.post-it-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 6px;
    background: rgba(255,255,255,0.55);
    color: #a16207;
}

.post-it-icon svg {
    width: 16px;
    height: 16px;
}

.post-it-label {
    color: #a16207;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reminder-note textarea {
    width: 100%;
    min-height: 58px;
    padding: 0;
    border: 0;
    outline: 0;
    resize: vertical;
    background: transparent;
    color: #713f12;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
}

.reminder-note textarea::placeholder { color: #a16207; }
.reminder-note textarea:focus { box-shadow: none; }

.reminder-note .reminder-actions {
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.btn-note,
.btn-note-delete {
    padding: 4px 8px;
    border: 0;
    background: rgba(255,255,255,0.55);
    color: #92400e;
}

.btn-note:hover { background: white; color: #78350f; }
.btn-note-delete { color: #b45309; }
.btn-note-delete:hover { background: #fee2e2; color: #991b1b; }

.reminder-empty {
    display: flex;
    min-height: 146px;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 1rem;
    border: 1px dashed #e5c45e;
    border-radius: 10px;
    color: #a16207;
    text-align: center;
}

.empty-note-icon {
    font-size: 1.5rem;
    color: #d97706;
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-300);
    font-family: "Open Sans", ui-sans-serif, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    padding: 8px 9px;
    border-radius: 7px;
    transition: color 0.2s, background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.btn-nav-filled {
    background: var(--primary) !important;
    color: white !important;
    padding: 5px 14px;
    border-radius: 8px;
}

.btn-nav-outline {
    border: 1px solid var(--gray-500) !important;
    color: var(--gray-300) !important;
    padding: 4px 12px;
    border-radius: 8px;
}

.btn-nav-outline:hover {
    border-color: white !important;
    color: white !important;
}

.nav-links .btn-nav-outline,
.nav-links .btn-nav-filled {
    font-size: 0.72rem;
    letter-spacing: 0.045em;
}

.dashboard-bulletin {
    padding: 0.9rem 1rem 0.15rem;
    border: 1px solid #dbe4ee;
    border-radius: var(--radius);
    background: #f8fafc;
}

.bulletin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.bulletin-label {
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bulletin-priority {
    color: #94a3b8;
    font-size: 0.75rem;
}

.alert-broadcast {
    margin-bottom: 0.75rem;
    border: 1px solid #dbe4ee;
    background: white;
    color: #475569;
}

.alert-broadcast strong { color: #334155; }

.btn-broadcast {
    background: #e2e8f0;
    color: #475569;
}

.btn-broadcast:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--gray-500);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    flex: 1;
    width: 100%;
}

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

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

.subtitle {
    color: var(--gray-500);
    margin-top: 0.15rem;
    width: 100%;
}

.center { text-align: center; justify-content: center; }
.center .subtitle { text-align: center; }

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
}

.card-narrow { max-width: 480px; margin: 0 auto; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 2px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

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

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

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group textarea { resize: vertical; }

.cf-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.cf-wrapper input { flex: 1; }

.input-disabled {
    background: var(--gray-100) !important;
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-inline .form-group { margin-bottom: 0; }

.input-inline {
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

.input-sm {
    padding: 5px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn-danger {
    background: #991b1b;
    color: white;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 0.95rem;
    width: 100%;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 0.5rem;
}

.list-item:last-child { border-bottom: none; }

.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--gray-50);
}

.table td code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

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

.checkbox-label input { width: auto !important; }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.alert-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.88rem;
    color: var(--gray-500);
}

.form-footer a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.text-muted { color: var(--gray-500); font-size: 0.85rem; }
.p-1 { padding: 0.75rem 0; }
.mt-05 { margin-top: 0.5rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 1.5rem; }

.course-info-banner {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.info-per-student {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.info-hourly {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.compenso-preview {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.btn-hero {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    text-align: center;
}

.btn-hero:hover {
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-inline-compact {
    display: flex;
    align-items: center;
    gap: 4px;
}

.firma-preview {
    margin-bottom: 0.5rem;
}

.footer {
    text-align: center;
    padding: 1.25rem 1rem;
    color: var(--gray-500);
    font-size: 0.78rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

@media (max-width: 768px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .reminder-board { grid-template-columns: 1fr; }
    .dashboard-reminders { padding: 0.75rem; }
    .stats-grid, .stats-4 { grid-template-columns: repeat(2, 1fr); }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--gray-900);
        padding: 1rem;
        border-bottom: 1px solid var(--gray-700);
        gap: 0.75rem;
        z-index: 99;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    .nav-links a { color: var(--gray-200) !important; font-size: 0.95rem !important; }
    .nav-links a:hover { color: white !important; }
    .nav-links.show { display: flex; }
    .mobile-toggle { display: block; }
    .page-header h1 { font-size: 1.25rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .container { padding: 1rem 0.75rem; }
    .card { padding: 1rem; }
    .stat-card { padding: 0.85rem; }
    .stat-value { font-size: 1.5rem; }

    .table-responsive {
        margin: 0 -1rem;
        padding: 0 0.25rem;
    }
    .table { font-size: 0.78rem; }
    .table th, .table td { padding: 6px 5px; }
    .table th { font-size: 0.7rem; }

    .btn-sm { padding: 4px 8px; font-size: 0.75rem; }
    .btn-lg { padding: 10px 16px; font-size: 0.9rem; }

    .form-inline-compact {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .form-inline-compact .input-sm { width: 100% !important; }

    .input-sm { font-size: 0.8rem; padding: 5px 6px; }

    input[type="date"],
    input[type="month"],
    input[type="number"],
    select,
    .form-group input,
    .form-group select {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    .form-inline .input-inline {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .dashboard-actions {
        gap: 0.5rem;
    }

    .dashboard-actions .btn-hero,
    .dashboard-actions .btn-secondary-action {
        min-height: 54px;
        padding: 12px 8px;
        font-size: 0.92rem;
    }
}
