* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f3f6fb;
    color: #333;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1b5e20, #2e7d32);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}

.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.sidebar-header .brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255,255,255,.15);
    padding: 4px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.sidebar-menu {
    padding: 10px 0 20px;
    overflow-y: auto;
    height: calc(100vh - 64px);
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: background .2s, padding-left .2s;
}

.sidebar-menu a i {
    width: 18px;
    text-align: center;
}

.sidebar-menu li.active > a,
.sidebar-menu a:hover {
    background: rgba(255,255,255,.15);
    padding-left: 22px;
    color: #fff;
}

.sidebar-section-title {
    padding: 8px 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .7;
}

/* Main content */
.main-content {
    margin-left: 260px;
    padding: 20px 24px 60px;
    width: 100%;
}

/* Header area (landing / dashboard) */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
}

.page-subtitle {
    font-size: 13px;
    color: #777;
}

/* Rack (perpustakaan) layout */
.rack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 10px;
}

.rack-shelf {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 40, 70, .08);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.rack-shelf::after {
    content: '';
    position: absolute;
    left: -30%;
    bottom: -40%;
    width: 160%;
    height: 46%;
    background: linear-gradient(90deg, #c8a060, #b37b37);
    box-shadow: inset 0 4px 6px rgba(0,0,0,.25);
    border-radius: 30px;
}

.rack-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rack-title {
    font-size: 15px;
    font-weight: 600;
}

.rack-meta {
    font-size: 11px;
    color: #888;
}

.rack-books {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 6px;
    align-items: flex-end;
    margin-top: 10px;
    padding-bottom: 40px;
}

.rack-book {
    width: 26px;
    border-radius: 4px 4px 2px 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
    position: relative;
    cursor: pointer;
    transition: transform .2s;
}

.rack-book:hover {
    transform: translateY(-4px);
}

.rack-book span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 9px;
    color: rgba(255,255,255,.9);
    padding: 4px 2px;
    display: block;
}

/* Cards / widgets */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(15, 40, 70, .06);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

/* Footer */
.footer {
    position: fixed;
    left: 260px;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e0e6f0;
    padding: 8px 24px;
    font-size: 12px;
    color: #777;
}

/* Auth (login) */
.auth-container {
    min-height: 100vh;
    display: flex;
    background: radial-gradient(circle at top left, #c5e1a5, #1b5e20);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 26px 26px 22px;
    box-shadow: 0 20px 40px rgba(0,0,0,.24);
}

.auth-header {
    text-align: center;
    margin-bottom: 18px;
}

.auth-header img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    margin-bottom: 6px;
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
}

.auth-subtitle {
    font-size: 12px;
    color: #777;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ccd4e0;
    font-size: 13px;
    outline: none;
}

.form-control:focus {
    border-color: #1b5e20;
    box-shadow: 0 0 0 2px rgba(27,94,32,.18);
}

.btn {
    border-radius: 999px;
    padding: 9px 16px;
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.btn-primary {
    background: #1b5e20;
    color: #fff;
}

.btn-primary:hover {
    background: #174a1a;
}

/* Alert */
.alert {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 10px;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: inline-flex;
    }
    .main-content {
        margin-left: 0;
        padding: 16px 16px 60px;
    }
    .footer {
        left: 0;
        padding: 8px 16px;
    }
}
/* Rack clickable hover effect */
.rack-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rack-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(15, 40, 70, .15);
}

/* Document grid */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.document-card {
    background: #fff;
    border: 1px solid #e0e6f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.document-card:hover {
    border-color: #1b5e20;
    box-shadow: 0 8px 20px rgba(27, 94, 32, .12);
    transform: translateY(-2px);
}

.document-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f6fb;
    border-radius: 10px;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.document-meta {
    font-size: 11px;
    color: #777;
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.document-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.document-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff3e0;
    color: #e65100;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 6px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 10px 10px;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-num {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e0e6f0;
    background: #fff;
    color: #555;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn:hover,
.pagination-num:hover {
    background: #f3f6fb;
    border-color: #1b5e20;
    color: #1b5e20;
}

.pagination-num.active {
    background: #1b5e20;
    color: #fff;
    border-color: #1b5e20;
    font-weight: 600;
}

.pagination-dots {
    padding: 6px;
    color: #999;
    font-size: 12px;
}

/* Responsive document grid */
@media (max-width: 768px) {
    .document-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .pagination-btn,
    .pagination-num {
        padding: 5px 8px;
        font-size: 11px;
    }
}
