:root {
    --primary: #1e3a5f;
    --primary-dark: #152a45;
    --primary-light: #2d5a8a;
    --accent: #e8b923;
    --accent-hover: #d4a61f;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-width: 260px;
    --text: #1f2937;
    --text-muted: #6b7280;
    --bg: #f3f4f6;
    --card: #ffffff;
    --border: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }

/* Landing */
.landing-nav { background: rgba(30,58,95,0.95); backdrop-filter: blur(10px); padding: 1rem 0; position: fixed; width: 100%; top: 0; z-index: 1000; }
.landing-nav .navbar-brand { color: #fff !important; font-weight: 700; font-size: 1.4rem; }
.landing-nav .nav-link { color: rgba(255,255,255,0.85) !important; font-weight: 500; }
.landing-nav .nav-link:hover { color: var(--accent) !important; }
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex; align-items: center; padding-top: 80px; position: relative; overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; color: #fff; }
.hero-content h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.2; }
.hero-content .lead { font-size: 1.2rem; opacity: 0.9; }
.btn-accent { background: var(--accent); color: var(--primary-dark); font-weight: 600; border: none; padding: 12px 28px; border-radius: 8px; }
.btn-accent:hover { background: var(--accent-hover); color: var(--primary-dark); }
.btn-outline-light-custom { border: 2px solid rgba(255,255,255,0.8); color: #fff; padding: 12px 28px; border-radius: 8px; font-weight: 600; }
.btn-outline-light-custom:hover { background: #fff; color: var(--primary); }
.feature-card { background: var(--card); border-radius: 12px; padding: 2rem; height: 100%; border: 1px solid var(--border); transition: transform 0.3s, box-shadow 0.3s; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(0,0,0,0.1); }
.feature-icon { width: 60px; height: 60px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem; margin-bottom: 1rem; }
.stats-section { background: var(--primary); color: #fff; padding: 4rem 0; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--accent); }
.footer-landing { background: var(--primary-dark); color: rgba(255,255,255,0.8); padding: 3rem 0 1.5rem; }

/* Auth */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-dark), var(--primary-light)); padding: 2rem; }
.auth-card { background: var(--card); border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 440px; box-shadow: 0 25px 50px rgba(0,0,0,0.2); }
.auth-card h2 { color: var(--primary); font-weight: 700; margin-bottom: 0.5rem; }
.auth-card .form-control { border-radius: 8px; padding: 12px 16px; border: 1px solid var(--border); }
.auth-card .form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(30,58,95,0.15); }
.btn-primary-custom { background: var(--primary); border: none; padding: 12px; border-radius: 8px; font-weight: 600; width: 100%; }
.btn-primary-custom:hover { background: var(--primary-dark); }

/* Dashboard Layout */
.dashboard-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width); background: var(--primary-dark); color: #fff;
    position: fixed; height: 100vh; overflow-y: auto; z-index: 100; transition: transform 0.3s;
}
.sidebar-brand { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.sidebar-brand i { color: var(--accent); font-size: 1.4rem; }
.sidebar-menu { padding: 1rem 0; list-style: none; }
.sidebar-menu .menu-label { padding: 0.75rem 1.5rem 0.5rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.4); }
.sidebar-menu a {
    display: flex; align-items: center; gap: 12px; padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.75); text-decoration: none; transition: all 0.2s; font-size: 0.9rem;
}
.sidebar-menu a:hover, .sidebar-menu a.active { background: rgba(255,255,255,0.1); color: #fff; border-left: 3px solid var(--accent); }
.sidebar-menu a i { width: 20px; text-align: center; }
.main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.top-navbar {
    background: var(--card); padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50;
}
.page-content { padding: 1.5rem; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.breadcrumb-custom { font-size: 0.85rem; color: var(--text-muted); }

/* Cards & Stats */
.stat-card {
    background: var(--card); border-radius: 12px; padding: 1.25rem 1.5rem;
    border: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; height: 100%;
}
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--info); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-icon.red { background: rgba(239,68,68,0.15); color: var(--danger); }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.stat-icon.teal { background: rgba(20,184,166,0.15); color: #14b8a6; }

.content-card { background: var(--card); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.content-card .card-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; background: #fafafa;
}
.content-card .card-header h5 { margin: 0; font-weight: 600; font-size: 1rem; }
.content-card .card-body { padding: 1.25rem; }

/* Tables */
.table-custom { margin: 0; }
.table-custom thead th { background: #f9fafb; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 2px solid var(--border); padding: 0.85rem 1rem; }
.table-custom tbody td { padding: 0.85rem 1rem; vertical-align: middle; font-size: 0.9rem; }
.badge-status { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-active { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-inactive { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-issued { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-returned { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-unpaid { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-paid { background: rgba(16,185,129,0.15); color: var(--success); }

.btn-action { padding: 4px 8px; font-size: 0.8rem; border-radius: 6px; }
.book-cover-sm { width: 40px; height: 55px; object-fit: cover; border-radius: 4px; }
.book-cover-md { width: 80px; height: 110px; object-fit: cover; border-radius: 6px; }

.search-box { max-width: 300px; }
.search-box .form-control { border-radius: 8px 0 0 8px; }
.search-box .btn { border-radius: 0 8px 8px 0; }

@media print {
    .sidebar, .top-navbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
}
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hero-content h1 { font-size: 2rem; }
}

.form-label { font-weight: 500; font-size: 0.9rem; }
.form-control, .form-select { border-radius: 8px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
