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

:root {
    --primary-color: #20b0a4;
    --primary-dark: #0f766e;
    --secondary-color: #5f6b7a;
    --accent-color: #5eead4;
    --bg-color: #f2fbfa;
    --surface-color: #ffffff;
    --text-primary: #16323f;
    --text-secondary: #5f6b7a;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --border-color: #d6efeb;
    --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);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* === UTILITIES === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

/* === LOGIN / LANDING PAGE === */
.login-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    background: rgba(32, 176, 164, 0.08);
    /* Light teal background */
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.login-header {
    background-color: var(--primary-color);
    /* Primary theme color */
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-icon-circle {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
}

.login-body {
    padding: 2rem;
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #4b5563;
    /* Gray-600 */
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    /* Gray-300 */
    border-radius: 4px;
    font-size: 0.95rem;
    color: #1f2937;
    background: white;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-color);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(32, 176, 164, 0.2);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.btn-success {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    transition: background-color 0.2s;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}

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

.portal-quick-link {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.portal-quick-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.portal-quick-btn {
    width: 100%;
    gap: 0.45rem;
    font-weight: 600;
    background: #f6fdfc;
    border-color: #b9e8e3;
}

.portal-quick-btn:hover {
    background: #ecfbf8;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #4b5563;
}

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

.login-footer a:hover {
    text-decoration: underline;
}

/* === DASHBOARD LAYOUT === */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #115e59 0%, #0b3f3b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: var(--transition);
    z-index: 100;
    color: rgba(255, 255, 255, 0.88);
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2.5rem;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
}

.nav-links {
    flex: 1;
    overflow-y: auto;
    margin: 0 -0.5rem 1rem 0;
    padding-right: 0.5rem;
}

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

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.76);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-dropdown {
    margin-bottom: 0.5rem;
}

.nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    border: 0;
    background: transparent;
    text-align: left;
}

.nav-dropdown-toggle .nav-item-main {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-dropdown-toggle .dropdown-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    margin-top: 0.35rem;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-dropdown.open .nav-submenu {
    display: block;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.35rem;
    transition: var(--transition);
    font-size: 0.92rem;
}

.nav-subitem:hover,
.nav-subitem.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-subitem svg {
    width: 16px;
    height: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    margin-top: auto;
    background: transparent;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding-left: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5eead4 0%, #14b8a6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info h4 {
    font-size: 0.9rem;
    color: #ffffff;
}

.user-info p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.68);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: linear-gradient(180deg, #f7fffe 0%, #edf9f7 100%);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1001;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #164e52;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--surface-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: transparent;
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-left: 0;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.notification-bell:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--surface-color);
}

/* === NOTIFICATIONS === */
.notif-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    margin-top: 0.75rem;
    display: none;
    /* Hidden by default */
    max-height: 480px;
    overflow: hidden;
    flex-direction: column;
}

.notif-list {
    overflow-y: auto;
    flex: 1;
}

/* Custom Scrollbar */
.notif-list::-webkit-scrollbar {
    width: 6px;
}

.notif-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notif-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.notif-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.notif-panel.active {
    display: flex;
    animation: fadeInDown 0.2s ease-out;
}

.notif-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.notif-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.clear-notif {
    font-size: 0.75rem;
    color: var(--primary-color);
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 500;
}

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

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    transition: var(--transition);
}

.notif-item:hover {
    background-color: #f1f5f9;
}

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

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
}

.notif-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    display: block;
}

.notif-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.4rem;
    display: block;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* === STATS CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #20b0a4 0%, #14b8a6 100%);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-trend {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up {
    color: var(--success-color);
}

.trend-down {
    color: var(--danger-color);
}

.card-icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(32, 176, 164, 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

/* === RECENT ACTIVITY TABLE === */
.table-container {
    background: var(--surface-color);
    padding: 0;
    /* Changed to 0 so the table can touch edges if needed */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: thin;
}

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

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

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

.table-title {
    font-size: 1.25rem;
    font-weight: 700;
}

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

thead th {
    text-align: left;
    padding: 1rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: normal;
    overflow-wrap: anywhere;
    background: #fcfdfe;
}

tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

tbody tr:hover {
    background-color: #f8fafc;
}

/* Specific Column Widths for Student Table */
#studentsTable th:nth-child(1) {
    min-width: 90px;
}

