/* Smart Library Management System - Core Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary-color: #64748b;
    --dark-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-active: #334155;
    --surface-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-teal: #0d9488;
    --accent-rose: #e11d48;
    --accent-amber: #d97706;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --sidebar-width: 260px;
    --header-height: 64px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--surface-bg);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Layout Architecture */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styles */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #cbd5e1;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-brand {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.sidebar-menu {
    padding: 15px 12px;
    list-style: none;
    margin: 0;
}

.menu-header {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 14px 14px 6px;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 3px;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.06);
}

.sidebar-link:hover i {
    color: #818cf8;
}

.sidebar-link.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.sidebar-link.active i {
    color: #ffffff;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Top Navbar */
.app-navbar {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.page-body {
    padding: 24px;
    flex: 1;
}

/* Dashboard Stat Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.icon-blue { background: #e0e7ff; color: #4338ca; }
.icon-emerald { background: #d1fae5; color: #047857; }
.icon-amber { background: #fef3c7; color: #b45309; }
.icon-rose { background: #ffe4e6; color: #be123c; }
.icon-cyan { background: #cffafe; color: #0e7490; }
.icon-purple { background: #f3e8ff; color: #7e22ce; }

.stat-number {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

/* Cards & Tables */
.card-custom {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header-custom {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-custom {
    margin-bottom: 0;
}

.table-custom th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.table-custom td {
    padding: 14px 18px;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

/* Buttons & Badges */
.btn-primary-custom {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-success-subtle { background: #d1fae5; color: #065f46; }
.badge-danger-subtle { background: #fee2e2; color: #991b1b; }
.badge-warning-subtle { background: #fef3c7; color: #92400e; }
.badge-info-subtle { background: #e0f2fe; color: #075985; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .app-sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    .app-sidebar.show {
        margin-left: 0;
    }
    .app-main {
        margin-left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(2px);
        z-index: 1025;
    }
    .sidebar-overlay.show {
        display: block;
    }
}
