@charset "UTF-8";
:root {
    --primary: #2563eb;
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --accent-color: #2563eb;
    --sidebar-width: 260px;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --premium-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --premium-shadow: 0 20px 40px -10px rgba(30, 58, 138, 0.15);
}

.card-premium {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--premium-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.card-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -12px rgba(30, 58, 138, 0.25);
}

.btn-premium {
    background: var(--premium-gradient);
    border: none;
    color: white;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.btn-premium:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
    color: white;
}

body {
    background-color: var(--gray-50);
    color: var(--dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
}

.attendance-week-table th,
.attendance-week-table td {
    vertical-align: middle;
}

.attendance-week-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    background:
        linear-gradient(180deg, #eff6ff 0%, #ffffff 28%, #f8fbff 100%);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.08);
}

.attendance-week-table th {
    min-width: 92px;
    padding: 0.85rem 0.45rem;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-bottom: 1px solid rgba(29, 78, 216, 0.28);
    color: #1e3a8a;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.55);
}

.attendance-week-table thead th:not(:first-child) {
    text-align: center;
}

.attendance-week-table tbody td {
    padding: 0.7rem 0.45rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: inset -1px 0 0 rgba(226, 232, 240, 0.85);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.attendance-week-table tbody tr:nth-child(odd) td {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.attendance-week-table tbody tr:hover td {
    background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
}

.attendance-week-table td:first-child,
.attendance-week-table th:first-child {
    min-width: 320px;
    position: sticky;
    left: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    z-index: 1;
    box-shadow: 1px 0 0 rgba(226, 232, 240, 0.95);
}

.attendance-week-table th:first-child {
    color: #ffffff;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.attendance-week-table tbody td:first-child {
    font-weight: 700;
}

.attendance-week-table thead th {
    color: #ffffff;
}

.attendance-week-student-cell {
    padding-top: 0.9rem !important;
    padding-bottom: 0.9rem !important;
}

.attendance-week-student-main {
    display: grid;
    gap: 0.2rem;
}

.weekly-attendance-inline-detail-slot {
    margin-top: 0.8rem;
}

.attendance-week-legend {
    padding: 1rem 1.15rem;
    border-radius: 22px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border: 1px solid rgba(37, 99, 235, 0.28);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.attendance-week-legend-title {
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(219, 234, 254, 0.82);
}

.attendance-week-legend-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.attendance-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.attendance-legend-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.weekly-attendance-cell-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.weekly-attendance-select {
    width: 64px;
    min-width: 64px;
    height: 46px;
    border-radius: 14px;
    text-align: center;
    text-align-last: center;
    font-size: 1.35rem;
    font-weight: 900;
    border-width: 2px;
    padding: 0.25rem 0.4rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none !important;
    background-repeat: no-repeat !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.weekly-attendance-select:hover,
.weekly-attendance-select:focus {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.attendance-week-detail-panel {
    width: min(420px, 100%);
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.24);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.14);
}

.attendance-week-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.attendance-week-detail-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
}

.attendance-week-detail-summary {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.weekly-attendance-empty {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border-color: rgba(148, 163, 184, 0.28);
    color: #64748b !important;
    -webkit-text-fill-color: #64748b;
}

.weekly-attendance-presente {
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: rgba(22, 163, 74, 0.58);
    color: #15803d !important;
    -webkit-text-fill-color: #15803d;
    box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.75);
}

.weekly-attendance-atraso {
    background: linear-gradient(180deg, #ecfccb 0%, #d9f99d 100%);
    border-color: rgba(101, 163, 13, 0.46);
    color: #4d7c0f !important;
    -webkit-text-fill-color: #4d7c0f;
}

.weekly-attendance-ausente {
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    border-color: rgba(220, 38, 38, 0.55);
    color: #dc2626 !important;
    -webkit-text-fill-color: #dc2626;
    box-shadow: inset 0 0 0 1px rgba(254, 202, 202, 0.8);
}

.weekly-attendance-justificado {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    border-color: rgba(217, 119, 6, 0.45);
    color: #b45309 !important;
    -webkit-text-fill-color: #b45309;
}

.weekly-attendance-retiro {
    background: linear-gradient(180deg, #cffafe 0%, #a5f3fc 100%);
    border-color: rgba(8, 145, 178, 0.45);
    color: #0f766e !important;
    -webkit-text-fill-color: #0f766e;
}

.weekly-attendance-select option {
    font-weight: 800;
}

.weekly-attendance-presente option {
    color: #15803d;
}

.weekly-attendance-ausente option {
    color: #dc2626;
}

.weekly-attendance-atraso option {
    color: #4d7c0f;
}

.weekly-attendance-justificado option {
    color: #b45309;
}

.weekly-attendance-retiro option {
    color: #0f766e;
}

/* Sidebar Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 80px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent 16%),
        linear-gradient(180deg, #0b1322 0%, #16243c 100%);
    color: var(--white);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-x: hidden;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.16);
}

.sidebar:hover {
    width: var(--sidebar-width);
}

.sidebar:hover ~ .main-content {
    margin-left: var(--sidebar-width);
}

.sidebar-header {
    padding: 1rem 0; /* Padding vertical únicamente para centrado horizontal perfecto */
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative; /* For the ::after pseudo-element */
}

.sidebar-header::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.18), rgba(255,255,255,0));
}

.sidebar:hover .sidebar-header {
    padding: 1.5rem;
    justify-content: flex-start;
}

.logo-box-sidebar {
    border-radius: 20px !important;
    padding: 0.8rem !important;
    border: 1px solid rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.96) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14) !important;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar:hover .logo-box-sidebar {
    transform: none;
}

.sidebar-title {
    opacity: 0;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, width 0.3s ease;
    white-space: nowrap;
    margin-left: 0;
}

.sidebar:hover .sidebar-title {
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
    margin-left: 1rem;
}

.sidebar-title h1 {
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.sidebar-title small {
    color: rgba(255,255,255,0.64) !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.65rem;
}

.sidebar-nav {
    padding: 1.1rem 0.65rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

.nav-links {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
    align-items: center; /* Centrar items cuando está colapsado */
}

.nav-links::-webkit-scrollbar {
    width: 4px;
}

.nav-links::-webkit-scrollbar-track {
    background: transparent;
}

.nav-links::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.sidebar:hover .nav-links {
    align-items: stretch; /* Estirar items cuando está expandido */
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    justify-content: center; /* Centrado por defecto (colapsado) */
    width: 48px; /* Ancho fijo para que sea un cuadrado cuando está colapsado */
    height: 48px;
    padding: 0; /* Sin padding para controlar el tamaño exacto */
    color: rgba(255,255,255,0.65) !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    border-radius: 14px;
    font-size: 0.925rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    position: relative;
    border: 1px solid transparent;
}

.sidebar:hover .sidebar-nav .nav-item {
    width: 100%;
    height: auto;
    padding: 0.85rem 1.25rem;
    justify-content: flex-start;
}

.sidebar-nav .nav-item i {
    font-size: 1.25rem;
    min-width: 24px;
    text-align: center;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.sidebar-nav .nav-item span {
    position: absolute;
    left: 100%;
    opacity: 0;
    visibility: hidden;
    margin-left: 1.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sidebar:hover .sidebar-nav .nav-item span {
    position: static;
    opacity: 1;
    visibility: visible;
    margin-left: 1rem;
}

.sidebar-nav .nav-item:hover {
    color: var(--white) !important;
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.06);
}

.sidebar-nav .nav-item:hover i {
    transform: translateX(3px);
}

.sidebar-nav .nav-item.active {
    color: var(--white) !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.22);
}

.sidebar-nav .nav-item.active i {
    color: white;
}

.sidebar-nav .nav-item.text-danger {
    color: #fca5a5 !important;
    font-weight: 600;
}

.sidebar-nav .nav-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171 !important;
}

.sidebar-nav .nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 1rem 0.5rem;
    width: 30px;
    transition: all 0.3s ease;
}

.sidebar:hover .sidebar-nav .nav-divider {
    width: auto;
    margin: 1rem 1.25rem;
    align-self: stretch;
}

.sidebar-footer-nav {
    margin-top: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.35rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar:hover .sidebar-footer-nav {
    align-items: stretch;
}



.main-content {
    flex-grow: 1;
    overflow-x: hidden;
    padding: 2rem;
    margin-left: 80px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header & Topbar */
.topbar-modern {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -2rem -2rem 2rem -2rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.profile-btn {
    transition: transform 0.2s ease;
}

.profile-btn:hover {
    transform: scale(1.05);
}

.profile-avatar-topbar {
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.dropdown-menu {
    padding: 0.5rem;
    margin-top: 0.5rem !important;
}

.dropdown-item {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.6rem 1rem;
}

.dropdown-item:hover {
    background-color: var(--gray-50);
}

.dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.05);
}

/* Cards & Stats */
.card-modern {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-modern:hover {
    box-shadow: var(--shadow-md);
}

.stat-card-new {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Calendar Specific Styles */
.calendar-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: white !important;
    border-right: 2px solid #e5e7eb !important;
    box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.05);
}

.calendar-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 700px;
    position: relative;
}

.calendar-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.calendar-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--white);
}

.calendar-table thead tr:first-child th {
    z-index: 21;
}

.calendar-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: var(--white);
    border-right: 1px solid var(--gray-200) !important;
}

.calendar-table thead th.sticky-col {
    z-index: 30;
}

.calendar-cell {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-cell:hover {
    filter: brightness(0.95);
    transform: scale(1.05);
    z-index: 5;
    box-shadow: var(--shadow-sm);
}

.calendar-row:hover .sticky-col {
    background-color: var(--gray-50);
}

.today-highlight {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    position: relative;
}

.today-highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--primary);
    border-radius: 50%;
}