/* Roll No */
#studentsTable th:nth-child(2) {
    min-width: 110px;
}

/* Name */
#studentsTable th:nth-child(3) {
    min-width: 190px;
}

/* Father Name */
#studentsTable th:nth-child(4) {
    min-width: 150px;
}

/* Class */
#studentsTable th:nth-child(5) {
    min-width: 90px;
}

/* Campus */
#studentsTable th:nth-child(6) {
    min-width: 120px;
}

/* Gender */
#studentsTable th:nth-child(7) {
    min-width: 90px;
}

/* Gender */
#studentsTable th:nth-child(8) {
    min-width: 90px;
}

#studentsTable th:nth-child(9) {
    min-width: 110px;
    text-align: center;
}

#studentsTable th:nth-child(10) {
    min-width: 120px;
    text-align: center;
}

#studentsTable td:nth-child(9) {
    text-align: center;
}

#studentsTable td:nth-child(10) {
    text-align: center;
    white-space: normal;
    border-bottom: 1px solid var(--border-color);
}

/* Teachers and Staff Table widths */
#teachersTable th:nth-child(1) {
    min-width: 180px;
}

#teachersTable th:nth-child(2) {
    min-width: 150px;
}

#teachersTable th:nth-child(3) {
    min-width: 120px;
}

#teachersTable th:nth-child(4) {
    min-width: 100px;
}

#teachersTable th:nth-child(5) {
    min-width: 220px;
}

#teachersTable th:nth-child(6) {
    min-width: 150px;
}

#teachersTable th:nth-child(7) {
    min-width: 190px;
}

#teachersTable th:nth-child(8) {
    min-width: 110px;
    text-align: center;
}

#teachersTable th:nth-child(9) {
    min-width: 130px;
}

#teachersTable th:nth-child(10) {
    min-width: 150px;
}

#teachersTable td:nth-child(5) {
    min-width: 220px;
}

#teachersTable td:nth-child(6) {
    min-width: 150px;
}

#teachersTable td:nth-child(7) {
    min-width: 190px;
}

#teachersTable td:nth-child(8) {
    text-align: center;
}

#teachersTable td:nth-child(11) {
    text-align: center;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
}

#staffTable th:nth-child(1) {
    min-width: 180px;
}

#staffTable th:nth-child(2) {
    min-width: 150px;
}

#staffTable th:nth-child(3) {
    width: 130px;
}

#staffTable th:nth-child(4) {
    min-width: 220px;
}

#staffTable th:nth-child(5) {
    min-width: 140px;
}

#staffTable th:nth-child(6) {
    width: 130px;
}

#staffTable th:nth-child(7) {
    width: 130px;
}

#staffTable th:nth-child(8) {
    width: 160px;
}

#staffTable th:nth-child(9) {
    min-width: 190px;
}

#staffTable th:nth-child(10) {
    width: 130px;
    text-align: center;
}

#staffTable th:nth-child(11) {
    width: 160px;
    text-align: center;
}

#staffTable td:nth-child(4) {
    min-width: 220px;
}

#staffTable td:nth-child(5) {
    min-width: 140px;
}

#staffTable td:nth-child(8) {
    min-width: 160px;
}

#staffTable td:nth-child(9) {
    min-width: 190px;
}

#staffTable td:nth-child(10) {
    text-align: center;
    white-space: nowrap;
}

#staffTable td:nth-child(11) {
    text-align: center;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.staff-login-details {
    line-height: 1.5;
    font-size: 0.85rem;
}

.staff-login-details strong {
    color: var(--text-primary);
}

.table-detail-stack {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    line-height: 1.35;
}

.table-detail-stack strong {
    color: var(--text-primary);
}

.doc-badge-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #075985;
}

.doc-badge.muted {
    background: #f1f5f9;
    color: #64748b;
}

