/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* ===== LAYOUT ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px;
    background-color: #2c2c2c;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    background-color: #1a1a1a;
    border-bottom: 1px solid #444;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.sidebar-header small {
    color: #888;
    font-size: 0.8rem;
}

.sidebar-menu {
    padding: 15px 0;
}

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

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ccc;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: #3a3a3a;
    color: #fff;
    border-left-color: #888;
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.menu-label {
    padding: 15px 20px 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    background-color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background-color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.9rem;
    color: #555;
}

/* ===== CONTENT AREA ===== */
.content {
    padding: 30px;
    flex: 1;
}

/* ===== CARDS ===== */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.card-body {
    padding: 20px;
}

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

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.stat-icon.books { background-color: #e8e8e8; color: #555; }
.stat-icon.members { background-color: #e0e0e0; color: #444; }
.stat-icon.loans { background-color: #d8d8d8; color: #333; }
.stat-icon.fines { background-color: #d0d0d0; color: #222; }

.stat-info h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.stat-info p {
    font-size: 0.85rem;
    color: #888;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
}

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

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

table th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
}

table tr:hover {
    background-color: #fafafa;
}

table td {
    font-size: 0.9rem;
    color: #444;
}

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

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

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #888;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

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

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-primary {
    background-color: #555;
    color: #fff;
}

.btn-primary:hover {
    background-color: #333;
}

.btn-secondary {
    background-color: #888;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #666;
}

.btn-success {
    background-color: #5a5a5a;
    color: #fff;
}

.btn-success:hover {
    background-color: #444;
}

.btn-danger {
    background-color: #7a7a7a;
    color: #fff;
}

.btn-danger:hover {
    background-color: #555;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 5px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background-color: #d4edda; color: #155724; }
.badge-warning { background-color: #fff3cd; color: #856404; }
.badge-danger { background-color: #f8d7da; color: #721c24; }
.badge-info { background-color: #e2e3e5; color: #383d41; }

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #e8e8e8;
    color: #333;
    border: 1px solid #ccc;
}

.alert-danger {
    background-color: #f0f0f0;
    color: #444;
    border: 1px solid #bbb;
}

.alert-warning {
    background-color: #f5f5f5;
    color: #555;
    border: 1px solid #aaa;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #555;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination span.active {
    background-color: #555;
    color: #fff;
    border-color: #555;
}

/* ===== FOOTER ===== */
.footer {
    background-color: #fff;
    padding: 15px 30px;
    text-align: center;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #888;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.login-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

.login-box p {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

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

.login-box .btn {
    width: 100%;
    padding: 12px;
}

/* ===== SEARCH & FILTER ===== */
.search-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-filter .form-control {
    max-width: 300px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .sidebar {
        position: absolute;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 15px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }