/* ================================================================
   BiblioSmart - Ultra-Premium Library Management System
   Premium SaaS Dashboard Design (Linear / Notion / Raycast inspired)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ==================================================================
   1. CSS CUSTOM PROPERTIES - LIGHT THEME (default)
   ================================================================== */
:root {
    /* Brand Colors */
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --primary-lighter: #ddd6fe;
    --primary-ghost: rgba(124, 58, 237, 0.07);
    --secondary: #06b6d4;
    --secondary-dark: #0891b2;
    --accent: #06b6d4;
    --success: #22c55e;
    --success-dark: #16a34a;
    --warning: #eab308;
    --warning-dark: #ca8a04;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info: #06b6d4;
    --info-dark: #0891b2;

    /* Neutrals */
    --dark: #1e293b;
    --darker: #0f172a;
    --darkest: #020617;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --gray-lighter: #f1f5f9;
    --gray-dark: #475569;
    --border: rgba(0, 0, 0, 0.06);

    /* Surfaces */
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-overlay: rgba(255, 255, 255, 0.88);
    --surface-sunken: #f8fafc;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Shadows - Premium layered */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.06), 0 16px 48px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 16px 32px rgba(0, 0, 0, 0.08), 0 32px 64px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.2);
    --shadow-glow-lg: 0 0 40px rgba(124, 58, 237, 0.3);
    --shadow-primary: 0 4px 14px rgba(124, 58, 237, 0.25);
    --shadow-card-hover: 0 8px 30px rgba(124, 58, 237, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);

    /* Radii */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Layout */
    --sidebar-width: 272px;
    --topbar-height: 64px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-spring: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(20px);
    --glass-saturate: saturate(180%);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #6d28d9 100%);
    --gradient-dark: linear-gradient(180deg, #0f0a1e 0%, #1a1035 50%, #0d1117 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-cool: linear-gradient(135deg, #06b6d4 0%, #7c3aed 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
    --gradient-text: linear-gradient(135deg, #7c3aed, #a78bfa, #06b6d4);
    --gradient-sidebar: linear-gradient(180deg, #0f0a1e 0%, #1a1035 50%, #0d1117 100%);
    --gradient-shine: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.3) 45%, rgba(255, 255, 255, 0.1) 55%, transparent 60%);

    /* Scrollbar */
    --scrollbar-bg: transparent;
    --scrollbar-thumb: rgba(0, 0, 0, 0.12);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.2);

    /* Z-index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 999;
    --z-sidebar: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
    --z-tooltip: 4000;
}

/* ==================================================================
   2. DARK MODE THEME
   ================================================================== */
body.dark-mode {
    --primary: #a78bfa;
    --primary-dark: #7c3aed;
    --primary-light: #c4b5fd;
    --primary-lighter: #2e1065;
    --primary-ghost: rgba(167, 139, 250, 0.1);

    --dark: #e2e8f0;
    --darker: #f1f5f9;
    --light: #0d1117;
    --gray: #8b949e;
    --gray-light: #21262d;
    --gray-lighter: #161b22;
    --gray-dark: #c9d1d9;
    --border: rgba(255, 255, 255, 0.06);

    --surface: #0d1117;
    --surface-raised: #161b22;
    --surface-overlay: rgba(13, 17, 23, 0.88);
    --surface-sunken: #010409;

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #484f58;
    --text-inverse: #0d1117;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.35);
    --shadow-2xl: 0 32px 64px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px rgba(167, 139, 250, 0.25);
    --shadow-glow-lg: 0 0 48px rgba(167, 139, 250, 0.35);
    --shadow-primary: 0 4px 14px rgba(167, 139, 250, 0.3);
    --shadow-card-hover: 0 8px 30px rgba(167, 139, 250, 0.15), 0 2px 8px rgba(0, 0, 0, 0.2);

    --glass-bg: rgba(22, 27, 34, 0.78);
    --glass-border: rgba(48, 54, 61, 0.6);

    --gradient-text: linear-gradient(135deg, #a78bfa, #c4b5fd, #22d3ee);

    --scrollbar-bg: transparent;
    --scrollbar-thumb: rgba(255, 255, 255, 0.08);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.14);
}

/* ==================================================================
   3. GLOBAL RESET & BASE STYLES
   ================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-lighter);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    animation: pageLoadFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageLoadFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: var(--primary);
    color: white;
}

/* ==================================================================
   4. CUSTOM SCROLLBAR
   ================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 100px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
}

/* ==================================================================
   5. TYPOGRAPHY & GRADIENT TEXT
   ================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-warm {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================================================================
   6. LOGIN PAGE - Ultra Premium Animated Background
   ================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #080510;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(124, 58, 237, 0.12) 0%, transparent 40%);
    animation: loginMeshShift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 400px at 30% 40%, rgba(124, 58, 237, 0.15) 0%, transparent 100%),
        radial-gradient(circle 300px at 70% 60%, rgba(6, 182, 212, 0.12) 0%, transparent 100%);
    animation: loginOrbFloat 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes loginMeshShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, -3%) rotate(2deg); }
    50% { transform: translate(-2%, 2%) rotate(-1deg); }
    75% { transform: translate(3%, 1%) rotate(1deg); }
    100% { transform: translate(-1%, -2%) rotate(-2deg); }
}

@keyframes loginOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -15px) scale(1.05); }
    66% { transform: translate(-15px, 10px) scale(0.98); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 0%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatingOrbs {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, -3%) rotate(5deg); }
    50% { transform: translate(-1%, 2%) rotate(-3deg); }
    75% { transform: translate(3%, 1%) rotate(2deg); }
}

/* Login Background Shapes (floating orbs) */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.login-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.45;
    animation: floatShape 18s ease-in-out infinite;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #7c3aed 0%, rgba(124, 58, 237, 0) 70%);
    top: -15%;
    right: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #ec4899 0%, rgba(236, 72, 153, 0) 70%);
    bottom: -15%;
    left: -10%;
    animation-delay: -6s;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
    top: 35%;
    left: 25%;
    animation-delay: -12s;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -40px) scale(1.08); }
    50% { transform: translate(-30px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.03); }
}

/* Login Container - Frosted Glass */
.login-container {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 32px 64px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(124, 58, 237, 0.12);
    width: 100%;
    max-width: 440px;
    padding: 48px 40px;
    animation: loginSlideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #06b6d4, #a78bfa);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    opacity: 0.8;
}

body.dark-mode .login-container {
    background: rgba(13, 17, 23, 0.7);
    border-color: rgba(48, 54, 61, 0.5);
}

@keyframes loginSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo Icon with Animated Gradient Border */
.logo-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #a78bfa, #06b6d4);
    background-size: 200% 200%;
    animation: logoGradientShift 4s ease infinite;
    color: white;
    font-size: 32px;
    margin: 0 auto 16px;
    box-shadow:
        0 8px 32px rgba(124, 58, 237, 0.35),
        0 0 0 3px rgba(124, 58, 237, 0.15);
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    background: linear-gradient(135deg, #7c3aed, #06b6d4, #a78bfa, #7c3aed);
    background-size: 300% 300%;
    animation: logoGradientShift 3s ease infinite;
    z-index: -1;
    opacity: 0.4;
    filter: blur(8px);
}

@keyframes logoGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo i {
    font-size: 48px;
    color: #a78bfa;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 4px 16px rgba(124, 58, 237, 0.4));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-top: 4px;
}