.doc-download-btn {
    border: 1px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.doc-download-btn:hover {
    transform: translateY(-1px);
    border-color: #93c5fd;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.14);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-paid {
    background-color: #d1fae5;
    color: #059669;
}

.status-pending {
    background-color: #fef3c7;
    color: #d97706;
}

.status-failed {
    background-color: #fee2e2;
    color: #dc2626;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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


/* === MODAL STYLES === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.attendance-day {
    aspect-ratio: 1;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-present {
    background: #dcfce7;
    color: #166534;
}

.status-late {
    background: #fef3c7;
    color: #92400e;
}

.status-absent {
    background: #fee2e2;
    color: #991b1b;
}

.btn-view {
    background: #d1fae5;
    color: #059669;
}

.btn-view:hover {
    background: #a7f3d0;
}

/* === MULTI-ACTION FORM STYLES === */
.action-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border-color);
}

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

.action-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border-color);
    grid-column: 1 / -1;
    /* Span full width */
}

.step-panel {
    grid-column: 1 / -1;
    /* Span full width */
    display: none;
    margin-top: 1.5rem;
    padding: 2rem;
    background: #fcfdfe;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    animation: slideUp 0.3s ease;
}

.action-step-btn {
    height: 54px;
    /* Matching standard input height */
    padding: 0 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    text-align: center;
    position: relative;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.action-step-btn i {
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.action-step-btn span {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

/* Hover state matching input glow */
.action-step-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(32, 176, 164, 0.1);
}

/* Active state - Styled like an active input field */
.action-step-btn.active {
    border-color: var(--primary-color);
    background: rgba(32, 176, 164, 0.03);
    box-shadow: 0 0 0 4px rgba(32, 176, 164, 0.15);
}

.action-step-btn.active i,
.action-step-btn.active span {
    color: var(--primary-color);
}

/* Primary Action Button */
.action-step-btn.btn-save-activate {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.action-step-btn.btn-save-activate i,
.action-step-btn.btn-save-activate span {
    color: white;
}

.action-step-btn.btn-save-activate:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(32, 176, 164, 0.25);
    transform: translateY(-1px);
}

.action-step-btn.btn-save-activate:active {
    transform: translateY(0);
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.step-panel.active {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

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

.credential-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e2e8f0;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* App Popup */
.app-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(5px);
}

.app-popup-overlay.active {
    display: flex;
}

.app-popup-modal {
    width: min(92vw, 430px);
    background: #fff;
    border: 1px solid rgba(214, 239, 235, 0.95);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    padding: 1.6rem;
    text-align: center;
    animation: appPopupIn 0.22s ease-out;
}

.app-popup-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 176, 164, 0.12);
    color: var(--primary-dark);
}

.app-popup-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 800;
}

.app-popup-message {
    margin: 0.65rem 0 1.4rem;
    color: var(--text-secondary);
    line-height: 1.55;
    white-space: pre-wrap;
}

.app-popup-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.app-popup-button {
    min-width: 108px;
    border: 0;
    border-radius: 8px;
    padding: 0.78rem 1.15rem;
    background: var(--primary-color);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(32, 176, 164, 0.24);
}

.app-popup-button.secondary {
    background: #f8fafc;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.app-popup-button:hover {
    background: var(--primary-dark);
}

.app-popup-button.secondary:hover {
    background: #eef6f5;
    color: var(--primary-dark);
}

.app-popup-button:focus-visible {
    outline: 3px solid rgba(32, 176, 164, 0.28);
    outline-offset: 3px;
}

.nav-item.nav-item-danger {
    color: #b91c1c;
}

.nav-item.nav-item-danger:hover {
    background: #fee2e2;
    color: #991b1b;
}

@keyframes appPopupIn {
    from {
        transform: translateY(12px) scale(0.96);
        opacity: 0;
    }

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

/* Success Modal Styles */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.success-modal {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.edu-welcome-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background:
        radial-gradient(circle at 12% 15%, rgba(32, 176, 164, 0.34), rgba(32, 176, 164, 0) 55%),
        radial-gradient(circle at 88% 18%, rgba(59, 130, 246, 0.28), rgba(59, 130, 246, 0) 55%),
        radial-gradient(circle at 50% 100%, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0) 60%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.35));
    backdrop-filter: blur(6px);
    z-index: 10050;
}

