/* Schedule Calendar */
.schedule-calendar {
    overflow-x: auto;
}

.schedule-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
    background: var(--gray-200);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.schedule-header .schedule-time {
    background: var(--gray-300);
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
}

.schedule-header .schedule-day {
    background: var(--primary-color);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

.schedule-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--gray-200);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.schedule-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
}

.schedule-row .schedule-time {
    background: var(--gray-100);
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-row .schedule-cell {
    background: white;
    min-height: 60px;
    padding: 4px;
    position: relative;
}

.schedule-item {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.schedule-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.schedule-subject {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-time-range {
    font-size: 10px;
    opacity: 0.9;
    margin-bottom: 2px;
}

.schedule-room {
    font-size: 10px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.schedule-staff {
    font-size: 10px;
    opacity: 0.8;
}

/* Filters Section */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--gray-100);
    border-radius: 8px;
}

.filters .form-group {
    flex: 1;
    min-width: 150px;
}

.filters .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--gray-700);
}

.filters .form-group select,
.filters .form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

.filters .form-group select:focus,
.filters .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters .btn {
    height: 38px;
    margin-top: 0;
}

.students-branch-filter-badge {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 100%;
}

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

:root {
    --primary-color: #5b8def;
    --secondary-color: #83a8f5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white: #ffffff;
    --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;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: var(--white);
}

.login-header h1 {
    color: var(--gray-800);
    font-size: 28px;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--gray-700);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}

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

.form-group small {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    margin-top: 5px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

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

.btn-link {
    background: transparent;
    color: var(--primary-color);
    padding: 8px 16px;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 20px;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.sidebar-header .logo i {
    font-size: 32px;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-nav-group {
    margin-bottom: 18px;
}

.sidebar-nav-group.is-first {
    margin-top: 0;
}

.sidebar-nav-label {
    padding: 0 16px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gray-400, #9ca3af);
}

.sidebar-nav-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-color);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
    background: var(--white);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}

.sidebar-footer .btn {
    width: 100%;
}

body.has-demo-banner .sidebar {
    top: 52px;
    height: calc(100vh - 52px);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.main-header h1 {
    font-size: 32px;
    color: var(--gray-800);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.user-menu .avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
}

.user-menu .info {
    display: flex;
    flex-direction: column;
}

.user-menu .info .name {
    font-weight: 600;
    color: var(--gray-800);
}

.user-menu .info .role {
    font-size: 12px;
    color: var(--gray-500);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 32px 16px;
    box-sizing: border-box;
}

.modal-content {
    background-color: var(--white);
    margin: 0 auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 760px;
    max-height: calc(100vh - 64px);
    box-shadow: var(--shadow);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--gray-800);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
    align-items: start;
}

.modal-form-grid .form-group {
    margin-bottom: 0;
}

.modal-form-grid .form-group-full,
.modal-form-grid .px-photo-upload,
.modal-form-grid .px-modal-footer-btns,
.modal-form-grid > button[type="submit"],
.modal-form-grid > .btn-primary,
.modal-form-grid > .btn-block {
    grid-column: 1 / -1;
}

.modal-form-grid .px-modal-footer-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding-top: 16px;
}

@media (max-width: 640px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;
    color: var(--gray-800);
}

.card-body {
    color: var(--gray-600);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

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

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-card .icon.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.stat-card .icon.success {
    background: var(--success-color);
}

.stat-card .icon.danger {
    background: var(--danger-color);
}

.stat-card .icon.warning {
    background: var(--warning-color);
}

.stat-card .info {
    flex: 1;
}

.stat-card .info .label {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 4px;
}

.stat-card .info .value {
    color: var(--gray-800);
    font-size: 28px;
    font-weight: bold;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

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

.table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
}

.table tr:hover {
    background: var(--gray-100);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #059669;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-info {
    background: #dbeafe;
    color: #2563eb;
}

.badge-primary {
    background: #e0e7ff;
    color: #4338ca;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Landing Page */
.landing-page {
    background: var(--white);
}

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 100px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    margin-bottom: 32px;
    opacity: 0.9;
}

.hero .btn {
    background: var(--white);
    color: var(--primary-color);
    padding: 16px 32px;
    font-size: 18px;
}

.hero .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.features {
    padding: 80px 20px;
    background: var(--gray-100);
}

.features h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 48px;
    color: var(--gray-800);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-card .icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: var(--white);
}

.feature-card h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.feature-card p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar .logo i {
    font-size: 32px;
}

.navbar .nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.navbar .nav-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar .nav-links a:hover {
    color: var(--primary-color);
}

.navbar .nav-actions {
    display: flex;
    gap: 12px;
}

/* Footer */
.footer {
    background: var(--gray-800);
    color: var(--white);
    padding: 48px 24px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.footer-section h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    max-width: 1200px;
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--gray-700);
    text-align: center;
    color: var(--gray-400);
}