body.dark-mode .login-logo h1 {
    color: var(--text-primary);
}

/* Login Divider */
.login-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-divider span {
    background: transparent;
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    position: relative;
    backdrop-filter: blur(10px);
}

body.dark-mode .login-divider::before {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .login-divider span {
    color: var(--text-tertiary);
}

/* Login Footer & Credentials */
.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-credentials {
    margin-bottom: 12px;
}

.credential-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.credential-card i {
    color: var(--primary-light);
}

.login-version {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .credential-card {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .login-page {
    background: #050208;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.2s;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary-light);
}

/* ==================================================================
   7. FORM ELEMENTS
   ================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

/* Inside login page, labels are light */
.login-page .form-group label,
.login-container .form-group label {
    color: rgba(255, 255, 255, 0.7);
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--surface);
    color: var(--text-primary);
    outline: none;
}

/* Login page inputs */
.login-page .form-control,
.login-container .form-control {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.login-page .form-control::placeholder,
.login-container .form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-page .form-control:focus,
.login-container .form-control:focus {
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2), 0 0 24px rgba(124, 58, 237, 0.1);
}

/* Standard focus ring */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12), 0 0 20px rgba(124, 58, 237, 0.06);
}

body.dark-mode .form-control:focus {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18), 0 0 20px rgba(167, 139, 250, 0.1);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-control:hover:not(:focus) {
    border-color: var(--gray);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

body.dark-mode select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

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

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 16px;
    transition: color 0.2s ease;
    z-index: 1;
    pointer-events: none;
}

.input-icon .form-control {
    padding-left: 42px;
}

.input-icon:focus-within i {
    color: var(--primary);
}

.login-page .input-icon i {
    color: rgba(255, 255, 255, 0.35);
}

.login-page .input-icon:focus-within i {
    color: var(--primary-light);
}

/* Form Validation */
.form-control.is-valid {
    border-color: var(--success);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-text {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.form-text.text-danger {
    color: var(--danger);
}

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

/* ==================================================================
   8. BUTTONS - Premium with Ripple & Shine
   ================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    letter-spacing: -0.01em;
}

.btn i {
    font-size: 14px;
}

/* Ripple effect */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.25) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.btn:active::after {
    opacity: 1;
    transform: scale(2.5);
    transition: transform 0s, opacity 0s;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
    filter: brightness(1.08);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
    filter: brightness(1.08);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    filter: brightness(1.08);
}

.btn-warning {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: white;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.25);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(234, 179, 8, 0.35);
    filter: brightness(1.08);
}

.btn-secondary {
    background: var(--gray-lighter);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--gray-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

body.dark-mode .btn-secondary {
    background: var(--gray-light);
    color: var(--text-primary);
}

body.dark-mode .btn-secondary:hover {
    background: #30363d;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-ghost);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--primary-ghost);
    color: var(--primary);
}

.btn-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
    background-size: 200% 100%;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 4px 24px rgba(124, 58, 237, 0.35);
}

/* Button Glow */
.btn-glow {
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.3);
    animation: btnGlowPulse 2.5s ease-in-out infinite;
}

.btn-glow:hover {
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.45);
}

@keyframes btnGlowPulse {
    0%, 100% { box-shadow: 0 4px 18px rgba(124, 58, 237, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(124, 58, 237, 0.45); }
}

/* Login button shine effect */
.login-container .btn-primary {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    position: relative;
    overflow: hidden;
}

.login-container .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
    transition: left 0.5s ease;
}

.login-container .btn-primary:hover::before {
    left: 100%;
}

/* Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-xl {
    padding: 16px 36px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
}

.btn-icon:hover {
    transform: scale(1.08);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    font-size: 12px;
}

.btn-icon-lg {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
}

.btn-rounded {
    border-radius: var(--radius-full);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ==================================================================
   9. APP LAYOUT
   ================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ==================================================================
   10. SIDEBAR - Dark Gradient Glass with Noise
   ================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: var(--z-sidebar);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
}

/* Subtle noise texture overlay */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, #010409 0%, #0d1117 50%, #010409 100%);
    border-right-color: rgba(48, 54, 61, 0.3);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header i {
    font-size: 28px;
    color: var(--primary-light);
    filter: drop-shadow(0 2px 10px rgba(124, 58, 237, 0.5));
}

.sidebar-header h2 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.sidebar-header span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    display: block;
}

/* Sidebar Logo */
.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    position: relative;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed, #06b6d4, #a78bfa);
    background-size: 200% 200%;
    animation: logoGradientShift 4s ease infinite;
    z-index: -1;
    opacity: 0.5;
    filter: blur(4px);
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.25);
    padding: 14px 16px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(124, 58, 237, 0.08));
    color: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.nav-link.active::before {
    transform: scaleY(1);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.6);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.nav-link:hover i,
.nav-link.active i {
    opacity: 1;
    transform: scale(1.08);
}

.nav-link .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
    animation: badgePulse 2s ease-in-out infinite;
    min-width: 18px;
    text-align: center;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* Sidebar Footer - Glass Card */
.sidebar-footer {
    padding: 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-info .role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: capitalize;
}

.logout-btn {
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    transition: color 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.logout-btn:hover {
    color: #ef4444;
}

/* ==================================================================
   11. MAIN CONTENT
   ================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    background: var(--gray-lighter);
    transition: margin-left 0.35s ease, background-color 0.4s ease;
}

/* ==================================================================
   12. TOP BAR - Premium Frosted Glass
   ================================================================== */
.topbar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .topbar {
    background: rgba(13, 17, 23, 0.82);
    border-bottom-color: rgba(48, 54, 61, 0.5);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--primary-ghost);
    color: var(--primary);
}

.page-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-title p {
    font-size: 13px;
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Topbar Search */
.topbar-search {
    position: relative;
}

.topbar-search input {
    padding: 9px 16px 9px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    width: 240px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    width: 300px;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.topbar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 13px;
    pointer-events: none;
}

/* Search KBD hint */
.search-kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-lighter);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--text-tertiary);
    border: 1px solid var(--border);
    font-family: inherit;
    pointer-events: none;
}

/* Search Results */
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    display: none;
    z-index: var(--z-dropdown);
    max-height: 320px;
    overflow-y: auto;
    animation: dropdownSlideIn 0.2s ease;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--primary-ghost);
}

body.dark-mode .search-results {
    background: var(--surface-raised);
}

body.dark-mode .search-result-item:hover {
    background: rgba(167, 139, 250, 0.08);
}

/* Notification Button */
.notification-btn {
    position: relative;
    background: none;
    border: 1.5px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.notification-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-ghost);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.notification-btn .count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notifPulse 2s ease-in-out infinite;
    border: 2px solid var(--surface);
}

@keyframes notifPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    font-size: 16px;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-ghost);
    transform: rotate(20deg);
}

/* Dark Mode Toggle (alias) */
.dark-mode-toggle {
    background: none;
    border: 1.5px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 16px;
}

.dark-mode-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-ghost);
}

/* Topbar Avatar */
.topbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.25s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.topbar-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

/* Online status dot */
.topbar-avatar::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--surface);
}

/* Greeting */
.greeting {
    color: var(--primary);
}

/* ==================================================================
   13. CONTENT AREA
   ================================================================== */