.calendar-cell.cell-da { background-color: #fef3c7 !important; color: #92400e !important; border-color: #fde68a !important; }
.calendar-cell.cell-md { background-color: #e0f2fe !important; color: #075985 !important; border-color: #bae6fd !important; }
.calendar-cell.cell-lm { background-color: #e0e7ff !important; color: #3730a3 !important; border-color: #c7d2fe !important; }
.calendar-cell.cell-pe { background-color: #f3f4f6 !important; color: #374151 !important; border-color: #e5e7eb !important; }
.calendar-cell.cell-weekend { background-color: #fff1f2 !important; color: #be123c !important; border-color: #fecdd3 !important; }
.calendar-cell.cell-today { background-color: rgba(37, 99, 235, 0.1) !important; border: 2px solid var(--primary) !important; }

/* Light Backgrounds & Dark Text Utilities */
.bg-warning-light { background-color: #fef3c7 !important; }
.text-warning-dark { color: #92400e !important; }
.bg-info-light { background-color: #e0f2fe !important; }
.text-info-dark { color: #075985 !important; }
.bg-primary-light { background-color: #e0e7ff !important; }
.text-primary-dark { color: #3730a3 !important; }
.bg-secondary-light { background-color: #f3f4f6 !important; }
.text-secondary-dark { color: #374151 !important; }
.bg-danger-light { background-color: #fff1f2 !important; }
.text-danger-dark { color: #be123c !important; }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.05);
}

.table-custom th {
    background-color: var(--gray-50);
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
}

.table-custom td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table-custom tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge-custom {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Forms */
.form-group-custom {
    margin-bottom: 1.5rem;
}

.form-label-custom {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-control-custom {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    transition: all 0.2s ease;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Buttons */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

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

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Specific component fixes */
.profile-avatar-topbar {
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.search-box-modern {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-box-modern i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box-modern input {
    padding-left: 2.75rem;
}

/* Utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Keep existing essential styles but modernized */
.excel-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
}

.excel-card-header {
    padding: 1rem 1.5rem;
    font-weight: 700;
}

.excel-label {
    background-color: var(--gray-50);
    color: var(--gray-500);
    font-size: 0.75rem;
    width: 200px;
}

.excel-value {
    padding: 12px 1.5rem;
    color: var(--dark);
}

/* Login/Register Screens */
.login-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    position: relative;
    overflow: hidden;
}

.login-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    width: 800px;
    height: 800px;
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
    background-image: url('../logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: brightness(0) invert(1);
}

.login-card {
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.login-header-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 3rem 2rem;
    position: relative;
}

.login-header-gradient::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: #fff;
    clip-path: ellipse(50% 100% at 50% 100%);
}

.login-logo-floating {
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 24px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin: -45px auto 20px;
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Asistencia por curso */
.course-attendance-card {
    overflow: hidden;
    border-radius: 24px !important;
    border: 0 !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
    background: #ffffff;
}

.course-attendance-header {
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 28%),
        linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    border-radius: 24px !important;
    border: 0 !important;
    box-shadow: 0 16px 32px rgba(29, 78, 216, 0.18);
}

.course-attendance-top {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 1.25rem;
    align-items: stretch;
}

.course-attendance-copy {
    min-width: 0;
    padding: 0.25rem 0;
}

.course-attendance-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.55rem;
}

.course-attendance-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.course-meta-pill {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #0f172a;
    min-width: 0;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.course-meta-pill i {
    color: #2563eb;
    font-size: 1.05rem;
    margin-top: 0.15rem;
}

.course-meta-content {
    min-width: 0;
}

.course-meta-content strong,
.course-meta-value {
    display: block;
}

.course-meta-content strong {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.32rem;
}

.course-meta-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}

.course-meta-value.is-empty {
    color: #94a3b8;
}

.course-block-strip {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.course-block-chip {
    min-width: 190px;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.course-block-chip-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.course-block-chip-meta {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    font-size: 0.75rem;
    color: #64748b;
}

.course-mini-total-value {
    color: #0f172a;
}

.course-attendance-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    align-items: stretch;
}

.course-attendance-actions-main {
    display: none !important;
}

.course-attendance-actions-side {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: stretch;
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border: 1px solid rgba(15, 23, 42, 0.16);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}





.course-summary-date-form {
    min-width: 0;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.course-summary-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.74);
    margin-bottom: 0.55rem;
}

.course-summary-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 54px;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.course-summary-input-wrap i {
    color: #2563eb;
    font-size: 1rem;
}

.course-summary-input-wrap .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-height: 0;
    font-weight: 700;
    color: #0f172a;
}

.course-summary-helper {
    margin-top: 0.7rem;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.78rem;
    line-height: 1.45;
}

.course-action-btn {
    min-height: 52px;
    padding: 0.9rem 1.2rem;
    border-radius: 18px;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-transform: uppercase;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.course-action-btn:hover,
.course-delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12) !important;
}

.course-action-btn-outline {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: rgba(59, 130, 246, 0.34);
    color: #1d4ed8;
}

.course-action-btn-ghost {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-color: rgba(148, 163, 184, 0.22);
    color: #0f172a;
}

.course-action-btn-neutral {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: rgba(124, 58, 237, 0.18);
    color: #6d28d9;
}

.course-action-btn-dark {
    background: linear-gradient(135deg, #1f2937, #0f172a);
    color: #ffffff;
}

.course-action-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
}

.course-action-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
}

.course-action-btn-summary {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-color: rgba(251, 146, 60, 0.42);
    color: #ffffff;
    min-width: 168px;
}

.course-attendance-side-stack {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.course-delete-btn {
    width: 52px;
    min-width: 52px;
    height: 52px;
    border-radius: 18px;
    border: 1px solid rgba(254, 202, 202, 0.24);
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Compact styles for course buttons */
.course-action-btn {
    font-size: 0.7rem !important;
    padding: 0.5rem 0.85rem !important;
    min-height: 38px !important;
    border-radius: 10px !important;
    box-shadow: 0 3px 8px rgba(15,23,42,0.05) !important;
}

.course-delete-btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(254,202,202,0.24) !important;
    background: rgba(127,29,29,0.18) !important;
    color: #fecaca !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
}

/* Fix Bootstrap modal z-index issue - SUPER STRONG! */
.modal-backdrop {
    z-index: 2147483645 !important;
    position: fixed !important;
}
.modal {
    z-index: 2147483646 !important;
    position: fixed !important;
}
.modal-dialog {
    z-index: 2147483646 !important;
}
/* Fix Select2 dropdown z-index */
.select2-container {
    z-index: 2147483647 !important;
}
.select2-dropdown {
    z-index: 2147483647 !important;
}
/* Fix Bootstrap dropdown menu z-index */
.dropdown-menu {
    z-index: 2147483646 !important;
}

.course-delete-form {
    display: inline-flex;
}

.course-summary-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.course-summary-modal-date {
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 800;
}

.course-summary-chart-wrap {
    height: 320px;
    padding: 1rem;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.course-summary-modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
}

.course-summary-stat-card {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.course-summary-stat-card span {
    display: block;
    margin-bottom: 0.3rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.course-summary-stat-card strong {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 900;
}

.course-block-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1.15rem 1.25rem 1.25rem;
    background: #ffffff;
}

.course-attendance-totals-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem 1.25rem 0;
    background: #ffffff;
}

.course-attendance-totals-section {
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.course-attendance-totals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.course-attendance-totals-header strong {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
}

.course-attendance-totals-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.course-day-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.course-day-total-card {
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.course-day-total-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.course-day-total-card strong {
    color: #0f172a;
    font-size: 1.3rem;
    font-weight: 900;
}

.course-day-total-card.is-present {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), #ffffff);
}

.course-day-total-card.is-absent {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.95), #ffffff);
}

.course-day-total-card.is-justified {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), #ffffff);
}

.course-day-total-card.is-delay {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), #ffffff);
}

.course-day-total-card.is-retiro {
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.95), #ffffff);
}

.course-day-total-card.is-pending {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), #ffffff);
}

.course-block-summary-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.course-block-summary-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.course-block-summary-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.course-block-summary-subtitle {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.course-block-summary-time {
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.course-block-summary-stats {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

.summary-present,
.summary-absent,
.summary-retired {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.summary-present {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.summary-absent {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.summary-retired {
    background: rgba(14, 165, 233, 0.12);
    color: #0c4a6e;
}

.course-block-summary-names {
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.45;
}

.block-config-item {
    flex: 1;
    min-width: 0;
}

.attendance-block-table th {
    white-space: nowrap;
}

.attendance-block-table td {
    vertical-align: middle;
}

.attendance-block-table .attendance-block-time {
    min-width: 120px;
}

@media (max-width: 991.98px) {
    .course-attendance-top,
    .course-attendance-actions {
        grid-template-columns: 1fr;
    }

    .course-attendance-totals-wrap {
        grid-template-columns: 1fr;
    }

    .course-meta-pill {
        min-width: 100%;
    }

    .course-attendance-actions {
        align-items: stretch;
    }

    .course-summary-modal-toolbar {
        align-items: stretch;
    }

    .course-attendance-actions-main,
    .course-attendance-actions-side {
        width: 100%;
    }

    .course-summary-date-form {
        min-width: 100%;
    }

    .course-attendance-actions-side {
        grid-template-columns: 1fr;
    }

    .course-attendance-side-stack {
        width: 100%;
        justify-content: stretch;
    }
}

@media (max-width: 767.98px) {
    .course-attendance-meta {
        grid-template-columns: 1fr;
    }

    .course-summary-chart-wrap {
        height: 280px;
    }

    .course-day-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .course-action-btn,
    .course-delete-btn {
        width: 100%;
    }

    .course-attendance-actions-side {
        flex-direction: column;
    }

    .course-attendance-side-stack {
        flex-direction: column;
    }
}

.login-logo-floating img {
    max-width: 100%;
    height: auto;
}

.input-group-modern {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.input-group-modern:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: white;
}

.input-group-modern .input-group-text {
    background: transparent;
    border: none;
    color: #64748b;
}

.input-group-modern .form-control {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem 0.75rem 0;
    font-weight: 500;
}

.input-group-modern .form-control:focus {
    box-shadow: none;
}

.btn-login-modern {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    border: none;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.btn-login-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px rgba(37, 99, 235, 0.4);
}

.login-footer-text {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.system-notice {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #86efac;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.btn,
button {
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
}

.btn {
    border: 1px solid transparent;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.8rem 1rem;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
}

.btn-primary-light {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-primary-light:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-success-light {
    background: #ecfdf5;
    border-color: #ecfdf5;
    color: #059669;
}

.btn-success-light:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.btn-warning-light {
    background: #fffbeb;
    border-color: #fffbeb;
    color: #d97706;
}

.btn-warning-light:hover {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline-secondary:hover {
    background: var(--secondary);
    color: #ffffff;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: #ffffff;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    text-decoration: underline;
}

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

.btn-secondary {
    color: var(--accent-color) !important;
}

.btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-secondary:hover {
    background: #f8fafc;
    color: #0f172a;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.btn-white {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    color: var(--dark);
}

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

.btn-light {
    background: var(--gray-100);
    border-color: var(--gray-100);
    color: var(--dark);
}

.btn-light:hover {
    background: var(--gray-200);
    border-color: var(--gray-200);
    color: var(--dark);
}

/* Notificaciones */
.notification-item {
    cursor: pointer;
    border-left: 4px solid transparent;
}
.notification-item:hover {
    background-color: rgba(37, 99, 235, 0.05);
}
.notification-item.leida {
    opacity: 0.75;
}
.notification-dropdown .dropdown-menu {
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #ffffff;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: #ffffff;
}

.btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.transition-hover {
    transition: all 0.25s ease-in-out;
}

.transition-hover:hover {
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.58rem 0.85rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
}

.w-100 {
    width: 100%;
}

.form-control,
.form-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    box-sizing: border-box;
    color: #0f172a;
    padding: 0.9rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
    outline: none;
}

.form-label {
    color: #0f172a;
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.check-row {
    align-items: center;
    color: #334155;
    cursor: pointer;
    display: flex;
    gap: 0.65rem;
}

.check-row input {
    height: 16px;
    width: 16px;
}

.mb-3 {
    margin-bottom: 1rem;
}

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

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

.table th,
.table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0.8rem;
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.personnel-table tbody tr:hover {
    background: #f8fafc;
}

.badge {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.4rem 0.75rem;
}

.bg-indigo {
    background-color: #4f46e5 !important;
    border-color: #4338ca !important;
}

.bg-emerald {
    background-color: #10b981 !important;
    border-color: #059669 !important;
}

.empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
}

.empty-state h4 {
    margin-top: 0;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 0;
}

.custom-modal {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
}

.custom-modal-header {
    align-items: start;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.4rem;
}

.modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-card,
.upload-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1rem;
}

.detail-card h6 {
    margin-top: 0;
}

.document-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.document-item {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
}

.document-item:first-child {
    padding-top: 0;
}

.document-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.document-empty {
    color: #64748b;
}

.document-link {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}

.document-link:hover {
    text-decoration: underline;
}

/* --- RESPONSIVIDAD (Ajuste para móviles y tablets) --- */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 0.75rem;
    }

    .topbar-simple .container {
        padding: 0 0.75rem;
    }

    /* BARRA DE DATOS (RUT, Clave, Correos) */
    .panel-card .d-flex.flex-wrap.gap-5 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
    }

    .panel-card .d-flex.flex-wrap.gap-5 > div,
    .panel-card .d-flex.flex-wrap.gap-5 > .border-start {
        border-left: none !important;
        border-bottom: 1px solid #f1f5f9;
        padding: 1rem 0 !important;
        margin: 0 !important;
        width: 100%;
    }

    .panel-card .d-flex.flex-wrap.gap-5 > div:last-child,
    .panel-card .d-flex.flex-wrap.gap-5 > .border-start:last-child {
        border-bottom: none !important;
    }

    /* Ajuste para que los correos largos no se salgan */
    .panel-card strong, .panel-card .fs-5, .panel-card .fs-6 {
        word-break: break-all;
        font-size: 1.1rem !important;
    }

    .topbar-name {
        font-size: 1rem;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .auth-card-simple {
        padding: 2rem 1.25rem;
    }

    .panel-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .notes-scroll, .files-scroll {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .topbar-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .topbar-user-info {
        gap: 0.5rem;
    }

    .topbar-cargo-small {
        display: none;
    }

    .btn-lg {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Ajuste institucional: look mas sobrio y profesional */
body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 24%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 55%, #e8edf4 100%);
}



.topbar-modern {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.card-modern,
.card,
.modal-content,
.table-responsive,
.empty-state,
.detail-card,
.upload-box {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}

.attendance-suite-card {
    backdrop-filter: none !important;
    position: relative;
    z-index: auto !important;
}

.card-modern,
.card,
.modal-content,
.permissions-hero,
.permissions-filters,
.permissions-legend,
.permissions-stat-card,
.calendar-table-wrapper {
    border-radius: 18px !important;
}

.card-modern:hover,
.card:hover,
.permissions-stat-card:hover {
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08) !important;
}

.student-detail-modal {
    width: calc(100vw - 1.5rem);
    max-width: min(1380px, 98vw) !important;
    margin: 0.75rem auto;
}

.student-edit-fullscreen-dialog {
    margin: 0 !important;
    width: 100vw;
    max-width: 100vw !important;
    height: 100vh;
}

.student-edit-fullscreen-content {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

.student-edit-fullscreen-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.student-edit-fullscreen-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 1.5rem !important;
}

.student-edit-fullscreen-footer {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}

.topbar-search-trigger {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.global-search-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.global-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.25rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    text-decoration: none;
    color: inherit;
}

.global-search-item:first-of-type {
    border-top: 0;
    padding-top: 0.2rem;
}

.global-search-item:hover {
    color: inherit;
    transform: translateX(2px);
}

.dashboard-alerts-card {
    border-radius: 24px !important;
    border: 1px solid rgba(148, 163, 184, 0.14) !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,250,252,0.98) 100%) !important;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.06) !important;
    padding: 1rem !important;
}

.dashboard-alerts-card > .d-flex {
    margin-bottom: 1rem !important;
}

.dashboard-alerts-card h5 {
    font-size: 1.05rem !important;
    margin-bottom: 0.35rem !important;
}

.dashboard-alerts-card p {
    font-size: 0.88rem !important;
    margin-bottom: 0 !important;
    line-height: 1.5;
}

.dashboard-alerts-card .badge {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.85rem !important;
}

.dashboard-alerts-card .row.g-3 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.9rem !important;
    align-items: stretch;
    justify-items: stretch;
}

.dashboard-alerts-card .col-lg-4 {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

@media (max-width: 1200px) {
    .dashboard-alerts-card .row.g-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .dashboard-alerts-card .row.g-3 {
        grid-template-columns: 1fr !important;
    }
}

.dashboard-alert-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: auto;
    padding: 0.85rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 10px 20px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
}

.dashboard-alert-block::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
}

.dashboard-alert-block-warning::before {
    background: linear-gradient(180deg, #f59e0b 0%, #facc15 100%);
}

.dashboard-alert-block-danger::before {
    background: linear-gradient(180deg, #ef4444 0%, #fb7185 100%);
}

.dashboard-alert-block-info::before {
    background: linear-gradient(180deg, #06b6d4 0%, #38bdf8 100%);
}

.dashboard-alert-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.dashboard-alert-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.72);
    color: #475569;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-alert-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-size: 1.05rem;
    flex: 0 0 auto;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.62);
}

.dashboard-alert-content {
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-alert-title {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}

.dashboard-alert-count {
    color: #0f172a;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 0.45rem;
}

.dashboard-alert-list {
    display: grid;
    gap: 0.55rem;
}

.dashboard-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.dashboard-alert-link {
    text-decoration: none;
}

.dashboard-alert-link:hover {
    border-color: rgba(37, 99, 235, 0.24);
    background: rgba(239, 246, 255, 0.95);
    transform: translateY(-1px);
}

.dashboard-alert-action {
    border: 0 !important;
    min-height: 42px;
    padding-inline: 1rem !important;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.dashboard-alert-action-warning {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%) !important;
    color: #854d0e !important;
}

.import-summary-card {
    border-radius: 24px !important;
}

.import-summary-stat,
.import-summary-detail {
    height: 100%;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.import-summary-stat span {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
}

.import-summary-stat strong {
    color: #0f172a;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.student-extra-accordion {
    display: grid;
    gap: 0.9rem;
}

.student-extra-card,
.student-extra-notes {
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
    overflow: hidden;
}

.student-extra-card .accordion-button {
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 1rem 1.15rem;
}

.student-extra-card .accordion-button:not(.collapsed) {
    background: rgba(248, 250, 252, 0.88);
}

.student-extra-card .accordion-button::after {
    background-size: 1rem;
    opacity: 0.7;
}

.student-extra-heading-wrap {
    width: 100%;
}

.student-extra-title-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
}

.student-extra-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.student-extra-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.student-extra-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 800;
}

.student-extra-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.student-extra-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
}

.student-extra-empty {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
}

.student-extra-body {
    padding: 0 1.15rem 1.15rem;
}

.student-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.student-extra-item {
    min-height: 100%;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.student-extra-label {
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.student-extra-value {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
}

.student-extra-notes-text {
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.65;
}

.student-inline-edit-btn {
    white-space: nowrap;
    font-weight: 700;
}

.student-edit-accordion .accordion-item {
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

.student-edit-accordion .accordion-button {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: none;
    color: #0f172a;
}

.student-edit-accordion .accordion-button:not(.collapsed) {
    background: rgba(239, 246, 255, 0.95);
    color: #1d4ed8;
}

.student-edit-accordion .accordion-body {
    background: rgba(255, 255, 255, 0.98);
}

.edit-student-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.notes-admin-view .card {
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.notes-admin-eyebrow {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notes-admin-badge {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 1.35rem;
}

.notes-config-form .select2-container--bootstrap-5 .select2-selection,
.notes-config-form .form-control,
.notes-config-form .form-select {
    min-height: 44px;
}

.notes-config-form .select2-container--bootstrap-5 .select2-selection,
.notes-setting-select,
.notes-sheet-setting-field .form-control {
    border-radius: 8px !important;
    border: 1px solid #dbe2ea !important;
    background: #fff !important;
    box-shadow: none !important;
}

.notes-config-form .select2-container--bootstrap-5 .select2-selection {
    padding-top: 0.15rem;
}

.notes-config-form .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #0f172a;
    font-weight: 600;
}

.notes-config-form .select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.notes-book-list {
    display: grid;
    gap: 0.8rem;
    max-height: 290px;
    overflow-y: auto;
}

.notes-book-item {
    display: block;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    text-decoration: none;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: all 0.2s ease;
}

.notes-book-item:hover,
.notes-book-item.active {
    transform: translateY(-1px);
    background: rgba(239, 246, 255, 0.95);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.08);
}

.notes-book-item-top,
.notes-book-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.notes-book-item-top strong {
    color: #0f172a;
    font-size: 0.96rem;
}

.notes-book-item-top span,
.notes-book-item-meta span {
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
}

.notes-book-empty {
    padding: 1.1rem;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
    color: #64748b;
    font-weight: 600;
}

.notes-sheet-placeholder {
    min-height: 440px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.notes-sheet-placeholder-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 1rem;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 2rem;
}

.notes-sheet-paper {
    border-radius: 28px;
    padding: 1.5rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 250, 252, 0.98) 100%),
        repeating-linear-gradient(
            to bottom,
            rgba(59, 130, 246, 0.04) 0,
            rgba(59, 130, 246, 0.04) 34px,
            rgba(255, 255, 255, 0) 34px,
            rgba(255, 255, 255, 0) 68px
        );
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.notes-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(15, 23, 42, 0.08);
}

.notes-sheet-school {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notes-sheet-subtitle {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.3rem;
}

.notes-sheet-title {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: right;
}

.notes-sheet-meta {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.notes-sheet-meta-item {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.notes-sheet-meta-item span {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notes-sheet-meta-item strong {
    line-height: 1.35;
}

.notes-book-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.notes-book-item-top strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.notes-book-item-top span,
.notes-book-item-meta span {
    color: #475569;
    font-size: 0.82rem;
}

.notes-book-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.notes-book-empty {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px dashed rgba(148, 163, 184, 0.32);
    color: #475569;
    font-weight: 700;
}

.notes-sheet-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.notes-sheet-meta-item {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.notes-sheet-meta-item span {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.notes-sheet-meta-item strong {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
}

.notes-sheet-handwritten {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    margin-bottom: 1.15rem;
    padding: 0.7rem 1rem;
    border-radius: 16px;
    background: rgba(254, 249, 195, 0.45);
    border: 1px dashed rgba(146, 64, 14, 0.35);
    color: #7c2d12;
    font-size: 1.02rem;
    font-weight: 700;
    font-style: italic;
    font-family: "Segoe Print", "Bradley Hand", cursive;
}

.notes-sticky-header {
    position: sticky;
    top: 0.85rem;
    z-index: 8;
    margin-bottom: 0.85rem;
}

.notes-sheet-overview {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.notes-overview-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 0.8rem;
    min-width: min(420px, 100%);
}

.notes-overview-chip {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.notes-overview-chip span {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notes-overview-chip strong {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 900;
}

.notes-config-panel {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dbe2ea;
}

.notes-config-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.notes-config-title {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
}

.notes-config-subtitle {
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 500;
}

.notes-config-helper {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.notes-config-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
}

.notes-config-card {
    flex: 0 0 auto;
    padding: 0.75rem 0.8rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.notes-config-card-main {
    min-width: 320px;
}

.notes-config-card-small {
    min-width: 140px;
}

.notes-config-card-title {
    margin-bottom: 0.55rem;
    color: #0f172a;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.notes-config-inline {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    align-items: end;
}

.notes-weight-field {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
}

.notes-config-card .notes-sheet-setting-field {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.notes-config-card .notes-sheet-setting-field label {
    margin-bottom: 0.3rem;
    font-size: 0.68rem;
}

.notes-config-card .notes-compact-control {
    width: auto !important;
    min-width: 0;
    display: inline-block !important;
    flex: 0 0 auto;
}

.notes-config-card-main .notes-compact-control {
    width: 320px !important;
    max-width: min(100%, 320px);
}

.notes-config-inline .notes-sheet-setting-field:first-child .notes-compact-control {
    width: 96px !important;
}

.notes-config-card-small .notes-compact-control,
.notes-weight-field .notes-compact-control {
    width: 92px !important;
}

.notes-config-layout .form-control,
.notes-config-layout .form-select {
    width: auto !important;
    min-width: 0 !important;
    display: inline-block !important;
}

.notes-config-card,
.notes-config-card .notes-sheet-setting-field,
.notes-config-inline,
.notes-config-layout {
    max-width: 100%;
}

.notes-floating-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.8rem 0.9rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    box-shadow: none;
}

.notes-sheet-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notes-export-btn,
.notes-save-btn {
    min-width: 150px;
    border-radius: 8px;
}

.notes-export-btn {
    box-shadow: none;
}

.notes-save-btn {
    min-width: 150px;
    border-radius: 8px;
    box-shadow: none;
}

.notes-sheet-table-wrap {
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow-x: auto;
    overflow-y: visible;
    background: #fff;
    padding-right: 1.4rem;
    scrollbar-gutter: stable both-edges;
}

.notes-sheet-table-wrap::-webkit-scrollbar {
    height: 12px;
}

.notes-sheet-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.65);
    border-radius: 999px;
}

.notes-sheet-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.notes-sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.notes-sheet-table td,
.notes-sheet-table th {
    border-color: rgba(203, 213, 225, 0.65);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.notes-sheet-table th:last-child,
.notes-sheet-table td:last-child {
    padding-right: 1.15rem;
}

.notes-col-index {
    width: 56px;
    min-width: 56px;
}

.notes-col-student {
    min-width: 180px;
}

.notes-col-grade {
    width: 62px;
    min-width: 62px;
}

.notes-col-average {
    width: 84px;
    min-width: 84px;
    text-align: center;
}

.notes-student-name {
    min-width: 180px;
    color: #0f172a;
    font-weight: 700;
    white-space: normal;
}

.notes-grade-input {
    width: 54px;
    min-width: 54px;
    border-radius: 12px;
    border-color: rgba(148, 163, 184, 0.25);
    font-weight: 700;
    font-size: 0.84rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    box-shadow: none !important;
}

.notes-grade-input:focus {
    border-color: rgba(37, 99, 235, 0.5);
}

.notes-average-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    min-height: 32px;
    border-radius: 6px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 800;
    border: 1px solid #dbe2ea;
}

.notes-sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
}

.notes-sheet-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 0.7rem;
    flex: 1 1 auto;
}

.notes-summary-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 54px;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.notes-summary-label {
    margin-bottom: 0.22rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.notes-summary-item strong {
    color: #0f172a;
    font-size: 0.96rem;
    font-weight: 800;
}

.notes-toolbar-card {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    box-shadow: none !important;
}

.notes-toolbar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #e5e7eb;
}

.notes-toolbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notes-toolbar-logo,
.notes-sheet-logo {
    width: 74px;
    height: 74px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.notes-toolbar-stats {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.notes-toolbar-stats span {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
}

.notes-book-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
}

.notes-open-book-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.notes-open-book-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid rgba(37, 99, 235, 0.16);
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 700;
}

.notes-book-item {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dbe2ea;
    padding: 0.85rem 0.9rem;
    text-decoration: none;
    color: inherit;
}

.notes-open-summary-card {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    box-shadow: none !important;
}

.notes-open-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notes-open-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.notes-open-summary-meta span {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

.notes-book-item:hover,
.notes-book-item.active {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: none;
}

.notes-sheet-paper {
    padding: 1.1rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    box-shadow: none;
}

.notes-sheet-minimal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0 0.75rem 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
}

.notes-sheet-minimal-main {
    min-width: 0;
}

.notes-sheet-minimal-title {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.notes-sheet-minimal-teacher {
    margin-top: 0.35rem;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 700;
}

.notes-sheet-minimal-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.notes-sheet-logo-card {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    overflow: hidden;
}

.notes-sheet-logo-image {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    display: block;
}

.notes-sheet-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.notes-sheet-detail-card {
    min-width: 0;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.notes-sheet-detail-card span {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.notes-sheet-detail-card strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
    word-break: break-word;
}

.notes-sheet-setting-field {
    width: 100%;
    height: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.notes-sheet-setting-field label {
    display: block;
    margin-bottom: 0.45rem;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notes-sheet-caption {
    margin-bottom: 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 500;
}

.notes-config-copy {
    min-width: 0;
}

.notes-record-control {
    width: 320px !important;
    max-width: 100%;
}

.notes-mini-control {
    width: 96px !important;
}

.notes-weight-control {
    width: 92px !important;
}

.notes-sheet-table thead th {
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 800;
}

.notes-sheet-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.78);
}

.notes-print-sheet {
    display: none;
}

.notes-print-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.notes-print-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.notes-print-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.notes-print-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.notes-print-teacher {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 800;
}

.notes-print-meta-line {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 600;
}

.notes-print-logo-small {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.notes-print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.notes-print-table th,
.notes-print-table td {
    border: 1px solid #94a3b8;
    padding: 0.2rem 0.24rem;
    color: #0f172a;
    font-size: 0.68rem;
    line-height: 1.15;
}

.notes-print-table th {
    background: #f1f5f9;
    text-transform: uppercase;
    font-weight: 900;
}

.notes-print-table td {
    height: 24px;
}

.notes-print-col-index,
.notes-print-col-note,
.notes-print-col-average,
.notes-print-table td:not(.notes-print-student-name) {
    text-align: center;
}

.notes-print-col-index {
    width: 40px;
}

.notes-print-col-note,
.notes-print-col-average {
    width: 52px;
}

.notes-print-col-student {
    width: auto;
}

.notes-print-student-name {
    text-transform: uppercase;
}

.notes-grade-input {
    width: 54px;
    min-width: 54px;
    height: 38px;
    padding: 0.25rem 0.25rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #fff;
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.notes-average-badge {
    width: 72px;
    min-height: 32px;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
}

.notes-grade-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.notes-compact-control {
    min-height: 42px !important;
    height: 42px !important;
    padding: 0.45rem 0.8rem !important;
    border-radius: 10px !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    background: #fff !important;
    color: #0f172a !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.notes-sheet-summary strong {
    color: inherit;
}

.js-notes-weight-total.is-valid {
    color: #16a34a !important;
}

.js-notes-weight-total.is-warning {
    color: #f59e0b !important;
}

.notes-setting-select {
    padding-right: 2.2rem !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #475569 50%),
        linear-gradient(135deg, #475569 50%, transparent 50%) !important;
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px) !important;
    background-size: 6px 6px, 6px 6px !important;
    background-repeat: no-repeat !important;
}

.notes-print-btn {
    min-width: 140px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    color: #0f172a;
    box-shadow: none;
}

.notes-print-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

.notes-sheet-actions .btn,
.notes-sheet-actions .btn:hover,
.notes-sheet-actions .btn:focus {
    box-shadow: none !important;
    transform: none !important;
}

.notes-save-btn {
    background: #1f2937 !important;
    border-color: #1f2937 !important;
    color: #ffffff !important;
}

.notes-save-btn:hover,
.notes-save-btn:focus {
    background: #111827 !important;
    border-color: #111827 !important;
}

.notes-export-btn {
    background: #ffffff !important;
    border: 1px solid #dbe2ea !important;
    color: #0f172a !important;
}

.notes-export-btn:hover,
.notes-export-btn:focus {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Reglas finales de Notas para evitar choques con utilidades de Bootstrap y bloques duplicados */
.notes-admin-view .notes-toolbar-card.card,
.notes-admin-view .notes-open-summary-card.card,
.notes-admin-view .notes-sheet-empty-card.card {
    border: 1px solid #dbe2ea !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: #ffffff !important;
}

.notes-admin-view .notes-sheet-empty-card .card-body {
    padding: 2.25rem 1.5rem !important;
}

.notes-admin-view .notes-filter-control,
.notes-admin-view .notes-sheet-setting-field .form-control,
.notes-admin-view .notes-sheet-setting-field .form-select {
    min-height: 42px !important;
    border-radius: 6px !important;
    border: 1px solid #dbe2ea !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

.notes-admin-view .notes-filter-control:focus,
.notes-admin-view .notes-sheet-setting-field .form-control:focus,
.notes-admin-view .notes-sheet-setting-field .form-select:focus,
.notes-admin-view .notes-grade-input:focus {
    border-color: #94a3b8 !important;
    box-shadow: 0 0 0 0.12rem rgba(148, 163, 184, 0.18) !important;
}

.notes-admin-view .select2-container--bootstrap-5 .select2-selection {
    min-height: 42px !important;
    border-radius: 6px !important;
    border: 1px solid #dbe2ea !important;
    box-shadow: none !important;
}

.notes-admin-view .notes-open-btn {
    border-radius: 6px !important;
    background: #111827 !important;
    border-color: #111827 !important;
    box-shadow: none !important;
}

.notes-admin-view .notes-open-btn:hover,
.notes-admin-view .notes-open-btn:focus {
    background: #000000 !important;
    border-color: #000000 !important;
}

.notes-admin-view .notes-open-summary .btn,
.notes-admin-view .notes-sheet-actions .btn {
    border-radius: 6px !important;
}

@media (max-width: 991.98px) {
    .notes-sheet-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-extra-grid {
        grid-template-columns: 1fr;
    }

    .notes-toolbar-header,
    .notes-open-book-bar,
    .notes-open-summary,
    .notes-config-panel-header,
    .notes-sheet-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .notes-sheet-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notes-sticky-header {
        top: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .notes-sheet-paper {
        padding: 1rem;
        border-radius: 22px;
    }

    .notes-sheet-minimal-header {
        align-items: flex-start;
    }

    .notes-sheet-details-grid,
    .notes-sheet-summary,
    .notes-print-meta-line {
        grid-template-columns: 1fr;
    }

    .notes-config-layout,
    .notes-config-inline {
        display: grid;
        grid-template-columns: 1fr;
    }

    .notes-weight-field {
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .notes-config-card,
    .notes-config-card-main,
    .notes-config-card-small,
    .notes-config-card-main .notes-compact-control,
    .notes-config-inline .notes-sheet-setting-field:first-child .notes-compact-control,
    .notes-config-card-small .notes-compact-control,
    .notes-weight-field .notes-compact-control,
    .notes-export-btn,
    .notes-save-btn,
    .notes-print-btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .notes-sheet-actions,
    .notes-floating-actions {
        align-items: stretch;
    }

    .notes-student-name {
        min-width: 220px;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    body.theme-dark .notes-admin-view,
    html.theme-dark body .notes-admin-view {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .notes-toolbar-card,
    .notes-open-summary-card,
    .notes-config-panel,
    .notes-sheet-caption,
    .notes-sticky-header,
    .notes-sheet-table-wrap,
    .notes-book-strip,
    .notes-sheet-placeholder,
    .notes-toolbar-stats,
    .notes-toolbar-header,
    .notes-open-summary,
    .no-print {
        display: none !important;
    }

    .notes-sheet-paper {
        background: #ffffff !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    .notes-sheet-details-grid {
        display: none !important;
    }

    .notes-print-sheet {
        display: block !important;
    }

    .notes-print-title {
        font-size: 0.96rem;
    }

    .notes-print-table th,
    .notes-print-table td {
        font-size: 0.64rem;
        padding: 0.16rem 0.18rem;
        height: 19px;
    }
}

.table thead th,
.table-custom th,
.calendar-table thead th {
    background: #f8fafc !important;
}

.btn {
    border-radius: 12px;
    letter-spacing: 0;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.btn-info,
.btn-login-modern,
.nav-pills .nav-link.active,
#attendanceTabs .nav-link.active {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.btn-primary:hover,
.btn-info:hover,
.btn-login-modern:hover,
.nav-pills .nav-link.active:hover,
#attendanceTabs .nav-link.active:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%) !important;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: transparent;
}

.btn-warning,
.permissions-secondary-btn {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border-color: transparent;
}

.permissions-hero {
    box-shadow: 0 16px 34px rgba(30, 64, 175, 0.14) !important;
}

.permissions-hero-banner {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%) !important;
}

.permissions-main-btn {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10) !important;
}

.permissions-filters,
.permissions-legend,
.permissions-stat-card,
.calendar-table-wrapper {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}

.calendar-cell {
    border-radius: 8px;
}

.calendar-cell:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.calendar-legend-item {
    background: rgba(255, 255, 255, 0.9);
}

.login-card {
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.22);
}

.login-header-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
}

/* Ficha institucional */
.ficha-header-institutional {
    position: relative;
    overflow: hidden;
}

.ficha-header-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 22%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 45%);
    pointer-events: none;
}

.ficha-insignia {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.ficha-insignia img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ficha-kicker {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0.35rem;
}

.ficha-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
}

.ficha-profile-avatar {
    border: 4px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2) !important;
    flex-shrink: 0;
}

.ficha-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.84);
}

.ficha-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.ficha-summary-item {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    min-width: 0;
    backdrop-filter: blur(8px);
}

.ficha-summary-item strong {
    display: block;
    color: #ffffff;
    font-size: 0.98rem;
    line-height: 1.35;
    word-break: break-word;
}

.ficha-summary-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 0.35rem;
}

.ficha-info-item {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    height: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@media (max-width: 991.98px) {
    .ficha-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard institucional */
.dashboard-stats-row {
    margin-bottom: 1.75rem !important;
}

.dashboard-stat-card {
    position: relative;
    min-height: 154px;
    align-items: flex-start !important;
    border-radius: 26px !important;
    padding: 1.5rem !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.14) !important;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.07) !important;
    overflow: hidden;
}

.dashboard-stat-card::after {
    content: "";
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    top: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0));
}

.dashboard-stat-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 12px 24px rgba(15, 23, 42, 0.08) !important;
}

.dashboard-stat-content {
    flex: 1;
}

.dashboard-stat-content h6 {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.45rem !important;
    color: #64748b !important;
}

.dashboard-stat-content h2 {
    font-size: 2.3rem;
    line-height: 1;
    margin-bottom: 0.65rem !important;
}

.dashboard-stat-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.95);
    font-weight: 700;
    color: #64748b !important;
}

.dashboard-stat-card-total::after {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.5), rgba(37, 99, 235, 0));
}

.dashboard-stat-card-docentes::after {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.5), rgba(16, 185, 129, 0));
}

.dashboard-stat-card-asistentes::after {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.5), rgba(14, 165, 233, 0));
}

.dashboard-stat-card-pendientes::after {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.5), rgba(245, 158, 11, 0));
}

.dashboard-toolbar-section {
    margin-bottom: 2rem !important;
}

.dashboard-hero-card {
    position: relative;
    padding: 1.6rem !important;
    border-radius: 26px !important;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(244,247,251,0.98) 100%) !important;
}

.dashboard-hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.55), transparent 45%);
    pointer-events: none;
}