.edu-welcome-overlay.active {
    display: flex;
    animation: eduWelcomeOverlayIn 220ms ease-out both;
}

.edu-welcome-overlay.closing {
    animation: eduWelcomeOverlayOut 220ms ease-in both;
}

.edu-welcome-card {
    width: min(460px, 100%);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.15rem;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
    position: relative;
    overflow: hidden;
    text-align: center;
    animation: eduWelcomeCardIn 520ms cubic-bezier(0.22, 1.18, 0.36, 1) both;
}

.edu-welcome-overlay.closing .edu-welcome-card {
    animation: eduWelcomeCardOut 240ms ease-in both;
}

.edu-welcome-card::before,
.edu-welcome-card::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    filter: blur(0);
    opacity: 0.55;
    pointer-events: none;
}

.edu-welcome-card::before {
    top: -130px;
    left: -90px;
    background: radial-gradient(circle at 30% 30%, rgba(32, 176, 164, 0.55), rgba(32, 176, 164, 0));
    animation: eduWelcomeBlob 2.8s ease-in-out infinite alternate;
}

.edu-welcome-card::after {
    bottom: -150px;
    right: -110px;
    background: radial-gradient(circle at 60% 40%, rgba(59, 130, 246, 0.55), rgba(59, 130, 246, 0));
    animation: eduWelcomeBlob 3.2s ease-in-out infinite alternate-reverse;
}

.edu-welcome-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 176, 164, 0.12);
    color: var(--primary-color);
    border: 1px solid rgba(32, 176, 164, 0.24);
    position: relative;
    animation: eduWelcomeIconPop 900ms ease-out both;
}

.edu-welcome-icon::before {
    content: "";
    position: absolute;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    border: 1px solid rgba(32, 176, 164, 0.25);
    box-shadow: 0 0 0 10px rgba(32, 176, 164, 0.08);
    opacity: 0;
    animation: eduWelcomeRing 1.4s ease-out infinite;
    pointer-events: none;
}

.edu-welcome-title {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .edu-welcome-title {
        background: linear-gradient(90deg, var(--primary-color), #3b82f6, var(--primary-color));
        background-size: 200% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: eduWelcomeTitleShine 2.4s ease-in-out infinite;
    }
}

.edu-welcome-subtitle {
    margin: 0.55rem auto 1.25rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    max-width: 40ch;
}

.edu-welcome-glow {
    position: absolute;
    inset: -2px;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 10%, rgba(32, 176, 164, 0.45), rgba(32, 176, 164, 0) 45%),
        radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.35), rgba(59, 130, 246, 0) 50%);
    opacity: 0;
    animation: eduWelcomeGlow 900ms ease-out both;
}

.edu-welcome-divider {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    position: relative;
    overflow: hidden;
}

.edu-welcome-divider::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, rgba(32, 176, 164, 0), rgba(32, 176, 164, 0.9), rgba(59, 130, 246, 0.9), rgba(59, 130, 246, 0));
    animation: eduWelcomeSweep 1000ms ease-out both;
}

.edu-welcome-skip {
    margin-top: 1rem;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: #ffffff;
    border-radius: 0.85rem;
    padding: 0.8rem 1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

.edu-welcome-skip:hover {
    background: #f1f5f9;
}

@keyframes eduWelcomeOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes eduWelcomeOverlayOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes eduWelcomeTitleShine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes eduWelcomeGlow {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }

    60% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0.85;
        transform: scale(1);
    }
}

@keyframes eduWelcomeSweep {
    0% {
        left: -40%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        left: 110%;
        opacity: 0;
    }
}

