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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
}

/* Login & Register Page */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 450px;
}

.auth-box h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.auth-box p.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    margin-top: 10px;
}

.btn-success { background: #27ae60; }
.btn-danger { background: #e74c3c; }
.btn-warning { background: #f39c12; }

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

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

.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo h2 {
    color: #3498db;
    font-size: 24px;
}

.logo p {
    color: #95a5a6;
    font-size: 14px;
    margin-bottom: 30px;
}

.user-info {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.user-info p {
    margin-bottom: 5px;
}

.menu {
    list-style: none;
}

.menu li {
    margin-bottom: 10px;
}

.menu a {
    display: block;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.menu a:hover,
.menu a.active {
    background: #3498db;
    color: white;
}

.menu a.logout {
    background: #e74c3c;
    margin-top: 30px;
}

.content {
    margin-left: 280px;
    padding: 40px;
    width: calc(100% - 280px);
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.card-header h3 {
    color: #2c3e50;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    border-left: 5px solid #3498db;
}

.stat-card.books { border-left-color: #3498db; }
.stat-card.students { border-left-color: #27ae60; }
.stat-card.borrowed { border-left-color: #f39c12; }
.stat-card.overdue { border-left-color: #e74c3c; }

.stat-card h4 {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.pending { background: #fff3cd; color: #856404; }
.status.approved { background: #d4edda; color: #155724; }
.status.rejected { background: #f8d7da; color: #721c24; }
.status.borrowed { background: #cce5ff; color: #004085; }
.status.returned { background: #d4edda; color: #155724; }
.status.overdue { background: #f8d7da; color: #721c24; }

/* Buttons Action */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    margin-right: 5px;
}

/* Search & Filter */
.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.search-bar input,
.search-bar select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.search-bar input { flex: 1; }
.search-bar button {
    width: auto;
    padding: 12px 25px;
}

/* Book Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-cover {
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 60px;
}

.book-info {
    padding: 20px;
}

.book-info h4 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.book-info p {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

/* 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: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .content {
        margin-left: 0;
        width: 100%;
    }
    
    .container {
        flex-direction: column;
    }
}