.dashboard-hero-card > .row {
    position: relative;
    z-index: 1;
}

.dashboard-hero-copy {
    align-items: center !important;
}

.dashboard-hero-seal {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    padding: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-hero-seal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dashboard-section-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #2563eb;
}

.dashboard-hero-copy h4 {
    font-size: 1.65rem;
    line-height: 1.15;
}

.dashboard-hero-copy p {
    max-width: 680px;
    color: #64748b !important;
}

.dashboard-toolbar-actions {
    justify-content: flex-end;
    align-items: center;
}

.dashboard-search-box {
    min-height: 52px;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    background: rgba(255,255,255,0.9) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.dashboard-search-box:focus-within {
    border-color: rgba(37, 99, 235, 0.35) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.dashboard-filter-btn {
    min-height: 52px;
    min-width: 108px;
}

.institutional-table-card {
    border-radius: 26px !important;
    overflow: hidden;
}

.institutional-table-header {
    padding: 1.1rem 1.35rem !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%) !important;
}

.institutional-segment {
    background: #eef2f7 !important;
    border: 1px solid rgba(148, 163, 184, 0.16);
    padding: 0.2rem !important;
}

.institutional-segment .btn {
    border-radius: 999px !important;
    color: #475569;
    font-weight: 700;
}

.institutional-segment .btn.active,
.institutional-segment .btn:focus {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.institutional-table-wrap {
    padding: 0.35rem 0.35rem 0.55rem;
    background: linear-gradient(180deg, rgba(248,250,252,0.78) 0%, rgba(255,255,255,0.92) 100%);
}

.institutional-table {
    overflow: hidden;
}

.institutional-table thead th {
    font-size: 0.72rem !important;
    letter-spacing: 0.12em;
    color: #64748b !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

.institutional-table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.institutional-table tbody tr:hover {
    background: rgba(255,255,255,0.92) !important;
}

.institutional-table td {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.institutional-table .avatar-sm {
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.institutional-table code {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: #334155 !important;
    padding: 0.35rem 0.7rem;
    display: inline-block;
}

.institutional-table .dropdown .btn-light {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.ficha-info-item {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

@media (max-width: 991.98px) {
    .dashboard-hero-card {
        padding: 1.25rem !important;
    }

    .dashboard-toolbar-actions {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .dashboard-hero-copy {
        align-items: flex-start !important;
    }
}

@media (max-width: 767.98px) {
    .dashboard-stat-card {
        min-height: auto;
    }

    .dashboard-hero-copy {
        gap: 1rem !important;
    }

    .dashboard-hero-seal {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }

    .dashboard-hero-copy h4 {
        font-size: 1.35rem;
    }
}

/* Segunda pasada institucional: shell, login, formularios */


.topbar-modern {
    min-height: 84px;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.topbar-left h2 {
    font-size: 1.18rem;
    letter-spacing: 0.01em;
}

.topbar-left {
    gap: 0.9rem;
}

.topbar-logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    flex: 0 0 auto;
    overflow: hidden;
}

.topbar-logo-image {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.topbar-right {
    gap: 0.9rem !important;
    flex: 0 0 auto;
    justify-content: flex-end;
}

.user-info {
    background: rgba(248,250,252,0.92);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 0.55rem 0.85rem;
    min-width: 150px;
}

.user-info .text-muted {
    font-size: 0.68rem !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-btn {
    border-radius: 999px;
}

.profile-avatar-topbar {
    border: 3px solid rgba(255,255,255,0.95);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.10);
}

.topbar-user-avatar-wrap {
    flex: 0 0 auto;
}

.topbar-profile-menu {
    min-width: 320px;
}

.theme-toggle-dropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.theme-toggle-copy {
    min-width: 0;
}

.theme-toggle-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
}

.theme-toggle-subtitle {
    margin-top: 0.18rem;
    font-size: 0.74rem;
    color: #64748b;
}

.theme-toggle-input {
    width: 3rem !important;
    height: 1.55rem;
    cursor: pointer;
}

.dropdown-menu {
    border-radius: 18px !important;
    border: 1px solid rgba(148, 163, 184, 0.14) !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.10) !important;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(14px);
}

.dropdown-item {
    border-radius: 12px;
    padding: 0.7rem 0.95rem;
}

.dropdown-item i {
    width: 18px;
}

.form-control,
.form-select {
    min-height: 52px;
}

body.theme-dark,
html.theme-dark body {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

.theme-dark .main-content {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 22%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
}

.theme-dark .topbar-modern {
    background: rgba(15, 23, 42, 0.88) !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.32) !important;
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.45) !important;
}

.theme-dark .topbar-left h2,
.theme-dark .text-dark,
.theme-dark .dropdown-item,
.theme-dark .modal-title,
.theme-dark .form-label,
.theme-dark .card-title,
.theme-dark .modal-body,
.theme-dark .modal-header,
.theme-dark .modal-footer {
    color: #f8fafc !important;
}

.theme-dark .small,
.theme-dark small,
.theme-dark .text-muted {
    color: #94a3b8 !important;
}

.theme-dark .user-info {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(71, 85, 105, 0.32) !important;
}

.theme-dark .profile-avatar-topbar {
    border-color: rgba(30, 41, 59, 0.9) !important;
}

.theme-dark .dropdown-menu,
.theme-dark .modal-content,
.theme-dark .table-responsive,
.theme-dark .card,
.theme-dark .card-modern {
    background: rgba(15, 23, 42, 0.94) !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
    box-shadow: 0 22px 40px rgba(2, 6, 23, 0.42) !important;
    color: #e2e8f0 !important;
}

.theme-dark .topbar-search-trigger,
.theme-dark .user-info,
.theme-dark .badge,
.theme-dark .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info) {
    color: #e2e8f0 !important;
}

.theme-dark .dropdown-item:hover,
.theme-dark .dropdown-item:focus {
    background: rgba(30, 41, 59, 0.92) !important;
}

.theme-dark .theme-toggle-dropdown {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
}

.theme-dark .theme-toggle-title {
    color: #f8fafc !important;
}

.theme-dark .theme-toggle-subtitle {
    color: #94a3b8 !important;
}

.theme-dark .btn-light,
.theme-dark .btn-white {
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
    color: #e2e8f0 !important;
}

.theme-dark .btn-outline-primary {
    color: #93c5fd !important;
    border-color: rgba(96, 165, 250, 0.4) !important;
}

.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .input-group-text {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(71, 85, 105, 0.34) !important;
    color: #f8fafc !important;
}

.theme-dark .form-control::placeholder {
    color: #94a3b8 !important;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    border-color: rgba(96, 165, 250, 0.46) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18) !important;
}

.theme-dark .badge.bg-light {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #f8fafc !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
}

.theme-dark .dashboard-alert-item,
.theme-dark .list-group-item,
.theme-dark .accordion-item {
    background: rgba(15, 23, 42, 0.72) !important;
    color: #e2e8f0 !important;
    border-color: rgba(71, 85, 105, 0.26) !important;
}

.theme-dark .table {
    color: #e2e8f0 !important;
}

.theme-dark .table > :not(caption) > * > * {
    background: rgba(15, 23, 42, 0.76) !important;
    color: #e2e8f0 !important;
    border-color: rgba(71, 85, 105, 0.26) !important;
}

.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background: rgba(30, 41, 59, 0.78) !important;
}

.theme-dark .table-hover > tbody > tr:hover > * {
    background: rgba(37, 99, 235, 0.16) !important;
}

.theme-dark .accordion-button {
    background: rgba(15, 23, 42, 0.94) !important;
    color: #f8fafc !important;
    box-shadow: none !important;
}

.theme-dark .accordion-button:not(.collapsed) {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #f8fafc !important;
}

.theme-dark a {
    color: #93c5fd;
}

.theme-dark a:hover {
    color: #bfdbfe;
}

.theme-dark .dashboard-stat-content h2,
.theme-dark .dashboard-alert-count,
.theme-dark .dashboard-alert-title,
.theme-dark .fw-semibold,
.theme-dark strong {
    color: #f8fafc !important;
}

.theme-dark .text-success {
    color: #4ade80 !important;
}

.theme-dark .text-danger {
    color: #f87171 !important;
}

.theme-dark .text-warning {
    color: #fbbf24 !important;
}

.theme-dark .text-info {
    color: #38bdf8 !important;
}

.theme-dark .bg-light {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #e2e8f0 !important;
}

.theme-dark .institutional-table-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    border: 1px solid rgba(71, 85, 105, 0.3) !important;
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.46) !important;
}

.theme-dark .institutional-table-header,
.theme-dark .institutional-table-card .card-header {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.96) 100%) !important;
    border-bottom-color: rgba(71, 85, 105, 0.3) !important;
}