.content {
    padding: 32px;
    animation: contentFadeIn 0.5s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================================================================
   14. CARDS - Premium with Subtle Glow on Hover
   ================================================================== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: cardEntrance 0.5s ease-out backwards;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(124, 58, 237, 0.12);
}

body.dark-mode .card {
    background: var(--surface-raised);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .card:hover {
    border-color: rgba(167, 139, 250, 0.15);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    border: 1px solid var(--glass-border);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered entrance */
.card:nth-child(1) { animation-delay: 0.04s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.16s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.24s; }
.card:nth-child(7) { animation-delay: 0.28s; }
.card:nth-child(8) { animation-delay: 0.32s; }

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.15;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-sunken);
}

/* ==================================================================
   15. STAT CARDS - Dashboard Stats with Gradient Icons
   ================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.5s ease-out backwards;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.16s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }

body.dark-mode .stat-card {
    background: var(--surface-raised);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Gradient Icon Backgrounds */
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon.blue {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(167, 139, 250, 0.08));
    color: var(--primary);
}

.stat-icon.green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(74, 222, 128, 0.08));
    color: var(--success);
}

.stat-icon.orange {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(250, 204, 21, 0.08));
    color: var(--warning);
}

.stat-icon.red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.08));
    color: var(--danger);
}

.stat-icon.cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(34, 211, 238, 0.08));
    color: var(--info);
}

