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

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

:root {
    --primary: #00a86b;
    --primary-dark: #008f5b;
    --primary-light: #00d9a5;
    --secondary: #1a1a2e;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --border: #e0e0e0;
    --success: #00a86b;
    --warning: #f39c12;
    --danger: #e74c3c;
    --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light-bg);
    min-height: 100vh;
    color: var(--text-dark);
}

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

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-weight: 600;
}

.login-box .logo {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.1);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 168, 107, 0.3);
}

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

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

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border);
}

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

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

.btn-danger:hover {
    background: #c0392b;
}

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

.sidebar {
    width: 280px;
    background: var(--white);
    padding: 25px 20px;
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar .logo {
    text-align: center;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 25px;
}

.sidebar .logo img {
    max-height: 50px;
}

.sidebar .logo h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

.sidebar .logo span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover {
    background: var(--light-bg);
    color: var(--primary);
}

.nav-menu a.active {
    background: var(--primary);
    color: var(--white);
}

.nav-menu a i {
    font-size: 1.2rem;
    width: 24px;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    background: var(--light-bg);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

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

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .icon.primary {
    background: rgba(0, 168, 107, 0.15);
    color: var(--primary);
}

.stat-card .icon.success {
    background: rgba(0, 168, 107, 0.15);
    color: var(--success);
}

.stat-card .icon.warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.stat-card .info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-card .info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tables */
.card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    padding: 25px;
}

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

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

.table th {
    background: var(--light-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table tr:hover {
    background: rgba(0, 168, 107, 0.03);
}

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

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(0, 168, 107, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 25px;
}

/* ID Card */
.id-card {
    width: 350px;
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    border: 2px solid var(--primary);
    margin: 20px auto;
    box-shadow: var(--card-shadow);
}

.id-card .header {
    text-align: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.id-card .header h2 {
    color: var(--primary);
    font-size: 1.3rem;
}

.id-card .photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    margin: 0 auto 15px;
    overflow: hidden;
}

.id-card .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.id-card .details {
    text-align: center;
}

.id-card .details h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.id-card .details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.id-card .student-id {
    background: var(--primary);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(0, 168, 107, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* Student Panel Specific */
.fee-history {
    display: grid;
    gap: 15px;
}

.fee-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--success);
}

.fee-item .month {
    font-weight: 600;
    color: var(--text-dark);
}

.fee-item .amount {
    color: var(--success);
    font-size: 1.2rem;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .id-card, .id-card * {
        visibility: visible;
    }
    
    .id-card {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}