@keyframes eduWelcomeCardIn {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes eduWelcomeCardOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

@keyframes eduWelcomeIconPop {
    0% {
        transform: scale(0.82);
        opacity: 0;
    }

    55% {
        transform: scale(1.08);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes eduWelcomeRing {
    0% {
        transform: scale(0.86);
        opacity: 0;
    }

    30% {
        opacity: 0.65;
    }

    100% {
        transform: scale(1.12);
        opacity: 0;
    }
}

@keyframes eduWelcomeBlob {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(18px, 12px, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .edu-welcome-overlay.active,
    .edu-welcome-card,
    .edu-welcome-icon,
    .edu-welcome-divider::after,
    .edu-welcome-glow,
    .edu-welcome-title {
        animation: none !important;
    }
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon-wrap i {
    font-size: 2.5rem;
}

/* Modal for Role Based Login */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* === RESPONSIVE SYSTEM LAYER === */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 0;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.main-content,
.table-container,
.card,
.modal-content,
.form-container,
.step-panel {
    min-width: 0;
}

.table-container {
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    min-width: max-content;
}

.header,
.toolbar,
.table-header,
.form-actions,
.header-actions {
    flex-wrap: wrap;
}

@media (max-width: 1180px) {
    .dashboard-container {
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    .sidebar {
        width: 230px;
        padding: 1.15rem;
    }

    .main-content {
        padding: 1.35rem;
    }

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

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

@media (max-width: 900px) {
    body {
        height: auto !important;
        min-height: 100dvh;
        overflow-x: hidden;
    }

    .dashboard-container {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    .sidebar {
        position: sticky;
        top: 0;
        width: 100% !important;
        max-height: none;
        padding: 0.75rem;
        z-index: 3000;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .logo-section {
        margin-bottom: 0.65rem;
        font-size: 1rem;
        line-height: 1.25;
    }

    .nav-links {
        flex: none !important;
        display: flex;
        gap: 0.5rem;
        margin: 0;
        padding: 0 0 0.15rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
    }

    .nav-item,
    .nav-subitem {
        flex: 0 0 auto;
        min-height: 42px;
        margin: 0;
        padding: 0.65rem 0.8rem;
        white-space: nowrap;
        border-radius: 8px;
    }

    .nav-dropdown {
        flex: 0 0 auto;
        margin: 0;
    }

    .nav-dropdown-toggle {
        width: auto;
    }

    .nav-submenu {
        position: absolute;
        margin: 0.35rem 0 0;
        padding: 0.4rem;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 8px;
        background: #0b3f3b;
        box-shadow: var(--shadow-lg);
    }

    .user-profile {
        display: none !important;
    }

    .main-content {
        width: 100%;
        padding: 1rem !important;
        overflow: visible !important;
    }

    .header {
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .header h1 {
        font-size: 1.35rem;
        line-height: 1.25;
    }

    .header-actions {
        width: 100%;
        gap: 0.75rem;
        justify-content: flex-start;
    }

    .search-bar {
        max-width: none;
        min-width: 0;
        flex: 1 1 240px;
    }

    .notification-panel,
    .notif-panel {
        position: fixed !important;
        top: 5.25rem !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        max-width: none !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.85rem;
    }

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

    .card-value {
        font-size: 1.45rem;
    }

    .card-icon {
        width: 38px;
        height: 38px;
        right: 1rem;
        top: 1rem;
    }

    .table-header,
    .toolbar {
        gap: 0.75rem;
        align-items: stretch;
    }

    .table-header > *,
    .toolbar > * {
        min-width: 0;
    }

    .form-grid,
    .action-steps {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
        gap: 0.9rem !important;
    }

    .step-panel {
        padding: 1rem;
    }

    .form-actions {
        gap: 0.75rem;
    }

    .modal-content,
    .login-modal-content {
        width: min(94vw, 640px) !important;
        max-height: 86dvh;
        padding: 1.25rem;
        border-radius: 8px;
    }

    .attendance-grid {
        gap: 0.35rem;
    }

    .attendance-day {
        min-height: 42px;
        font-size: 0.76rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 0.85rem;
    }

    .login-layout {
        min-height: 100dvh;
        height: auto;
        padding: 1rem;
    }

    .login-card {
        max-width: none;
    }

    .login-header {
        padding: 1.5rem 1rem;
    }

    .login-body {
        padding: 1.25rem;
    }

    .main-content {
        padding: 0.85rem !important;
    }

    .logo-section {
        font-size: 0.95rem;
    }

    .nav-item span,
    .nav-subitem span {
        font-size: 0.86rem;
    }

    .header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .header-actions,
    .search-bar {
        width: 100%;
    }

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

    .card {
        min-height: 112px;
    }

    .table-container {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        border-radius: 8px;
    }

    thead th,
    tbody td {
        padding: 0.75rem 0.85rem;
        font-size: 0.82rem;
    }

    .form-grid,
    .action-steps {
        grid-template-columns: 1fr !important;
    }

    .form-actions {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .form-actions .btn,
    .toolbar .btn,
    .btn.full-mobile {
        width: 100%;
    }

    .btn {
        min-height: 42px;
        padding: 0.68rem 1rem;
    }

    .action-step-btn {
        height: auto;
        min-height: 48px;
        padding: 0.75rem 1rem;
    }

    .modal-overlay,
    .login-modal,
    .success-overlay {
        align-items: flex-start;
        padding: 0.8rem;
        overflow-y: auto;
    }

    .modal-content,
    .success-modal,
    .login-modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: none;
        margin: auto 0;
        padding: 1rem;
    }

    .app-popup-overlay {
        align-items: flex-end;
        padding: 0.8rem;
    }

    .app-popup-modal {
        width: 100%;
        padding: 1.15rem;
    }

    .app-popup-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .app-popup-button {
        width: 100%;
    }

    .attendance-grid {
        grid-template-columns: repeat(7, minmax(36px, 1fr));
        overflow-x: auto;
    }
}

@media (max-width: 420px) {
    .main-content {
        padding: 0.65rem !important;
    }

    .sidebar {
        padding: 0.65rem;
    }

    .nav-item,
    .nav-subitem {
        padding: 0.58rem 0.7rem;
    }

    .card {
        padding: 0.9rem;
    }

    .card-title,
    .card-trend {
        font-size: 0.78rem;
    }

    .card-value {
        font-size: 1.28rem;
    }

    .card-icon {
        width: 34px;
        height: 34px;
    }
}

/* === Responsive Table Fit (Global) === */
.table-container {
    width: 100%;
    overflow-x: hidden !important;
}

.table-container table {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: fixed;
}

.table-container thead th,
.table-container tbody td {
    min-width: 0 !important;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Keep action cells usable without forcing full table overflow */
#studentsTable td:nth-child(10),
#teachersTable td:nth-child(11),
#staffTable td:nth-child(11) {
    white-space: normal !important;
}

.table-action-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.table-action-select {
    width: 92px;
    max-width: 100%;
    padding: 0.42rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.55rem;
    background: #f8fafc;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
}

.table-action-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(32, 176, 164, 0.16);
}

/* Student table readability fix: keep name/father columns from collapsing */
#studentsTable {
    table-layout: auto !important;
}

#studentsTable th,
#studentsTable td {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    padding: 0.72rem 0.65rem !important;
}

#studentsTable th {
    white-space: normal !important;
    line-height: 1.2;
}

#studentsTable td {
    font-size: 0.86rem;
}

#studentsTable th:nth-child(1),
#studentsTable td:nth-child(1) {
    min-width: 78px !important;
}

#studentsTable th:nth-child(2),
#studentsTable td:nth-child(2) {
    min-width: 82px !important;
}

#studentsTable th:nth-child(3),
#studentsTable td:nth-child(3) {
    min-width: 150px !important;
}

#studentsTable th:nth-child(4),
#studentsTable td:nth-child(4) {
    min-width: 130px !important;
}

#studentsTable th:nth-child(5),
#studentsTable td:nth-child(5) {
    min-width: 68px !important;
}