.theme-dark .institutional-table-header h5,
.theme-dark .institutional-table-card h5,
.theme-dark .institutional-table-card .dashboard-section-kicker {
    color: #f8fafc !important;
}

.theme-dark .institutional-segment {
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.theme-dark .institutional-segment .btn {
    color: #cbd5e1 !important;
}

.theme-dark .institutional-segment .btn.active,
.theme-dark .institutional-segment .btn:focus {
    background: rgba(51, 65, 85, 0.96) !important;
    color: #f8fafc !important;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.32) !important;
}

.theme-dark .institutional-table-wrap {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
}

.theme-dark .institutional-table thead,
.theme-dark .institutional-table thead.bg-light,
.theme-dark .institutional-table thead tr,
.theme-dark .institutional-table thead th {
    background: rgba(15, 23, 42, 0.98) !important;
    color: #94a3b8 !important;
    border-bottom-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .institutional-table tbody tr > * {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #e2e8f0 !important;
    border-color: rgba(71, 85, 105, 0.24) !important;
}

.theme-dark .institutional-table tbody tr:hover > * {
    background: rgba(30, 41, 59, 0.95) !important;
}

.theme-dark .institutional-table .text-dark,
.theme-dark .institutional-table td .fw-bold,
.theme-dark .institutional-table td .small.text-dark {
    color: #f8fafc !important;
}

.theme-dark .institutional-table .text-muted,
.theme-dark .institutional-table td code,
.theme-dark .institutional-table td .small {
    color: #94a3b8 !important;
}

.theme-dark .institutional-table code {
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
    color: #cbd5e1 !important;
}

.theme-dark .institutional-table .avatar-sm {
    border-color: rgba(30, 41, 59, 0.96) !important;
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.35) !important;
}

.theme-dark #noPersonnelResults td,
.theme-dark .empty-row td {
    background: rgba(15, 23, 42, 0.84) !important;
    color: #94a3b8 !important;
}

.theme-dark .topbar-modern,
.theme-dark .topbar-modern * {
    opacity: 1 !important;
}

.theme-dark .topbar-left h2 {
    color: #f8fafc !important;
}

.theme-dark .topbar-logo-wrap {
    background: rgba(15, 23, 42, 0.96) !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
    box-shadow: 0 12px 22px rgba(2, 6, 23, 0.35) !important;
}

.theme-dark .topbar-search-trigger,
.theme-dark #toggleDesignMode {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(71, 85, 105, 0.34) !important;
    color: #f8fafc !important;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.28) !important;
}

