/* --- RESET DATA DASAR --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- HALAMAN LOGIN --- */
.login-body {
    background: #f4f6f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    color: #2c3e50;
    margin-bottom: 5px;
    text-align: center;
}

.login-container p {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 25px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #219653;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* --- LAYOUT UTAMA ADMIN --- */
.admin-container {
    display: flex;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px;
    text-align: center;
    background-color: #1a252f;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li a {
    display: block;
    padding: 15px 25px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 15px;
}

.sidebar-menu li a:hover, 
.sidebar-menu li a.active {
    background-color: #34495e;
    color: #ffffff;
    border-left: 5px solid #27ae60;
}

.sidebar-menu .logout-item a {
    color: #e74c3c;
    margin-top: 50px;
}

.sidebar-menu .logout-item a:hover {
    background-color: #c0392b;
    color: white;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-header {
    background-color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-title h2 {
    color: #2c3e50;
    font-size: 22px;
}

.header-user {
    color: #7f8c8d;
}

.content-body {
    padding: 30px;
}

.welcome-box {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 30px;
    border-left: 5px solid #3498db;
}

.welcome-box h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.welcome-box p {
    color: #7f8c8d;
}

.card-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.card {
    flex: 1;
    min-width: 220px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
}

.card-info h4 {
    color: #7f8c8d;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.card-info p {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.card-buku { border-top: 4px solid #3498db; }
.card-anggota { border-top: 4px solid #27ae60; }
.card-pinjam { border-top: 4px solid #f1c40f; }

/* --- CSS FORMS, CRUD & TABLES --- */
.crud-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.crud-card {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.table-card {
    flex: 2;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.crud-card h3, .table-card h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #f4f6f9;
    padding-bottom: 10px;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #3498db;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}

.btn-submit:hover { background: #2980b9; }

.table-murni {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.table-murni th, .table-murni td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table-murni th {
    background-color: #f4f6f9;
    color: #34495e;
    font-weight: 600;
}

.table-murni tbody tr:hover {
    background-color: #fdfdfd;
}

.img-thumb {
    width: 45px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.btn-action {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
}

.btn-print { background-color: #f1c40f; color: #2c3e50; }
.btn-print:hover { background-color: #d4ac0d; }

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
}

.badge-available {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.badge-empty {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.select-murni {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    background-color: white;
    outline: none;
    cursor: pointer;
}

.select-murni:focus {
    border-color: #e67e22;
}

.btn-return {
    background-color: #e74c3c;
}

.btn-return:hover {
    background-color: #c0392b;
}

/* --- KATALOG PUBLIK / MUKA --- */
.public-body {
    background-color: #fcfcfd;
    color: #2c3e50;
}

.public-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-murni {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    font-size: 18px;
    color: #2c3e50;
}

.logo-placeholder {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
}

.nav-links a {
    text-decoration: none;
    color: #7f8c8d;
    margin-left: 20px;
    font-size: 15px;
    font-weight: 500;
}

.nav-links a.active, .nav-links a:hover { color: #27ae60; }

.nav-links .btn-nav-login {
    background-color: #2c3e50;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
}
.nav-links .btn-nav-login:hover { background-color: #34495e; color: white; }

.hero-section {
    background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.9)), url('https://images.unsplash.com/photo-1521587760476-6c12a4b040da?q=80&w=1200') no-repeat center/cover;
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.hero-section h1 { font-size: 36px; margin-bottom: 10px; font-weight: 700; letter-spacing: -0.5px; }
.hero-section p { font-size: 16px; margin-bottom: 30px; color: #bdc3c7; }

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 6px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.search-form input {
    flex: 1;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 30px 0 0 30px;
    outline: none;
    color: #333;
}

.search-form button {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.search-form button:hover { background-color: #219653; }

.public-stats-grid {
    display: flex;
    justify-content: space-around;
    background: white;
    margin-top: -30px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-box h3 { font-size: 28px; color: #27ae60; margin-bottom: 2px; }
.stat-box p { font-size: 13px; color: #7f8c8d; text-transform: uppercase; font-weight: 600; }

.section-title { font-size: 22px; margin-bottom: 25px; border-left: 4px solid #27ae60; padding-left: 10px; color: #2c3e50; }
.books-grid { display: flex; flex-wrap: wrap; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 25px; margin-top: 20px; }

.book-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s;
}
.book-card:hover { transform: translateY(-5px); }

.book-card-cover { height: 230px; background-color: #f5f5f5; overflow: hidden; }
.book-card-cover img { width: 100%; height: 100%; object-fit: cover; }

.book-card-body { padding: 15px; display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.book-card-body h3 { font-size: 15px; color: #2c3e50; margin-bottom: 4px; line-height: 1.3; }
.book-card-body .author { font-size: 13px; color: #7f8c8d; margin-bottom: 10px; }

.badge-stock { display: inline-block; font-size: 11px; padding: 2px 6px; border-radius: 3px; font-weight: bold; align-self: flex-start; margin-bottom: 15px; }
.stok-ada { background: #e8f5e9; color: #2e7d32; }
.stok-habis { background: #ffebee; color: #c62828; }

.btn-detail { text-align: center; display: block; background: #f4f6f9; color: #34495e; font-size: 12px; font-weight: bold; padding: 8px; border-radius: 4px; text-decoration: none; }
.btn-detail:hover { background: #e2e6ea; }

.detail-container { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 40px; border: 1px solid #e1e8ed; }
.btn-back { text-decoration: none; color: #7f8c8d; font-size: 14px; font-weight: bold; }
.btn-back:hover { color: #27ae60; }

.detail-content { display: flex; gap: 40px; margin-top: 20px; flex-wrap: wrap; }
.detail-cover { width: 220px; height: auto; max-height: 320px; background: #f5f5f5; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.detail-cover img { width: 100%; height: 100%; object-fit: contain; background-color: #f5f5f5; }

.detail-info { flex: 1; min-width: 300px; }
.detail-info h2 { font-size: 28px; color: #2c3e50; margin-bottom: 5px; }
.detail-author { font-size: 15px; color: #7f8c8d; margin-bottom: 20px; }

.table-detail-murni { margin-bottom: 20px; font-size: 14px; }
.table-detail-murni td { padding: 6px 12px 6px 0; }

.detail-description h4 { margin-bottom: 8px; color: #2c3e50; }
.detail-description p { font-size: 14px; color: #555; line-height: 1.6; }

.detail-action-box { margin-top: 30px; border-top: 1px solid #f0f0f0; padding-top: 20px; }
.btn-pinjam-publik { display: inline-block; background-color: #27ae60; color: white; padding: 12px 25px; border-radius: 5px; text-decoration: none; font-weight: bold; }
.btn-pinjam-publik:hover { background-color: #219653; }

.public-footer { background-color: #2c3e50; color: #bdc3c7; text-align: center; padding: 25px; margin-top: 60px; font-size: 13px; }