#studentsTable th:nth-child(6),
#studentsTable td:nth-child(6) {
    min-width: 82px !important;
}

#studentsTable th:nth-child(7),
#studentsTable td:nth-child(7) {
    min-width: 72px !important;
}

#studentsTable th:nth-child(8),
#studentsTable td:nth-child(8) {
    min-width: 72px !important;
}

#studentsTable th:nth-child(9),
#studentsTable td:nth-child(9) {
    min-width: 82px !important;
}

#studentsTable th:nth-child(10),
#studentsTable td:nth-child(10) {
    min-width: 92px !important;
}

/* Teachers table responsiveness and width tuning */
#teachersTable th,
#teachersTable td {
    padding: 0.66rem 0.5rem !important;
}

#teachersTable th {
    white-space: normal !important;
    line-height: 1.2;
}

#teachersTable td {
    font-size: 0.8rem;
}

#teachersTable th:nth-child(1),
#teachersTable td:nth-child(1) {
    min-width: 104px !important;
}

#teachersTable th:nth-child(2),
#teachersTable td:nth-child(2) {
    min-width: 92px !important;
}

#teachersTable th:nth-child(3),
#teachersTable td:nth-child(3) {
    min-width: 72px !important;
}

#teachersTable th:nth-child(4),
#teachersTable td:nth-child(4) {
    min-width: 74px !important;
}