body.dark-mode .stat-icon.blue { background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(124, 58, 237, 0.1)); }
body.dark-mode .stat-icon.green { background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(22, 163, 74, 0.1)); }
body.dark-mode .stat-icon.orange { background: linear-gradient(135deg, rgba(234, 179, 8, 0.18), rgba(202, 138, 4, 0.1)); }
body.dark-mode .stat-icon.red { background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.1)); }
body.dark-mode .stat-icon.cyan { background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(8, 145, 178, 0.1)); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stat-trend.up {
    color: var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.stat-trend.down {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.stat-trend.danger {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.stat-alert {
    border-left: 3px solid var(--danger);
}

/* ==================================================================
   16. BOOK CARDS - Gallery Quality
   ================================================================== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: 1px solid var(--border);
    position: relative;
    animation: cardEntrance 0.5s ease-out backwards;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl), 0 8px 30px rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.12);
}

body.dark-mode .book-card {
    background: var(--surface-raised);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .book-card:hover {
    border-color: rgba(167, 139, 250, 0.15);
}

.book-card:nth-child(1) { animation-delay: 0.04s; }
.book-card:nth-child(2) { animation-delay: 0.08s; }
.book-card:nth-child(3) { animation-delay: 0.12s; }
.book-card:nth-child(4) { animation-delay: 0.16s; }
.book-card:nth-child(5) { animation-delay: 0.2s; }
.book-card:nth-child(6) { animation-delay: 0.24s; }

/* Book Ribbon with gradient + clip-path */
.book-card .ribbon {
    position: absolute;
    top: 16px;
    left: -6px;
    background: var(--gradient-warm);
    color: white;
    padding: 4px 16px 4px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.book-card .ribbon::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 0;
    border-top: 5px solid #b91c1c;
    border-left: 6px solid transparent;
}

/* Book Ribbon v2 */
.book-ribbon {
    position: absolute;
    top: 12px;
    left: -6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 3px 14px 3px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
    clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.book-cover {
    height: 200px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #4c1d95 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Inner shadow overlay at bottom for text readability */
.book-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.book-card:hover .book-cover::after {
    opacity: 1;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card:hover .book-cover img {
    transform: scale(1.06);
}

.book-cover i {
    font-size: 56px;
    color: rgba(255, 255, 255, 0.2);
}

.book-cover .copies-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.book-info {
    padding: 16px;
}

.book-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.book-info .author {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.book-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.book-meta .tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.tag-category {
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-category::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

.tag-available {
    background: rgba(34, 197, 94, 0.08);
    color: var(--success);
}

.tag-unavailable {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

body.dark-mode .tag-category { background: rgba(167, 139, 250, 0.12); }
body.dark-mode .tag-available { background: rgba(34, 197, 94, 0.12); }
body.dark-mode .tag-unavailable { background: rgba(239, 68, 68, 0.12); }

.book-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.book-actions .btn {
    flex: 1;
    font-size: 12px;
    padding: 8px;
}

/* Book Description */
.book-description {
    padding: 16px 0;
    color: var(--text-secondary);
    line-height: 1.8;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

/* ==================================================================
   17. TABLES - Modern Data Table
   ================================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

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

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    background: var(--surface-sunken);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

body.dark-mode .table th {
    background: var(--surface);
    border-bottom-color: var(--primary);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
    transition: all 0.15s ease;
}

.table tbody tr:nth-child(even) td {
    background: var(--surface-sunken);
}

body.dark-mode .table tbody tr:nth-child(even) td {
    background: rgba(22, 27, 34, 0.5);
}

.table tr {
    transition: all 0.15s ease;
}

.table tbody tr:hover td {
    background: var(--primary-ghost);
    box-shadow: inset 3px 0 0 var(--primary);
}

body.dark-mode .table tbody tr:hover td {
    background: rgba(167, 139, 250, 0.06);
}

/* Status Pills with Dot */
.table .status {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.table .status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-active { background: rgba(34, 197, 94, 0.08); color: var(--success); }
.status-returned { background: rgba(124, 58, 237, 0.08); color: var(--primary); }
.status-overdue { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.status-pending { background: rgba(234, 179, 8, 0.08); color: var(--warning); }
.status-completed { background: rgba(34, 197, 94, 0.08); color: var(--success); }
.status-in_progress { background: rgba(6, 182, 212, 0.08); color: var(--info); }

body.dark-mode .status-active { background: rgba(34, 197, 94, 0.12); }
body.dark-mode .status-returned { background: rgba(167, 139, 250, 0.12); }
body.dark-mode .status-overdue { background: rgba(239, 68, 68, 0.12); }
body.dark-mode .status-pending { background: rgba(234, 179, 8, 0.12); }
body.dark-mode .status-completed { background: rgba(34, 197, 94, 0.12); }
body.dark-mode .status-in_progress { background: rgba(6, 182, 212, 0.12); }

/* ==================================================================
   18. MODALS - Premium with Accent Line
   ================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: overlayFadeIn 0.2s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

/* Subtle top gradient accent line */
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1;
}

body.dark-mode .modal {
    background: var(--surface-raised);
    border-color: rgba(48, 54, 61, 0.5);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--primary-ghost);
    color: var(--primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 400px; }

.modal-fullscreen {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    margin: 0;
}

/* Confirm Modal */
.confirm-modal { max-width: 400px; }

/* ==================================================================
   19. NOTES GRID - Paper Texture Effect
   ================================================================== */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.note-card {
    border-radius: var(--radius);
    padding: 20px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    cursor: pointer;
    animation: cardEntrance 0.5s ease-out backwards;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Subtle paper texture gradient */
.note-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.note-card:hover {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: var(--shadow-lg);
}

.note-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.82);
}

.note-card p {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.55);
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    line-height: 1.6;
}

.note-card .note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.35);
}

.note-card .pin-btn {
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.note-card .pin-btn:hover {
    transform: scale(1.2);
}

.note-card .pin-btn.pinned {
    color: rgba(0, 0, 0, 0.75);
}

body.dark-mode .note-card h4 { color: rgba(255, 255, 255, 0.88); }
body.dark-mode .note-card p { color: rgba(255, 255, 255, 0.55); }
body.dark-mode .note-card .note-footer { color: rgba(255, 255, 255, 0.3); }
body.dark-mode .note-card .pin-btn { color: rgba(255, 255, 255, 0.3); }
body.dark-mode .note-card .pin-btn.pinned { color: rgba(255, 255, 255, 0.75); }

/* ==================================================================
   20. TASKS - Priority Border Colors
   ================================================================== */
.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.task-item:hover {
    background: var(--surface-sunken);
    border-left-color: var(--primary);
}

.task-item.priority-high { border-left-color: var(--danger); }
.task-item.priority-medium { border-left-color: var(--warning); }
.task-item.priority-low { border-left-color: var(--success); }

body.dark-mode .task-item:hover {
    background: rgba(22, 27, 34, 0.5);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.task-checkbox:hover {
    border-color: var(--primary);
    background: var(--primary-ghost);
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
    animation: checkBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.task-content { flex: 1; }

.task-content .task-title {
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.task-content .task-title.completed {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.task-content .task-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: var(--success); }

/* ==================================================================
   21. NOTIFICATIONS DROPDOWN - Glass Effect
   ================================================================== */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border);
    z-index: var(--z-dropdown);
    display: none;
    animation: dropdownSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notifications-dropdown.show {
    display: block;
}

body.dark-mode .notifications-dropdown {
    background: var(--surface-raised);
    border-color: rgba(48, 54, 61, 0.5);
}

.notifications-dropdown .dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-dropdown .dropdown-header h4 {
    font-size: 15px;
    font-weight: 700;
}

.dropdown-body {
    max-height: 320px;
    overflow-y: auto;
}

.dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    position: sticky;
    bottom: 0;
    background: var(--surface);
}

body.dark-mode .dropdown-footer {
    background: var(--surface-raised);
}

.notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    transition: all 0.15s ease;
    position: relative;
}

.notification-item:hover {
    background: var(--surface-sunken);
}

.notification-item.unread {
    background: var(--primary-ghost);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.notification-icon.info { background: rgba(6, 182, 212, 0.08); color: var(--info); }
.notification-icon.warning { background: rgba(234, 179, 8, 0.08); color: var(--warning); }
.notification-icon.danger { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.notification-icon.success { background: rgba(34, 197, 94, 0.08); color: var(--success); }

.notification-content h5 { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.notification-content p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; }
.notification-content .time { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

/* ==================================================================
   22. FILTER BAR
   ================================================================== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control {
    padding: 8px 14px;
    font-size: 13px;
    min-width: 160px;
}

.filter-form .filter-bar {
    align-items: flex-end;
}

/* ==================================================================
   23. OCR SCANNER & PROGRESS
   ================================================================== */
.scanner-container {
    text-align: center;
    padding: 40px;
}

.scanner-video {
    width: 100%;
    max-width: 640px;
    border-radius: var(--radius);
    background: #000;
    margin: 20px auto;
    display: block;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.scanner-canvas { display: none; }

.scanner-result {
    margin-top: 20px;
    text-align: left;
}

.scanner-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    margin: 12px 0;
    box-shadow: var(--shadow-md);
}

/* Scanner Steps */
.scanner-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 500px;
    margin: 0 auto 24px;
}

.step-line {
    width: 30px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.3s;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-lighter);
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.step.active .step-num {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

/* Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--gray-lighter);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 16px 0;
    position: relative;
}

body.dark-mode .progress-bar-container {
    background: var(--gray-light);
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-lg { height: 12px; }
.progress-bar-sm { height: 4px; }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-indeterminate .progress-bar {
    width: 40% !important;
    animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ==================================================================
   24. ALERTS
   ================================================================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(34, 197, 94, 0.08); color: #15803d; border: 1px solid rgba(34, 197, 94, 0.15); border-left: 3px solid var(--success); }
.alert-danger { background: rgba(239, 68, 68, 0.08); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.15); border-left: 3px solid var(--danger); }
.alert-warning { background: rgba(234, 179, 8, 0.08); color: #a16207; border: 1px solid rgba(234, 179, 8, 0.15); border-left: 3px solid var(--warning); }
.alert-info { background: rgba(6, 182, 212, 0.08); color: #0e7490; border: 1px solid rgba(6, 182, 212, 0.15); border-left: 3px solid var(--info); }

body.dark-mode .alert-success { background: rgba(34, 197, 94, 0.1); color: #86efac; border-color: rgba(34, 197, 94, 0.2); }
body.dark-mode .alert-danger { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border-color: rgba(239, 68, 68, 0.2); }
body.dark-mode .alert-warning { background: rgba(234, 179, 8, 0.1); color: #fde047; border-color: rgba(234, 179, 8, 0.2); }
body.dark-mode .alert-info { background: rgba(6, 182, 212, 0.1); color: #67e8f9; border-color: rgba(6, 182, 212, 0.2); }

.alert-dismissible { padding-right: 40px; }

.alert-icon { flex-shrink: 0; font-size: 18px; }
.alert-content { flex: 1; }

.alert-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    color: inherit;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

/* ==================================================================
   25-55. REMAINING COMPONENTS
   (empty state, book detail, sidebar overlay, spinner, color options,
   tabs, skeleton, toasts, FAB, star rating, badges, tooltips,
   breadcrumbs, avatars, dividers, switches, dropdowns, pagination,
   quick actions, due items, drop zone, confirm dialog, steps,
   timeline, accordion, checkbox/radio, highlights, counter, back-to-top,
   gallery, kbd)
   ================================================================== */

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; animation: fadeInUp 0.5s ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.empty-state i { font-size: 56px; color: var(--gray-light); margin-bottom: 16px; animation: emptyFloat 3s ease-in-out infinite; }
body.dark-mode .empty-state i { color: var(--gray-light); }
@keyframes emptyFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { color: var(--text-tertiary); font-size: 14px; margin-bottom: 20px; }

/* BOOK DETAIL */
.book-detail { display: grid; grid-template-columns: 300px 1fr; gap: 32px; }
.book-detail-cover { height: 400px; background: linear-gradient(135deg, #7c3aed, #4c1d95); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: var(--shadow-lg); transition: transform 0.3s ease; }
.book-detail-cover:hover { transform: scale(1.02); }
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-detail-cover i { font-size: 80px; color: rgba(255, 255, 255, 0.2); }
.book-detail-info h2 { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.book-detail-info .author-name { font-size: 16px; color: var(--text-secondary); margin-bottom: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 20px; }
.detail-item { padding: 12px 0; }
.detail-item .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-tertiary); font-weight: 600; margin-bottom: 4px; }
.detail-item .value { font-size: 15px; font-weight: 600; color: var(--text-primary); }

/* SIDEBAR OVERLAY */
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: var(--z-overlay); }
.sidebar-overlay.show { display: block; animation: overlayFadeIn 0.25s ease; }

/* SPINNER */
.spinner { width: 40px; height: 40px; border: 3px solid var(--gray-light); border-top: 3px solid var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-sm { width: 20px; height: 20px; border-width: 2px; margin: 0; }
.spinner-lg { width: 60px; height: 60px; border-width: 4px; }

/* COLOR OPTIONS */
.color-options { display: flex; gap: 8px; margin-top: 8px; }
.color-option { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); }
.color-option:hover { transform: scale(1.2); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.color-option.selected { border-color: var(--text-primary); transform: scale(1.1); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }

/* TABS */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; gap: 0; }
.tab-btn { padding: 10px 20px; background: none; border: none; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.25s ease; font-family: inherit; position: relative; }
.tab-btn:hover { color: var(--primary); background: var(--primary-ghost); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* SKELETON */
.skeleton { position: relative; overflow: hidden; background: var(--gray-lighter); border-radius: var(--radius-sm); }
body.dark-mode .skeleton { background: var(--gray-light); }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); animation: skeletonShimmer 1.5s ease-in-out infinite; }
body.dark-mode .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); }
@keyframes skeletonShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-text-sm { height: 10px; margin-bottom: 6px; width: 80%; }
.skeleton-text-lg { height: 20px; margin-bottom: 10px; width: 60%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 200px; border-radius: var(--radius); }
.skeleton-image { width: 100%; height: 160px; border-radius: var(--radius-sm); }
.skeleton-button { height: 38px; width: 120px; border-radius: var(--radius-sm); }

/* TOASTS */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast); display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast { background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xl); padding: 14px 20px; display: flex; align-items: center; gap: 12px; min-width: 320px; max-width: 420px; pointer-events: all; animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); overflow: hidden; position: relative; border-left: 4px solid var(--primary); font-size: 14px; }
body.dark-mode .toast { background: var(--surface-raised); border-color: rgba(48, 54, 61, 0.5); color: var(--text-primary); }
.toast.success, .toast-success { border-left-color: var(--success); }
.toast.error, .toast-danger { border-left-color: var(--danger); }
.toast.warning, .toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast.toast-exit { animation: toastSlideOut 0.3s ease-in forwards; }
@keyframes toastSlideIn { from { opacity: 0; transform: translateX(100%) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastSlideOut { from { opacity: 1; transform: translateX(0) scale(1); } to { opacity: 0; transform: translateX(100%) scale(0.95); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
.toast-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.toast-success .toast-icon { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.toast-danger .toast-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.toast-warning .toast-icon { background: rgba(234, 179, 8, 0.1); color: var(--warning); }
.toast-info .toast-icon { background: rgba(6, 182, 212, 0.1); color: var(--info); }
.toast-content { flex: 1; }
.toast-content h5 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toast-content p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close { background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 14px; padding: 4px; transition: var(--transition); border-radius: 50%; }
.toast-close:hover { color: var(--text-primary); background: var(--primary-ghost); }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--primary); border-radius: 0 0 var(--radius) var(--radius); animation: toastProgress 5s linear forwards; }
.toast-success .toast-progress { background: var(--success); }
.toast-danger .toast-progress { background: var(--danger); }
.toast-warning .toast-progress { background: var(--warning); }
@keyframes toastProgress { from { width: 100%; } to { width: 0; } }

/* FAB */
.fab { position: fixed; bottom: 32px; right: 32px; width: 56px; height: 56px; border-radius: 50%; background: var(--gradient-primary); color: white; border: none; box-shadow: var(--shadow-lg), 0 4px 20px rgba(124, 58, 237, 0.35); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 24px; z-index: var(--z-sticky); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.fab:hover { transform: scale(1.1) rotate(90deg); box-shadow: var(--shadow-xl), 0 8px 30px rgba(124, 58, 237, 0.45); }
.fab:active { transform: scale(0.95); }
.fab-sm { width: 44px; height: 44px; font-size: 18px; }
.fab-extended { width: auto; border-radius: var(--radius-full); padding: 0 24px; gap: 8px; font-size: 14px; font-weight: 600; }
.fab-extended:hover { transform: scale(1.05); }
.fab-group { position: fixed; bottom: 32px; right: 32px; z-index: var(--z-sticky); display: flex; flex-direction: column-reverse; align-items: center; gap: 12px; }
.fab-group .fab-action { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); box-shadow: var(--shadow-md); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; opacity: 0; transform: translateY(20px) scale(0.5); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); pointer-events: none; }
.fab-group.open .fab-action { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.fab-group .fab-action:nth-child(1) { transition-delay: 0.05s; }
.fab-group .fab-action:nth-child(2) { transition-delay: 0.1s; }
.fab-group .fab-action:nth-child(3) { transition-delay: 0.15s; }
.fab-group .fab-action:nth-child(4) { transition-delay: 0.2s; }

/* STAR RATING */
.star-rating { display: inline-flex; gap: 2px; font-size: 16px; }
.star-rating .star { color: var(--gray-light); cursor: pointer; transition: all 0.2s ease; }
.star-rating .star.filled { color: #f59e0b; filter: drop-shadow(0 1px 4px rgba(245, 158, 11, 0.35)); animation: starFill 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes starFill { 0% { transform: scale(0.8); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.star-rating .star:hover { transform: scale(1.25); color: #f59e0b; }
.star-rating-sm { font-size: 12px; }
.star-rating-lg { font-size: 24px; gap: 4px; }
.star-rating-display { pointer-events: none; }
.star-rating-value { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-left: 8px; }
.rate-stars { display: flex; gap: 6px; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; line-height: 1.5; }
.badge-primary { background: var(--primary-ghost); color: var(--primary); }
.badge-success { background: rgba(34, 197, 94, 0.08); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.badge-warning { background: rgba(234, 179, 8, 0.08); color: var(--warning); }
.badge-info { background: rgba(6, 182, 212, 0.08); color: var(--info); }
.badge-dark { background: rgba(30, 41, 59, 0.08); color: var(--dark); }
body.dark-mode .badge-primary { background: rgba(167, 139, 250, 0.12); }
body.dark-mode .badge-success { background: rgba(34, 197, 94, 0.12); }
body.dark-mode .badge-danger { background: rgba(239, 68, 68, 0.12); }
body.dark-mode .badge-warning { background: rgba(234, 179, 8, 0.12); }
body.dark-mode .badge-info { background: rgba(6, 182, 212, 0.12); }
body.dark-mode .badge-dark { background: rgba(226, 232, 240, 0.08); color: var(--dark); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ROLE BADGES */
.role-badge { font-size: 10px; padding: 2px 8px; border-radius: var(--radius-full); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.role-admin { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.role-librarian { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.role-member { background: rgba(124, 58, 237, 0.1); color: var(--primary); }

/* RANK BADGES */
.rank-badge { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; background: var(--gray-lighter); color: var(--gray); }
.rank-badge.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3); }
.rank-badge.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; box-shadow: 0 2px 8px rgba(148, 163, 184, 0.3); }
.rank-badge.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3); }

/* DAYS BADGE */
.days-badge { padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; }
.days-badge.urgent { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.days-badge.warning { background: rgba(234, 179, 8, 0.08); color: var(--warning); }
.days-badge.ok { background: rgba(34, 197, 94, 0.08); color: var(--success); }

/* CHIPS */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500; background: var(--gray-lighter); color: var(--text-primary); border: 1px solid var(--border); cursor: default; transition: var(--transition); }
.chip:hover { background: var(--primary-ghost); border-color: var(--primary); color: var(--primary); }
.chip-close { background: none; border: none; font-size: 14px; color: var(--text-tertiary); cursor: pointer; padding: 0; line-height: 1; transition: color 0.2s ease; }
.chip-close:hover { color: var(--danger); }
.chip-avatar { width: 20px; height: 20px; border-radius: 50%; margin-left: -4px; }

/* TAGS */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; }
.tag-lg { padding: 4px 12px; font-size: 13px; }
.tag-primary { background: var(--primary-ghost); color: var(--primary); }
.tag-success { background: rgba(34, 197, 94, 0.08); color: var(--success); }
.tag-danger { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.tag-warning { background: rgba(234, 179, 8, 0.08); color: var(--warning); }
.tag-info { background: rgba(6, 182, 212, 0.08); color: var(--info); }

/* TOOLTIPS */
.tooltip-wrapper { position: relative; display: inline-block; }
.tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--darker); color: white; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.2s ease; pointer-events: none; z-index: var(--z-tooltip); box-shadow: var(--shadow-lg); }
body.dark-mode .tooltip { background: var(--surface-raised); border: 1px solid var(--border); }
.tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--darker); }
body.dark-mode .tooltip::after { border-top-color: var(--surface-raised); }
.tooltip-wrapper:hover .tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.tooltip-bottom { bottom: auto; top: calc(100% + 8px); transform: translateX(-50%) translateY(-4px); }
.tooltip-bottom::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--darker); }
.tooltip-wrapper:hover .tooltip-bottom { transform: translateX(-50%) translateY(0); }
.tooltip-left { bottom: auto; top: 50%; left: auto; right: calc(100% + 8px); transform: translateY(-50%) translateX(4px); }
.tooltip-left::after { top: 50%; left: 100%; bottom: auto; transform: translateY(-50%); border-top-color: transparent; border-left-color: var(--darker); }
.tooltip-wrapper:hover .tooltip-left { transform: translateY(-50%) translateX(0); }
.tooltip-right { bottom: auto; top: 50%; left: calc(100% + 8px); transform: translateY(-50%) translateX(-4px); }
.tooltip-right::after { top: 50%; right: 100%; left: auto; bottom: auto; transform: translateY(-50%); border-top-color: transparent; border-right-color: var(--darker); }
.tooltip-wrapper:hover .tooltip-right { transform: translateY(-50%) translateX(0); }

/* BREADCRUMBS */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb-item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb-item a { color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }
.breadcrumb-separator { color: var(--text-tertiary); font-size: 10px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .fa-chevron-right { font-size: 9px; opacity: 0.4; }

/* AVATARS */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-status { position: relative; }
.avatar-status::after { content: ''; position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); }
.avatar-status.offline::after { background: var(--gray); }
.avatar-status.busy::after { background: var(--danger); }
.author-avatar { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #7c3aed, #a78bfa); color: white; font-weight: 700; font-size: 13px; flex-shrink: 0; position: relative; }
.author-avatar::after { content: ''; position: absolute; inset: -2px; border-radius: 14px; background: linear-gradient(135deg, #7c3aed, #06b6d4); z-index: -1; opacity: 0.35; filter: blur(3px); }

/* DIVIDERS */
.divider { border: none; height: 1px; background: var(--border); margin: 20px 0; }
.divider-text { display: flex; align-items: center; gap: 16px; color: var(--text-tertiary); font-size: 13px; font-weight: 500; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* SWITCH / TOGGLE */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; background: var(--gray-light); border-radius: var(--radius-full); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.switch-slider::before { content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus + .switch-slider { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12); }

/* DARK MODE TOGGLE */
.dark-mode-toggle { background: none; border: 1.5px solid var(--border); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); color: var(--text-secondary); font-size: 16px; }
.dark-mode-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-ghost); }

/* DROPDOWNS */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; top: calc(100% + 4px); left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xl); min-width: 180px; z-index: var(--z-dropdown); display: none; animation: dropdownSlideIn 0.2s ease; padding: 4px; }
body.dark-mode .dropdown-menu { background: var(--surface-raised); border-color: rgba(48, 54, 61, 0.5); }
.dropdown-menu.show { display: block; }
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13px; color: var(--text-primary); text-decoration: none; border-radius: var(--radius-sm); transition: var(--transition); cursor: pointer; border: none; background: none; width: 100%; font-family: inherit; }
.dropdown-item:hover { background: var(--primary-ghost); color: var(--primary); }
.dropdown-item i { width: 16px; text-align: center; color: var(--text-tertiary); }
.dropdown-item:hover i { color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* PAGINATION */
.pagination-container { display: flex; justify-content: center; }
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination-dots { color: var(--text-tertiary); padding: 0 4px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--radius-full); font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; transition: var(--transition); border: 1px solid transparent; }
.page-link:hover { background: var(--primary-ghost); color: var(--primary); border-color: rgba(124, 58, 237, 0.15); }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: var(--shadow-primary); }
.page-link.disabled { opacity: 0.35; pointer-events: none; }