.theme-dark .user-info .fw-bold,
.theme-dark .user-info .text-muted {
    color: #f8fafc !important;
}

.theme-dark .dashboard-hero-card {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
    border: 1px solid rgba(71, 85, 105, 0.3) !important;
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.42) !important;
}

.theme-dark .dashboard-hero-card::before {
    background: linear-gradient(90deg, rgba(255,255,255,0.03), transparent 42%) !important;
}

.theme-dark .dashboard-hero-card .dashboard-section-kicker,
.theme-dark .dashboard-hero-card h4,
.theme-dark .dashboard-hero-card p,
.theme-dark .dashboard-hero-card .text-dark,
.theme-dark .dashboard-hero-card .text-muted {
    color: #f8fafc !important;
}

.theme-dark .dashboard-hero-card p,
.theme-dark .dashboard-hero-card .text-muted {
    color: #cbd5e1 !important;
}

.theme-dark .dashboard-search-box {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(71, 85, 105, 0.34) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03) !important;
}

.theme-dark .dashboard-search-box i,
.theme-dark .dashboard-search-box input,
.theme-dark .dashboard-search-box input::placeholder,
.theme-dark .dashboard-hero-card .btn,
.theme-dark .dashboard-hero-card .btn i {
    color: #f8fafc !important;
}