#teachersTable th:nth-child(5),
#teachersTable td:nth-child(5) {
    min-width: 96px !important;
}

#teachersTable th:nth-child(6),
#teachersTable td:nth-child(6) {
    min-width: 90px !important;
}

#teachersTable th:nth-child(7),
#teachersTable td:nth-child(7) {
    min-width: 96px !important;
}

#teachersTable th:nth-child(8),
#teachersTable td:nth-child(8) {
    min-width: 92px !important;
}

#teachersTable th:nth-child(9),
#teachersTable td:nth-child(9) {
    min-width: 80px !important;
}

#teachersTable th:nth-child(10),
#teachersTable td:nth-child(10) {
    min-width: 84px !important;
}

#teachersTable th:nth-child(11),
#teachersTable td:nth-child(11) {
    min-width: 106px !important;
}

@media (max-width: 1200px) {
    #teachersTable th,
    #teachersTable td {
        padding: 0.58rem 0.44rem !important;
        font-size: 0.74rem;
    }

    #teachersTable th:nth-child(1),
    #teachersTable td:nth-child(1) {
        min-width: 94px !important;
    }

    #teachersTable th:nth-child(5),
    #teachersTable td:nth-child(5),
    #teachersTable th:nth-child(6),
    #teachersTable td:nth-child(6),
    #teachersTable th:nth-child(7),
    #teachersTable td:nth-child(7),
    #teachersTable th:nth-child(8),
    #teachersTable td:nth-child(8) {
        min-width: 88px !important;
    }

    #teachersTable th:nth-child(10),
    #teachersTable td:nth-child(10) {
        min-width: 76px !important;
    }

    #teachersTable th:nth-child(11),
    #teachersTable td:nth-child(11) {
        min-width: 96px !important;
    }
}

@media (max-width: 1100px) {
    #studentsTable th,
    #studentsTable td {
        font-size: 0.8rem;
        padding: 0.62rem 0.55rem !important;
    }

    #studentsTable th:nth-child(3),
    #studentsTable td:nth-child(3) {
        min-width: 130px !important;
    }

    #studentsTable th:nth-child(4),
    #studentsTable td:nth-child(4) {
        min-width: 118px !important;
    }

    #studentsTable th:nth-child(10),
    #studentsTable td:nth-child(10) {
        min-width: 88px !important;
    }

    #teachersTable th,
    #teachersTable td {
        font-size: 0.72rem;
        padding: 0.5rem 0.38rem !important;
    }

    #teachersTable th:nth-child(1),
    #teachersTable td:nth-child(1) {
        min-width: 88px !important;
    }

    #teachersTable th:nth-child(2),
    #teachersTable td:nth-child(2) {
        min-width: 82px !important;
    }

    #teachersTable th:nth-child(5),
    #teachersTable td:nth-child(5),
    #teachersTable th:nth-child(6),
    #teachersTable td:nth-child(6),
    #teachersTable th:nth-child(7),
    #teachersTable td:nth-child(7),
    #teachersTable th:nth-child(8),
    #teachersTable td:nth-child(8) {
        min-width: 82px !important;
    }

    #teachersTable th:nth-child(11),
    #teachersTable td:nth-child(11) {
        min-width: 88px !important;
    }
}

/* Teacher/Staff readability fix: avoid letter-by-letter wrapping */
#teachersTable,
#staffTable {
    table-layout: auto !important;
}

#teachersTable th,
#teachersTable td,
#staffTable th,
#staffTable td {
    word-break: normal !important;
    overflow-wrap: break-word !important;
}