/* QUICK ACTIONS */
.quick-actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; border-radius: var(--radius); text-decoration: none; color: var(--text-primary); transition: all 0.25s ease; background: var(--surface-sunken); font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.quick-action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(6, 182, 212, 0.04)); border-color: rgba(124, 58, 237, 0.1); }
body.dark-mode .quick-action-btn { background: var(--surface-sunken); color: var(--text-primary); }
body.dark-mode .quick-action-btn:hover { background: rgba(167, 139, 250, 0.06); border-color: rgba(167, 139, 250, 0.12); }
.qa-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* DUE ITEMS */
.due-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.due-item:hover { background: var(--surface-sunken); }
.due-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(234, 179, 8, 0.08); color: var(--warning); font-size: 14px; flex-shrink: 0; }
.due-icon.urgent { background: rgba(239, 68, 68, 0.08); color: var(--danger); animation: dueIconPulse 1.5s ease-in-out infinite; }
@keyframes dueIconPulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); } 50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }
.due-icon.warning { background: rgba(234, 179, 8, 0.1); color: var(--warning); }
.due-info { flex: 1; }
.due-title { font-size: 13px; font-weight: 600; }
.due-meta { font-size: 12px; color: var(--text-secondary); }

/* DROP ZONE */
.drop-zone { border: 3px dashed var(--border); border-radius: var(--radius-lg); padding: 48px 24px; text-align: center; transition: all 0.3s; cursor: pointer; background: var(--surface-sunken); }
.drop-zone:hover { border-color: var(--primary); background: rgba(124, 58, 237, 0.03); }
.drop-zone.drag-over { border-color: var(--primary); background: rgba(124, 58, 237, 0.06); transform: scale(1.01); }
.drop-zone-content h3 { font-size: 18px; margin-bottom: 4px; }
body.dark-mode .drop-zone { background: var(--surface-sunken); border-color: var(--border); }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; transition: all 0.3s ease; cursor: pointer; background: var(--surface-sunken); }
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-ghost); }
.dropzone i { font-size: 40px; color: var(--text-tertiary); margin-bottom: 12px; }
.dropzone h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.dropzone p { font-size: 13px; color: var(--text-secondary); }
body.dark-mode .dropzone { background: var(--surface); }

