
/* ===== BASE STYLES ===== */
:root {
    --primary-color: #1a3c6a;
    --secondary-color: #2e7d32;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark-text);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    color: #0d47a1;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0d47a1;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background: linear-gradient(180deg, #1a3c6a 0%, #0d47a1 100%);
    min-height: 100vh;
    width: 250px;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar .sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar .sidebar-header h4 {
    color: #fff;
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.sidebar .sidebar-header small {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
}

.sidebar .nav {
    padding: 10px 0;
}

.sidebar .nav-item {
    margin: 2px 8px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 500;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar .nav-link .badge {
    float: right;
    margin-top: 2px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: -250px !important;
        width: 250px !important;
        z-index: 1040 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        min-height: 100vh !important;
        transform: translateX(0) !important;
    }
    .sidebar.show {
        transform: translateX(250px) !important;
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1030;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 20px;
    background: #fff;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    background: var(--primary-color);
    color: #3e41a3;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

.card-header.bg-success {
    background: var(--success-color) !important;
}

.card-header.bg-danger {
    background: var(--danger-color) !important;
}

.card-header.bg-warning {
    background: var(--warning-color) !important;
}

.card-header.bg-info {
    background: var(--info-color) !important;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--light-bg);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 15px 20px;
}

/* ===== STATS CARDS ===== */
.stat-card {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    color: #fff;
    transition: var(--transition);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.stat-card .stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, #1a3c6a, #0d47a1);
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #2e7d32, #43a047);
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #f57c00, #fb8c00);
}

.stat-card.bg-danger {
    background: linear-gradient(135deg, #c62828, #e53935);
}

.stat-card.bg-info {
    background: linear-gradient(135deg, #00695c, #00897b);
}

/* ===== GRADIENT STAT CARDS ===== */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}
.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}
.bg-gradient-warning {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%) !important;
}
.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}
.bg-gradient-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
}
.bg-gradient-dark {
    background: linear-gradient(135deg, #0c0c1d 0%, #434371 100%) !important;
}

@media print {
    .sidebar, .btn, .btn-group, .sticky-top { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 10px !important; }
    .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd !important; }
    .bg-gradient-primary, .bg-gradient-success, .bg-gradient-warning, .bg-gradient-info { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--light-bg);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(26, 60, 106, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0,0,0,0.02);
}

.table .badge {
    font-size: 12px;
    padding: 5px 10px;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    transition: var(--transition);
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(26, 60, 106, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-label {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--dark-text);
}

.form-text {
    font-size: 12px;
    color: #6c757d;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #0d47a1;
    border-color: #0d47a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 60, 106, 0.3);
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #e0a800;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info-color);
    border-color: var(--info-color);
}

.btn-info:hover {
    background: #138496;
    border-color: #138496;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 16px;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===== BADGES ===== */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    border-radius: 50px;
}

.badge-success {
    background: var(--success-color);
}

.badge-danger {
    background: var(--danger-color);
}

.badge-warning {
    background: var(--warning-color);
    color: #333;
}

.badge-info {
    background: var(--info-color);
}

/* ===== MODALS ===== */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 15px 20px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    max-width: 420px;
    margin: 50px auto;
}

.login-container .card {
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-container .card-header {
    text-align: center;
    padding: 25px 20px;
}

.login-container .card-header h4 {
    margin: 0;
    font-weight: 600;
}

.login-container .card-body {
    padding: 30px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .sidebar {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .card-header {
        background: #f8f9fa !important;
        color: #333 !important;
    }
    
    .btn {
        display: none !important;
    }
    
    .table thead th {
        background: #f8f9fa !important;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }
    .main-content {
        margin-left: 0;
    }
    .stat-card .stat-number {
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 10px;
    }
    .card-body {
        padding: 15px;
    }
    .table-responsive {
        font-size: 13px;
    }
    .btn {
        padding: 6px 15px;
        font-size: 13px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-in {
    animation: slideIn 0.3s ease-in;
}

/* ===== CUSTOM COMPONENTS ===== */
/* Dashboard Widgets */
.dashboard-widget {
    padding: 20px;
    border-radius: var(--border-radius);
    background: #fff;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dashboard-widget:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Profile Image */
.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: var(--shadow);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.spinner-overlay.show {
    display: flex;
}

/* ===== ADMIT CARD ===== */
.admit-card {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: #fff;
}

.admit-card .header {
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.admit-card .header h4 {
    color: var(--primary-color);
    margin: 0;
}

.admit-card .photo {
    float: right;
    width: 80px;
    height: 90px;
    border: 2px solid var(--dark-text);
    overflow: hidden;
}

.admit-card .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== RECEIPT ===== */
.receipt {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 2px solid var(--dark-text);
    background: #fff;
}

.receipt .header {
    text-align: center;
    border-bottom: 2px solid var(--dark-text);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.receipt .row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.receipt .label {
    font-weight: 600;
}

.receipt .amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===== ID CARD ===== */
.id-card {
    max-width: 350px;
    margin: 20px auto;
    padding: 15px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: #fff;
    position: relative;
    overflow: hidden;
}

.id-card .watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 60px;
    color: rgba(0,0,0,0.03);
    font-weight: 700;
    pointer-events: none;
}

.id-card .photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    overflow: hidden;
    margin: 0 auto 10px;
}

.id-card .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== HELP CENTER ===== */
.help-section {
    padding: 20px;
    border-radius: var(--border-radius);
    background: #fff;
    margin-bottom: 20px;
}

.help-section h5 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.help-section ul {
    padding-left: 20px;
}

.help-section ul li {
    margin-bottom: 8px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    min-width: 300px;
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}