.theme-dark .dashboard-hero-card .btn.btn-success,
.theme-dark .dashboard-hero-card .btn.btn-primary {
    color: #ffffff !important;
}

.theme-dark .institutional-table-card .card-header,
.theme-dark .institutional-table-card .card-header *,
.theme-dark .institutional-table-card .table-responsive,
.theme-dark .institutional-table-card .table-responsive *,
.theme-dark .institutional-table-card .table,
.theme-dark .institutional-table-card .table * {
    opacity: 1 !important;
}

.theme-dark .attendance-suite-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    border: 1px solid rgba(71, 85, 105, 0.3) !important;
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.46) !important;
}

.theme-dark .attendance-suite-banner {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.theme-dark .attendance-suite-tabs-wrap {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.96) 100%) !important;
    border-bottom-color: rgba(71, 85, 105, 0.3) !important;
}

.theme-dark #attendanceTabs .nav-link {
    color: #cbd5e1 !important;
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid transparent;
}

.theme-dark #attendanceTabs .nav-link:hover {
    color: #f8fafc !important;
    background: rgba(30, 41, 59, 0.72) !important;
    border-color: rgba(71, 85, 105, 0.24) !important;
}

.theme-dark .attendance-suite-body {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    color: #e2e8f0 !important;
}

.theme-dark .attendance-suite-body .card,
.theme-dark .attendance-suite-body .card-modern,
.theme-dark .attendance-suite-body .course-attendance-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.96) 100%) !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.34) !important;
}

.theme-dark .attendance-suite-body .course-attendance-header {
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.35) !important;
}

.theme-dark .attendance-suite-body .course-meta-pill,
.theme-dark .attendance-suite-body .course-block-chip,
.theme-dark .attendance-suite-body .course-attendance-actions-main,
.theme-dark .attendance-suite-body .permissions-filters,
.theme-dark .attendance-suite-body .permissions-legend,
.theme-dark .attendance-suite-body .permissions-stat-card,
.theme-dark .attendance-suite-body .calendar-table-wrapper {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.94) 0%, rgba(15, 23, 42, 0.96) 100%) !important;
    border-color: rgba(71, 85, 105, 0.26) !important;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.3) !important;
}

.theme-dark .attendance-suite-body h1,
.theme-dark .attendance-suite-body h2,
.theme-dark .attendance-suite-body h3,
.theme-dark .attendance-suite-body h4,
.theme-dark .attendance-suite-body h5,
.theme-dark .attendance-suite-body h6,
.theme-dark .attendance-suite-body .text-dark,
.theme-dark .attendance-suite-body .fw-bold,
.theme-dark .attendance-suite-body .course-meta-value,
.theme-dark .attendance-suite-body .course-block-chip-title {
    color: #f8fafc !important;
}

.theme-dark .attendance-suite-body .text-muted,
.theme-dark .attendance-suite-body .small,
.theme-dark .attendance-suite-body .course-attendance-kicker,
.theme-dark .attendance-suite-body .course-meta-content strong,
.theme-dark .attendance-suite-body .course-block-chip-meta {
    color: #94a3b8 !important;
}

.theme-dark .attendance-suite-body .course-mini-total-value {
    color: #f8fafc !important;
}

.theme-dark .attendance-suite-body .table {
    color: #e2e8f0 !important;
}

.theme-dark .attendance-suite-body .table > :not(caption) > * > * {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #e2e8f0 !important;
    border-color: rgba(71, 85, 105, 0.24) !important;
}

.theme-dark .attendance-suite-body .table thead th,
.theme-dark .attendance-suite-body .table thead,
.theme-dark .attendance-suite-body .table thead tr {
    background: rgba(15, 23, 42, 0.98) !important;
    color: #94a3b8 !important;
}

.theme-dark .attendance-suite-body .table-hover > tbody > tr:hover > * {
    background: rgba(30, 41, 59, 0.95) !important;
}

.theme-dark .attendance-suite-body .form-control,
.theme-dark .attendance-suite-body .form-select,
.theme-dark .attendance-suite-body .input-group-text {
    background: rgba(15, 23, 42, 0.92) !important;
    color: #e2e8f0 !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .attendance-suite-body .form-control::placeholder {
    color: #94a3b8 !important;
}

.theme-dark .attendance-suite-body .btn-light,
.theme-dark .attendance-suite-body .btn-white,
.theme-dark .attendance-suite-body .btn-outline-secondary {
    background: rgba(30, 41, 59, 0.94) !important;
    color: #f8fafc !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
}

.attendance-retired-card {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
    border: 0 !important;
}

.attendance-retired-btn {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #7c2d12 !important;
}

.theme-dark .attendance-retired-card {
    background: linear-gradient(135deg, #d97706 0%, #ea580c 100%) !important;
    border: 1px solid rgba(251, 146, 60, 0.32) !important;
    box-shadow: 0 18px 34px rgba(124, 45, 18, 0.32) !important;
}

.theme-dark .attendance-retired-card .small,
.theme-dark .attendance-retired-card .h3,
.theme-dark .attendance-retired-card .fw-bold {
    color: #fff7ed !important;
}

.theme-dark .attendance-retired-btn {
    background: rgba(255, 247, 237, 0.96) !important;
    color: #7c2d12 !important;
    border-color: transparent !important;
}

.theme-dark .attendance-course-list-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.34) !important;
}

.theme-dark .attendance-course-list-header {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
    border-bottom-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .attendance-course-list-title,
.theme-dark .attendance-course-list-title i {
    color: #f8fafc !important;
}

.theme-dark .attendance-course-list-body {
    background: rgba(15, 23, 42, 0.92) !important;
}

.theme-dark .attendance-course-list-item {
    background: rgba(15, 23, 42, 0.84) !important;
    border-bottom-color: rgba(71, 85, 105, 0.22) !important;
}

.theme-dark .attendance-course-list-item:hover {
    background: rgba(30, 41, 59, 0.95) !important;
}

.theme-dark .attendance-course-list-item.active {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.38) 0%, rgba(29, 78, 216, 0.30) 100%) !important;
    color: #f8fafc !important;
}

.theme-dark .attendance-course-list-name {
    color: #f8fafc !important;
}

.theme-dark .attendance-course-list-meta,
.theme-dark .attendance-course-list-item .opacity-50 {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

.theme-dark .attendance-course-list-teacher {
    color: #60a5fa !important;
}

.theme-dark .attendance-course-list-card .btn-outline-danger,
.theme-dark .attendance-course-list-card .btn-outline-primary {
    background: rgba(15, 23, 42, 0.3) !important;
    color: #f8fafc !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .inventory-suite-card,
.theme-dark .inventory-detail-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.42) !important;
}

.theme-dark .inventory-suite-categories {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.96) 100%) !important;
    border-bottom-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .inventory-suite-search {
    background: rgba(15, 23, 42, 0.28) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}

.theme-dark .inventory-category-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.96) 100%) !important;
    border-color: rgba(71, 85, 105, 0.26) !important;
    box-shadow: 0 16px 28px rgba(2, 6, 23, 0.28) !important;
}

.theme-dark .inventory-category-card .fw-bold {
    color: #f8fafc !important;
}