/* CONFIRM DIALOG */
.confirm-dialog { text-align: center; padding: 32px 24px; }
.confirm-dialog .confirm-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 28px; animation: confirmIconPulse 0.5s ease-out; }
@keyframes confirmIconPulse { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.confirm-dialog .confirm-icon.danger { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.confirm-dialog .confirm-icon.warning { background: rgba(234, 179, 8, 0.08); color: var(--warning); }
.confirm-dialog .confirm-icon.success { background: rgba(34, 197, 94, 0.08); color: var(--success); }
.confirm-icon { font-size: 48px; color: var(--warning); }
.confirm-dialog h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-dialog p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.confirm-dialog .confirm-actions { display: flex; gap: 8px; justify-content: center; }

/* STEPS / WIZARD */
.steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 32px; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-full); font-size: 13px; font-weight: 600; color: var(--text-secondary); transition: all 0.3s; }
.step.active { background: rgba(124, 58, 237, 0.08); color: var(--primary); }
.step-number { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--gray-lighter); color: var(--text-secondary); transition: all 0.3s ease; }
.step.active .step-number { background: var(--primary); color: white; box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12); }
.step.completed .step-number { background: var(--success); color: white; }
.step-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.step.active .step-label { color: var(--primary); }
.step.completed .step-label { color: var(--success); }
.step-connector { width: 40px; height: 2px; background: var(--gray-light); margin: 0 8px; }
.step.completed + .step-connector, .step-connector.completed { background: var(--success); }
body.dark-mode .step-number { background: var(--gray-light); }
body.dark-mode .step-connector { background: var(--gray-light); }

/* TIMELINE */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -27px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--primary); }
.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.danger { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.timeline-dot.warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.timeline-content p { font-size: 13px; color: var(--text-secondary); }
.timeline-time { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ACCORDION */
.accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-primary); background: var(--surface); transition: var(--transition); }
.accordion-header:hover { background: var(--surface-sunken); }
.accordion-header i { transition: transform 0.3s ease; }
.accordion-item.open .accordion-header i { transform: rotate(180deg); }
.accordion-body { padding: 0 20px; max-height: 0; overflow: hidden; transition: all 0.3s ease; }
.accordion-item.open .accordion-body { padding: 16px 20px; max-height: 500px; }
body.dark-mode .accordion-header { background: var(--surface-raised); }
body.dark-mode .accordion-header:hover { background: rgba(22, 27, 34, 0.8); }

/* CUSTOM CHECKBOX & RADIO */
.custom-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.custom-checkbox input { display: none; }
.custom-checkbox .checkmark { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; }
.custom-checkbox input:checked + .checkmark { background: var(--primary); border-color: var(--primary); color: white; }
.custom-checkbox input:checked + .checkmark::after { content: '\2713'; font-size: 12px; font-weight: 700; }
.custom-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.custom-radio input { display: none; }
.custom-radio .radio-dot { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; }
.custom-radio input:checked + .radio-dot { border-color: var(--primary); }
.custom-radio input:checked + .radio-dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* SEARCH HIGHLIGHT */
.highlight, mark { background: rgba(234, 179, 8, 0.18); color: inherit; padding: 1px 4px; border-radius: 3px; }
body.dark-mode .highlight, body.dark-mode mark { background: rgba(234, 179, 8, 0.2); }

/* COUNTER */
.count-up { display: inline-block; font-variant-numeric: tabular-nums; }

/* BACK TO TOP */
.back-to-top { position: fixed; bottom: 32px; right: 32px; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease; z-index: var(--z-sticky); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary); color: white; border-color: var(--primary); box-shadow: var(--shadow-glow); }

/* GALLERY */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.gallery-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; aspect-ratio: 1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0); transition: background 0.3s ease; }
.gallery-item:hover::after { background: rgba(0, 0, 0, 0.15); }
body.dark-mode .gallery-item:hover::after { background: rgba(0, 0, 0, 0.35); }

/* KBD */
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 6px; font-size: 11px; font-family: inherit; font-weight: 600; color: var(--text-secondary); background: var(--surface-sunken); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; }
body.dark-mode kbd { background: var(--surface-raised); border-color: var(--border); }

/* ==================================================================
   UTILITY CLASSES
   ================================================================== */

/* Flex & Grid */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-0 { flex-grow: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing */
.m-0 { margin: 0; } .m-1 { margin: 4px; } .m-2 { margin: 8px; } .m-3 { margin: 12px; } .m-4 { margin: 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mt-5 { margin-top: 32px; } .mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; } .mb-5 { margin-bottom: 32px; }
.ml-0 { margin-left: 0; } .ml-1 { margin-left: 4px; } .ml-2 { margin-left: 8px; } .ml-3 { margin-left: 12px; } .ml-auto { margin-left: auto; }
.mr-0 { margin-right: 0; } .mr-1 { margin-right: 4px; } .mr-2 { margin-right: 8px; } .mr-3 { margin-right: 12px; } .mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-0 { padding: 0; } .p-1 { padding: 4px; } .p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-5 { padding: 20px; } .p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; } .px-4 { padding-left: 16px; padding-right: 16px; } .px-6 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; } .py-4 { padding-top: 16px; padding-bottom: 16px; } .py-6 { padding-top: 24px; padding-bottom: 24px; }