.theme-dark .inventory-personnel-accordion,
.theme-dark .inventory-personnel-list,
.theme-dark .inventory-detail-shell,
.theme-dark .inventory-detail-content {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .inventory-personnel-item,
.theme-dark .inventory-personnel-row {
    background: rgba(15, 23, 42, 0.84) !important;
    border-color: rgba(71, 85, 105, 0.22) !important;
}

.theme-dark .inventory-personnel-button {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #f8fafc !important;
}

.theme-dark .inventory-personnel-title,
.theme-dark .inventory-personnel-link,
.theme-dark .inventory-personnel-name {
    color: #f8fafc !important;
}

.theme-dark .inventory-personnel-meta,
.theme-dark .inventory-personnel-meta span,
.theme-dark .inventory-personnel-meta i {
    color: #94a3b8 !important;
}

.theme-dark .inventory-personnel-avatar {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #cbd5e1 !important;
}

.theme-dark .inventory-personnel-action {
    background: rgba(30, 41, 59, 0.94) !important;
    color: #f8fafc !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .inventory-detail-header .btn-light,
.theme-dark .inventory-detail-header .btn-white,
.theme-dark .inventory-detail-header .dropdown-menu,
.theme-dark .inventory-detail-nav,
.theme-dark .inventory-detail-nav .nav-link {
    background: rgba(15, 23, 42, 0.96) !important;
    color: #f8fafc !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .inventory-detail-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.46) 0%, rgba(29, 78, 216, 0.34) 100%) !important;
    color: #f8fafc !important;
}

.theme-dark .inventory-detail-content h5,
.theme-dark .inventory-detail-content .text-dark,
.theme-dark .inventory-detail-content .fw-bold,
.theme-dark .inventory-detail-content label {
    color: #f8fafc !important;
}

.inventory-manage-toolbar,
.inventory-manage-actions,
.inventory-manage-hero-inner,
.inventory-manage-hero-copy {
    min-width: 0;
}

.inventory-manage-actions {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-left: auto;
}

.inventory-manage-back {
    max-width: 100%;
    min-height: 42px;
}

.inventory-manage-btn {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    font-size: 0.9rem;
    line-height: 1.1;
}

.inventory-manage-actions > [class*="col-"] {
    min-width: 0;
}

.inventory-manage-hero-copy {
    flex: 1 1 320px;
}

.inventory-manage-hero-copy h2,
.inventory-manage-hero-copy p {
    word-break: break-word;
}

.theme-dark .attendance-suite-body .border,
.theme-dark .attendance-suite-body .border-top,
.theme-dark .attendance-suite-body .border-bottom,
.theme-dark .attendance-suite-body .border-start,
.theme-dark .attendance-suite-body .border-end {
    border-color: rgba(71, 85, 105, 0.24) !important;
}

.form-label {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.input-group .input-group-text {
    border-radius: 14px 0 0 14px;
}

.login-container {
    background:
        radial-gradient(circle at 16% 14%, rgba(56, 189, 248, 0.18), transparent 18%),
        radial-gradient(circle at 84% 12%, rgba(37, 99, 235, 0.16), transparent 20%),
        linear-gradient(135deg, #08111f 0%, #10213a 45%, #1e3a8a 100%);
}

.login-watermark {
    opacity: 0.035;
}

.login-card-wrapper {
    filter: drop-shadow(0 24px 50px rgba(2, 6, 23, 0.22));
}

.login-card {
    border-radius: 34px !important;
    overflow: hidden;
}

.login-header-gradient {
    padding: 3.1rem 2rem 3.3rem;
}

.login-header-gradient h3 {
    font-size: 1.8rem;
    letter-spacing: 0.01em;
}

.login-header-gradient p {
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-logo-floating {
    width: 96px;
    height: 96px;
    margin-top: -50px;
    border-radius: 30px;
}

.login-card .card-body {
    padding-left: 2.1rem !important;
    padding-right: 2.1rem !important;
}

.login-card .form-label {
    color: #475569 !important;
    letter-spacing: 0.08em;
}

.login-card .border-top {
    border-color: rgba(148, 163, 184, 0.14) !important;
}

.login-footer-text {
    color: rgba(226,232,240,0.76);
    letter-spacing: 0.04em;
}

.login-container .card-modern {
    border-radius: 30px !important;
}

.login-container .card-modern > .p-4,
.login-container .card-modern > .p-lg-5 {
    position: relative;
}

.login-container .icon-box.bg-success {
    background: rgba(5, 150, 105, 0.12) !important;
    border: 1px solid rgba(5, 150, 105, 0.12);
}

.login-container .form-control.bg-light,
.login-container .form-select.bg-light,
.login-container .input-group-text.bg-light {
    background: #f8fafc !important;
}

.login-container .input-group {
    border-radius: 16px;
    overflow: hidden;
}

.login-container .input-group .form-control,
.login-container .input-group .form-select,
.login-container .input-group .input-group-text {
    border-color: transparent !important;
}

.login-container .input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

@media (max-width: 991.98px) {
    .topbar-modern {
        padding: 1rem 1.15rem;
    }

    .user-info {
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 1rem;
    }

    .topbar-modern {
        margin: -1rem -1rem 1rem -1rem;
        padding: 0.95rem 1rem;
        min-height: 72px;
    }

    .topbar-left h2 {
        font-size: 1rem;
    }

    .topbar-logo-wrap {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .topbar-logo-image {
        width: 25px;
        height: 25px;
    }

    .dashboard-toolbar-actions {
        gap: 0.65rem !important;
    }

    .login-card .card-body {
        padding-left: 1.35rem !important;
        padding-right: 1.35rem !important;
    }
}

/* Responsive global */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
canvas,
video,
iframe {
    max-width: 100%;
    height: auto;
}

.page-content,
.page-content > .row,
.main-content,
.main-content > .row,
.row > [class*="col-"],
.card,
.card-modern,
.accordion,
.accordion-item,
.table-responsive,
.tab-content,
.tab-pane {
    min-width: 0;
}

.topbar-left,
.topbar-right,
.user-info,
.search-box-wrapper,
.search-box-modern,
.dashboard-search-box,
.inventory-suite-search {
    min-width: 0;
}

.topbar-left h2 {
    white-space: normal;
    word-break: break-word;
}

.topbar-modern,
.topbar-right,
.inventory-suite-banner > .d-flex,
.attendance-suite-banner,
.inventory-detail-header,
.institutional-table-header,
.dashboard-toolbar-actions {
    flex-wrap: wrap;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    min-width: 720px;
}

@media (max-width: 1199.98px) {
    .main-content {
        padding: 1.5rem;
    }

    .topbar-modern {
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
        padding: 1rem 1.25rem;
    }

    .course-attendance-top,
    .course-attendance-actions {
        grid-template-columns: 1fr;
    }

    .inventory-detail-shell {
        flex-direction: column;
    }

    .inventory-detail-nav {
        min-width: 0 !important;
        width: 100%;
        border-right: 0 !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .inventory-detail-content {
        width: 100%;
    }

    .inventory-manage-toolbar {
        align-items: stretch !important;
    }

    .inventory-manage-actions {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 1399.98px) {
    .inventory-manage-back {
        max-width: 260px;
    }

    .inventory-manage-actions .inventory-manage-btn {
        font-size: 0.82rem;
        padding-inline: 0.85rem !important;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(280px, 82vw);
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 1045;
    }

    .sidebar:hover,
    .sidebar.show,
    .sidebar.show:hover {
        width: min(280px, 82vw);
        transform: translateX(0);
    }

    .sidebar-header,
    .sidebar:hover .sidebar-header {
        padding: 1rem 1rem 1rem 1.15rem;
        justify-content: flex-start;
    }

    .sidebar-header > .d-flex,
    .sidebar:hover .sidebar-header > .d-flex {
        justify-content: flex-start;
    }

    .sidebar-title,
    .sidebar:hover .sidebar-title {
        opacity: 1;
        visibility: visible;
        width: auto;
        height: auto;
        margin-left: 1rem;
    }

    .sidebar .nav-links,
    .sidebar .sidebar-footer-nav,
    .sidebar:hover .nav-links,
    .sidebar:hover .sidebar-footer-nav {
        align-items: stretch;
    }

    .sidebar .sidebar-nav .nav-item,
    .sidebar:hover .sidebar-nav .nav-item {
        width: 100%;
        height: auto;
        padding: 0.85rem 1rem;
        justify-content: flex-start;
    }

    .sidebar .sidebar-nav .nav-item span,
    .sidebar:hover .sidebar-nav .nav-item span {
        position: static;
        opacity: 1;
        visibility: visible;
        margin-left: 1rem;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.52);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 1040;
    }

    .mobile-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        width: 100%;
        padding: 1rem;
    }

    .topbar-modern {
        margin: -1rem -1rem 1rem -1rem;
        min-height: auto;
    }

    .topbar-right {
        width: 100%;
        justify-content: flex-end;
    }

    .topbar-profile-menu {
        min-width: min(320px, calc(100vw - 1.5rem));
    }

    .inventory-suite-banner > .d-flex,
    .attendance-suite-banner,
    .inventory-detail-header,
    .institutional-table-header {
        align-items: flex-start !important;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 0.85rem;
    }

    .topbar-modern {
        margin: -0.85rem -0.85rem 0.85rem -0.85rem;
        padding: 0.85rem 0.9rem;
    }

    .topbar-right {
        gap: 0.6rem !important;
        justify-content: space-between;
    }

    .topbar-right .btn,
    .topbar-search-trigger,
    #toggleDesignMode {
        width: 100%;
        justify-content: center;
    }

    .user-info {
        width: 100%;
        min-width: 0;
    }

    .search-box-wrapper,
    .search-box-modern,
    .dashboard-search-box,
    .inventory-suite-search {
        width: 100%;
        max-width: 100%;
    }

    .inventory-detail-nav {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.75rem !important;
    }

    .inventory-detail-nav .nav-link {
        margin: 0 !important;
        width: 100%;
    }

    .inventory-detail-content {
        padding: 1rem !important;
    }

    .inventory-manage-actions,
    .inventory-manage-actions > div,
    .inventory-manage-actions .btn,
    .inventory-manage-back {
        width: 100%;
    }

    .inventory-manage-hero-inner {
        flex-wrap: wrap;
        align-items: flex-start !important;
    }

    .inventory-manage-hero-icon {
        padding: 1rem !important;
    }

    .inventory-manage-btn {
        min-height: 42px;
        padding-inline: 0.9rem !important;
        font-size: 0.84rem;
    }

    .attendance-suite-tabs-wrap {
        overflow-x: auto;
    }

    #attendanceTabs {
        min-width: max-content;
        flex-wrap: nowrap !important;
    }

    .inventory-personnel-row,
    .attendance-course-list-item,
    .inventory-detail-header,
    .inventory-suite-banner > .d-flex,
    .attendance-suite-banner {
        gap: 0.75rem !important;
    }

    .inventory-personnel-row,
    .list-group-item.d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        align-items: flex-start !important;
    }

    .inventory-personnel-action {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .topbar-profile-menu {
        min-width: calc(100vw - 1rem);
    }

    .inventory-detail-nav {
        grid-template-columns: 1fr;
    }

    .inventory-suite-banner,
    .attendance-suite-banner,
    .inventory-detail-header,
    .inventory-manage-hero {
        padding: 1rem !important;
    }

    .dashboard-stat-card,
    .inventory-category-card,
    .category-card-modern,
    .course-attendance-card {
        border-radius: 20px !important;
    }

    .inventory-manage-hero-copy h2 {
        font-size: 1.55rem;
    }

    .inventory-manage-hero-copy p {
        font-size: 0.92rem;
    }

    .inventory-manage-back {
        max-width: 100%;
    }
}

/* Notes Rebuild */
.notes-rx-view {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.notes-rx-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 320px;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.35), transparent 32%),
        linear-gradient(135deg, #0f172a 0%, #14213d 45%, #1d4ed8 100%);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.16);
}

.notes-rx-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 45%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.notes-rx-hero-main,
.notes-rx-hero-side {
    position: relative;
    z-index: 1;
}

.notes-rx-kicker,
.notes-rx-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notes-rx-kicker {
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.notes-rx-title {
    margin: 0.85rem 0 0.55rem;
    color: #ffffff;
    font-size: clamp(1.7rem, 2vw, 2.4rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.notes-rx-subtitle {
    margin: 0;
    max-width: 780px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.98rem;
    line-height: 1.65;
}

.notes-rx-hero-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    align-content: start;
}

.notes-rx-orb {
    position: absolute;
    right: 0.5rem;
    top: -0.75rem;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
    filter: blur(2px);
}

.notes-rx-hero-stat,
.notes-rx-hero-brand {
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.notes-rx-hero-stat span,
.notes-rx-hero-brand span {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.notes-rx-hero-stat strong {
    display: block;
    margin-top: 0.45rem;
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 900;
}

.notes-rx-hero-brand {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.notes-rx-hero-brand strong {
    display: block;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.notes-rx-launcher,
.notes-rx-library,
.notes-rx-active-head,
.notes-rx-panel,
.notes-rx-mainboard {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.notes-rx-launcher,
.notes-rx-library,
.notes-rx-active-head,
.notes-rx-mainboard {
    border-radius: 24px;
}

.notes-rx-launcher {
    padding: 1.35rem;
}

.notes-rx-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.notes-rx-field {
    grid-column: span 3;
}

.notes-rx-field-wide {
    grid-column: span 6;
}

.notes-rx-field-small {
    grid-column: span 2;
}

.notes-rx-field-inline {
    grid-column: span 3;
}

.notes-rx-submit {
    grid-column: span 3;
    display: flex;
    align-items: end;
}

.notes-rx-field label,
.notes-rx-field-block label {
    display: block;
    margin-bottom: 0.45rem;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.notes-rx-control {
    min-height: 48px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: none !important;
}

.notes-rx-control:focus,
.notes-rx-grade:focus {
    border-color: rgba(37, 99, 235, 0.4) !important;
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12) !important;
}

.notes-rx-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 0.75rem;
}

.notes-rx-primary-btn,
.notes-rx-soft-btn,
.notes-rx-ghost-btn {
    min-height: 48px;
    border-radius: 14px !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em;
    box-shadow: none !important;
}

.notes-rx-primary-btn {
    color: #ffffff !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: 0 !important;
}

.notes-rx-primary-btn:hover,
.notes-rx-primary-btn:focus {
    color: #ffffff !important;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
}

.notes-rx-soft-btn {
    color: #0f172a !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
}

.notes-rx-soft-btn:hover,
.notes-rx-soft-btn:focus,
.notes-rx-ghost-btn:hover,
.notes-rx-ghost-btn:focus {
    color: #0f172a !important;
    background: #f8fafc !important;
}

.notes-rx-ghost-btn {
    color: #0f172a !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
}

.notes-rx-library {
    padding: 1.25rem;
}

.notes-rx-section-head,
.notes-rx-panel-head,
.notes-rx-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.notes-rx-section-head {
    margin-bottom: 1rem;
}

.notes-rx-section-head h3,
.notes-rx-sheet-head h3,
.notes-rx-active-main h3 {
    margin: 0.22rem 0 0;
    color: #0f172a;
    font-size: 1.18rem;
    font-weight: 900;
}

.notes-rx-section-head p,
.notes-rx-sheet-head p,
.notes-rx-active-main p,
.notes-rx-panel-copy {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.notes-rx-section-kicker {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.notes-rx-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.notes-rx-book-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.notes-rx-book-card:hover,
.notes-rx-book-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
}

.notes-rx-book-top {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
}

.notes-rx-book-top strong {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.notes-rx-book-top span,
.notes-rx-book-meta {
    color: #64748b;
    font-size: 0.84rem;
}

.notes-rx-book-meta {
    display: grid;
    gap: 0.28rem;
}

.notes-rx-book-link {
    margin-top: auto;
    color: #1d4ed8;
    font-weight: 800;
    font-size: 0.82rem;
}

.notes-rx-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px dashed rgba(148, 163, 184, 0.34);
    text-align: center;
}

.notes-rx-empty-icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 1.8rem;
}

.notes-rx-active-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.3rem;
}

.notes-rx-active-side {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notes-rx-mini-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 800;
}

.notes-rx-workspace {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1.1rem;
}

.notes-rx-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notes-rx-panel {
    padding: 1.1rem;
    border-radius: 22px;
}

.notes-rx-panel-dark {
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.22), transparent 38%),
        linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border-color: rgba(30, 41, 59, 0.7);
}

.notes-rx-panel-dark .notes-rx-panel-title,
.notes-rx-panel-dark .notes-rx-metric span,
.notes-rx-panel-dark .notes-rx-metric strong {
    color: #f8fafc;
}

.notes-rx-panel-title {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 900;
}

.notes-rx-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 0.95rem;
}

.notes-rx-metric {
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.notes-rx-metric span {
    display: block;
    margin-bottom: 0.32rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notes-rx-metric strong {
    display: block;
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 900;
}

.notes-rx-chip {
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 800;
}

.notes-rx-field-block {
    display: grid;
    gap: 0.45rem;
}

.notes-rx-mainboard {
    padding: 1.2rem;
}

.notes-rx-inline-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.notes-rx-inline-meta span {
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
}

.notes-rx-table-shell {
    margin-top: 1rem;
    border-radius: 20px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.notes-rx-table {
    min-width: 720px;
}

.notes-rx-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f172a;
    color: #ffffff;
    border: 0;
    padding: 0.95rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.notes-rx-table tbody td {
    padding: 0.95rem 0.85rem;
    border-color: rgba(148, 163, 184, 0.18);
    vertical-align: middle;
}

.notes-rx-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.72);
}

.notes-rx-order {
    width: 56px;
    text-align: center;
    font-weight: 900;
    color: #1e293b;
}

.notes-rx-student-name {
    min-width: 260px;
    color: #0f172a;
    font-weight: 700;
    text-transform: uppercase;
}

.notes-rx-average {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    min-height: 38px;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    border: 1px solid rgba(37, 99, 235, 0.18);
    font-size: 0.9rem;
    font-weight: 900;
}

.notes-rx-grade {
    min-width: 72px;
    height: 42px;
    border-radius: 12px !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    background: #ffffff !important;
    box-shadow: none !important;
    font-weight: 800 !important;
}

.notes-rx-actions-panel .notes-rx-primary-btn,
.notes-rx-actions-panel .notes-rx-soft-btn,
.notes-rx-actions-panel .notes-rx-ghost-btn {
    width: 100%;
}

.notes-rx-print-sheet {
    display: none;
}

.notes-rx-print-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.65rem;
}

.notes-rx-print-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.notes-rx-print-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 0.25rem;
    color: #475569;
    font-size: 0.76rem;
}

.notes-rx-print-table {
    width: 100%;
    border-collapse: collapse;
}

.notes-rx-print-table th,
.notes-rx-print-table td {
    border: 1px solid #94a3b8;
    padding: 0.2rem 0.25rem;
    font-size: 0.68rem;
    color: #0f172a;
}

.notes-rx-print-table th {
    background: #e2e8f0;
    text-transform: uppercase;
    font-weight: 800;
}

.theme-dark .notes-rx-launcher,
.theme-dark .notes-rx-library,
.theme-dark .notes-rx-active-head,
.theme-dark .notes-rx-panel,
.theme-dark .notes-rx-mainboard {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.42) !important;
}

.theme-dark .notes-rx-title,
.theme-dark .notes-rx-section-head h3,
.theme-dark .notes-rx-sheet-head h3,
.theme-dark .notes-rx-active-main h3,
.theme-dark .notes-rx-panel-title,
.theme-dark .notes-rx-book-top strong,
.theme-dark .notes-rx-student-name,
.theme-dark .notes-rx-metric strong {
    color: #f8fafc !important;
}

.theme-dark .notes-rx-subtitle,
.theme-dark .notes-rx-section-head p,
.theme-dark .notes-rx-sheet-head p,
.theme-dark .notes-rx-active-main p,
.theme-dark .notes-rx-panel-copy,
.theme-dark .notes-rx-book-top span,
.theme-dark .notes-rx-book-meta,
.theme-dark .notes-rx-field label,
.theme-dark .notes-rx-field-block label {
    color: #94a3b8 !important;
}

.theme-dark .notes-rx-book-card,
.theme-dark .notes-rx-mini-brand,
.theme-dark .notes-rx-inline-meta span,
.theme-dark .notes-rx-empty-state {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    border-color: rgba(71, 85, 105, 0.26) !important;
    color: #e2e8f0 !important;
}

.theme-dark .notes-rx-book-link,
.theme-dark .notes-rx-section-kicker,
.theme-dark .notes-rx-chip,
.theme-dark .notes-rx-inline-meta span {
    color: #93c5fd !important;
}

.theme-dark .notes-rx-control,
.theme-dark .notes-rx-grade {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(71, 85, 105, 0.32) !important;
    color: #f8fafc !important;
}

.theme-dark .notes-rx-soft-btn,
.theme-dark .notes-rx-ghost-btn {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
    color: #f8fafc !important;
}

.theme-dark .notes-rx-table-shell {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%) !important;
    border-color: rgba(71, 85, 105, 0.28) !important;
}

.theme-dark .notes-rx-table tbody tr > * {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #e2e8f0 !important;
    border-color: rgba(71, 85, 105, 0.24) !important;
}

.theme-dark .notes-rx-table tbody tr:nth-child(even) > * {
    background: rgba(30, 41, 59, 0.82) !important;
}

@media (max-width: 1199.98px) {
    .notes-rx-workspace {
        grid-template-columns: 1fr;
    }

    .notes-rx-sidebar {
        order: 2;
    }
}

@media (max-width: 991.98px) {
    .notes-rx-hero {
        grid-template-columns: 1fr;
    }

    .notes-rx-hero-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notes-rx-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notes-rx-field,
    .notes-rx-field-wide,
    .notes-rx-field-small,
    .notes-rx-field-inline,
    .notes-rx-submit {
        grid-column: span 1;
    }

    .notes-rx-active-head,
    .notes-rx-section-head,
    .notes-rx-panel-head,
    .notes-rx-sheet-head {
        flex-direction: column;
        align-items: stretch;
    }

    .notes-rx-inline-meta {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .notes-rx-view {
        gap: 1rem;
    }

    .notes-rx-hero,
    .notes-rx-launcher,
    .notes-rx-library,
    .notes-rx-active-head,
    .notes-rx-panel,
    .notes-rx-mainboard {
        padding: 1rem;
        border-radius: 20px;
    }

    .notes-rx-hero-side,
    .notes-rx-form-grid,
    .notes-rx-metric-grid {
        grid-template-columns: 1fr;
    }

    .notes-rx-split {
        grid-template-columns: 1fr;
    }

    .notes-rx-active-side {
        flex-direction: column;
        align-items: stretch;
    }

    .notes-rx-ghost-btn,
    .notes-rx-primary-btn,
    .notes-rx-soft-btn {
        width: 100%;
    }
}

@media print {
    body.view-notas .d-print-block {
        display: none !important;
    }

    .notes-rx-hero,
    .notes-rx-launcher,
    .notes-rx-library,
    .notes-rx-active-head,
    .notes-rx-sidebar,
    .notes-rx-sheet-head,
    .no-print {
        display: none !important;
    }

    .notes-rx-mainboard {
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    .notes-rx-table-shell {
        display: none !important;
    }

    .notes-rx-print-head {
        display: none !important;
    }

    .notes-rx-print-table {
        margin-top: 0 !important;
    }

    .notes-rx-print-table th,
    .notes-rx-print-table td {
        font-size: 0.66rem !important;
        padding: 0.16rem 0.2rem !important;
    }

    .notes-rx-print-sheet {
        display: block !important;
    }
}