/* Text */
.text-center { text-align: center; } .text-right { text-align: right; } .text-left { text-align: left; }
.text-xs { font-size: 11px; } .text-sm { font-size: 13px; } .text-base { font-size: 14px; } .text-md { font-size: 16px; } .text-lg { font-size: 18px; } .text-xl { font-size: 22px; } .text-2xl { font-size: 28px; } .text-3xl { font-size: 36px; }
.font-light { font-weight: 300; } .font-normal { font-weight: 400; } .font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; } .font-extrabold { font-weight: 800; } .font-black { font-weight: 900; }
.text-primary { color: var(--primary); } .text-success { color: var(--success); } .text-danger { color: var(--danger) !important; } .text-warning { color: var(--warning); } .text-info { color: var(--info); } .text-gray { color: var(--gray); } .text-dark { color: var(--text-primary); } .text-muted { color: var(--text-tertiary); } .text-white { color: white; }
.uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; } .capitalize { text-transform: capitalize; } .tracking-wide { letter-spacing: 0.5px; } .tracking-wider { letter-spacing: 1px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Display & Misc */
.block { display: block; } .inline-block { display: inline-block; } .inline { display: inline; } .hidden { display: none; } .invisible { visibility: hidden; } .visible { visibility: visible; }
.overflow-hidden { overflow: hidden; } .overflow-auto { overflow: auto; } .overflow-x-auto { overflow-x: auto; }
.relative { position: relative; } .absolute { position: absolute; } .sticky { position: sticky; }
.w-full { width: 100%; } .h-full { height: 100%; } .min-h-screen { min-height: 100vh; }
.rounded { border-radius: var(--radius); } .rounded-sm { border-radius: var(--radius-sm); } .rounded-lg { border-radius: var(--radius-lg); } .rounded-xl { border-radius: var(--radius-xl); } .rounded-full { border-radius: var(--radius-full); } .rounded-none { border-radius: 0; }
.shadow { box-shadow: var(--shadow); } .shadow-md { box-shadow: var(--shadow-md); } .shadow-lg { box-shadow: var(--shadow-lg); } .shadow-xl { box-shadow: var(--shadow-xl); } .shadow-none { box-shadow: none; }
.border { border: 1px solid var(--border); } .border-t { border-top: 1px solid var(--border); } .border-b { border-bottom: 1px solid var(--border); } .border-none { border: none; }
.opacity-0 { opacity: 0; } .opacity-25 { opacity: 0.25; } .opacity-50 { opacity: 0.5; } .opacity-75 { opacity: 0.75; } .opacity-100 { opacity: 1; }
.pointer { cursor: pointer; } .no-select { user-select: none; }
.bg-primary { background: var(--primary); } .bg-success { background: var(--success); } .bg-danger { background: var(--danger); } .bg-warning { background: var(--warning); } .bg-info { background: var(--info); } .bg-surface { background: var(--surface); } .bg-transparent { background: transparent; }

/* Animations */
.transition-all { transition: all 0.2s ease; } .transition-fast { transition: all 0.1s ease; } .transition-slow { transition: all 0.4s ease; }
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.animate-slide-up { animation: fadeInUp 0.4s ease-out; }
.animate-slide-down { animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-left { animation: slideLeft 0.3s ease-out; }
@keyframes slideLeft { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.animate-scale-in { animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.animate-bounce { animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.9); } 100% { transform: scale(1); opacity: 1; } }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-spin { animation: spin 1s linear infinite; }
.animate-in { animation: animateIn 0.4s ease forwards; }
@keyframes animateIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
[data-animate] { animation: animateIn 0.5s ease forwards; animation-delay: var(--delay, 0s); }
.pulse { animation: pulseAnim 2s infinite; }
@keyframes pulseAnim { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.hover-scale:hover { transform: scale(1.02); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hover-glow:hover { box-shadow: var(--shadow-glow); }

/* ==================================================================
   CONTAINER QUERIES
   ================================================================== */
@supports (container-type: inline-size) {
    .card { container-type: inline-size; }
    @container (max-width: 300px) {
        .card-body { padding: 16px; }
        .card-header { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
    }
    .stats-grid { container-type: inline-size; }
    @container (max-width: 500px) {
        .stat-card { flex-direction: column; text-align: center; }
    }
}

/* ==================================================================
   DARK MODE - ADDITIONAL OVERRIDES
   ================================================================== */
body.dark-mode .login-container { background: rgba(13, 17, 23, 0.7); color: var(--text-primary); }
body.dark-mode .login-divider span { background: transparent; color: var(--text-tertiary); }
body.dark-mode .card, body.dark-mode .stat-card, body.dark-mode .book-card, body.dark-mode .table th, body.dark-mode .table td, body.dark-mode .form-control, body.dark-mode .btn-secondary, body.dark-mode .topbar, body.dark-mode .sidebar, body.dark-mode .modal, body.dark-mode .notifications-dropdown, body.dark-mode .dropdown-menu { transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease; }

/* ==================================================================
   RESPONSIVE - 4 Breakpoints
   ================================================================== */
@media (max-width: 1280px) {
    .topbar-search input { width: 200px; }
    .topbar-search input:focus { width: 240px; }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .content { padding: 20px; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .book-detail { grid-template-columns: 1fr; }
    .book-detail-cover { height: 250px; }
    .topbar-search input { width: 180px; }
    .topbar-search input:focus { width: 220px; }
}

@media (max-width: 768px) {
    .topbar { padding: 12px 16px; }
    .topbar-search { display: none; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .notes-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-control { width: 100%; min-width: unset; }
    .scanner-steps { flex-wrap: wrap; }
    .step span { display: none; }
    .step-line { width: 16px; }
    .modal { max-width: 100%; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 90vh; position: fixed; bottom: 0; animation: modalSlideUpMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
    @keyframes modalSlideUpMobile { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .notifications-dropdown { width: calc(100vw - 32px); right: -60px; }
    .toast-container { top: auto; bottom: 16px; left: 16px; right: 16px; }
    .toast { min-width: auto; width: 100%; }
    .fab { bottom: 20px; right: 20px; }
    .breadcrumb { font-size: 12px; }
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .books-grid { grid-template-columns: 1fr; }
    .book-actions { flex-direction: column; }
    .content { padding: 16px; }
    .login-container { padding: 32px 24px; }
    .card-body { padding: 16px; }
    .card-header { padding: 14px 16px; }
    .toast-container { left: 12px; right: 12px; bottom: 12px; }
    .toast { min-width: unset; width: 100%; }
}

/* ==================================================================
   PRINT STYLES
   ================================================================== */
@media print {
    .sidebar, .topbar, .fab, .toast-container, .modal-overlay, .sidebar-overlay, .book-actions, .filter-bar, .back-to-top { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    body { background: white !important; color: black !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    .stat-card { box-shadow: none !important; border: 1px solid #ddd !important; }
    a { color: black !important; }
    .no-print { display: none !important; }
    .page-title h1 { font-size: 24px; }
    .table th { background: #f5f5f5 !important; }
    .table td { padding: 8px 12px; }
}

/* ==================================================================
   ACCESSIBILITY
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }

/* ==================================================================
   SETTINGS, PROFILE & NEW COMPONENTS
   ================================================================== */

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; cursor: pointer; inset: 0; background: var(--gray-light);
    border-radius: 26px; transition: 0.3s;
}
.switch-slider::before {
    content: ''; position: absolute; width: 20px; height: 20px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%; transition: 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(22px); }

.toggle-group { display: flex; flex-direction: column; }
.toggle-item {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.toggle-item:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-info strong { display: block; font-size: 14px; margin-bottom: 2px; }
.toggle-info small { color: var(--text-secondary, var(--gray)); font-size: 12px; }

/* Info List */
.info-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.info-item:last-child { border-bottom: none; }
.info-label { font-size: 13px; color: var(--text-secondary, var(--gray)); display: flex; align-items: center; gap: 8px; }
.info-value { font-size: 14px; font-weight: 600; }

/* Profile Avatar Large */
.profile-avatar-large {
    width: 100px; height: 100px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), #a78bfa); color: white;
    font-size: 36px; font-weight: 800; margin: 0 auto;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.35);
    border: 4px solid rgba(255,255,255,0.2);
}

.profile-stats {
    display: flex; justify-content: center; gap: 28px; padding-top: 16px; border-top: 1px solid var(--border);
}
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 22px; font-weight: 800; color: var(--primary); }
.profile-stat span { font-size: 11px; color: var(--text-secondary, var(--gray)); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* Row Danger */
.row-danger td { background: rgba(239,68,68,0.04) !important; }

/* Password Strength */
.password-strength { margin-top: 6px; }

/* Keyboard Shortcut Help Modal */
.kbd-help { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.kbd-help-inner { background: var(--surface, white); border-radius: 16px; padding: 32px; max-width: 420px; width: 90%; box-shadow: var(--shadow-xl); }
.kbd-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kbd-row:last-child { border-bottom: none; }
.kbd-row kbd { background: var(--surface-sunken, #f1f5f9); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); font-family: inherit; }

/* Back to Top */
.back-to-top {
    position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); color: white; border: none; cursor: pointer; z-index: 1000;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    box-shadow: 0 4px 16px rgba(124,58,237,0.4); opacity: 0; visibility: hidden; transition: all 0.3s;
    transform: translateY(20px);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(124,58,237,0.5); }

/* Dark mode extras for new components */
body.dark-mode .switch-slider { background: var(--gray-dark, #374151); }
body.dark-mode .toggle-item { border-color: var(--border); }
body.dark-mode .info-item { border-color: var(--border); }
body.dark-mode .profile-stats { border-color: var(--border); }
body.dark-mode .profile-avatar-large { border-color: rgba(255,255,255,0.1); }
body.dark-mode .kbd-help-inner { background: var(--surface, #161b22); }
body.dark-mode .kbd-row kbd { background: rgba(255,255,255,0.05); }

/* ==================================================================
   END OF STYLESHEET
   ================================================================== */
