/* ===================================
   MERNIS PANEL - NIRVANA DESIGN SYSTEM
   Premium Dark Mode UI with Aurora Effects
   =================================== */

/* CSS Variables - Premium Color Palette */
:root {
    /* Neon Colors */
    --neon-purple: #b24bf3;
    --neon-blue: #00d4ff;
    --neon-pink: #ff2d92;
    --neon-green: #00ff88;
    --neon-orange: #ff6b35;

    /* Primary Colors */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.5);

    /* Accent */
    --accent: #06b6d4;
    --accent-dark: #0891b2;
    --accent-glow: rgba(6, 182, 212, 0.5);

    /* Background - Deep Space */
    --bg-primary: #030014;
    --bg-secondary: #0a0118;
    --bg-tertiary: #120726;
    --bg-card: rgba(15, 10, 40, 0.6);
    --bg-card-hover: rgba(25, 15, 60, 0.8);

    /* Glass Morphism */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-bg-strong: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-strong: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Gradients */
    --gradient-aurora: linear-gradient(135deg,
            rgba(139, 92, 246, 0.15) 0%,
            rgba(6, 182, 212, 0.1) 50%,
            rgba(168, 85, 247, 0.15) 100%);
    --gradient-glow: linear-gradient(135deg, var(--primary), var(--accent));
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.3) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(6, 182, 212, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(139, 92, 246, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 70px;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Border Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    background-image: var(--gradient-mesh);
    background-attachment: fixed;
}

/* Animated Background Mesh */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 80% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
        radial-gradient(ellipse 60% 60% at 100% 100%, rgba(6, 182, 212, 0.1), transparent);
    pointer-events: none;
    z-index: -1;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--accent));
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* ===================================
   UTILITIES
   =================================== */

.hidden {
    display: none !important;
}

/* Premium Glass Card */
.glass-card {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow:
        var(--glass-shadow),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Glow Effect */
.glow {
    box-shadow:
        0 0 20px var(--primary-glow),
        0 0 40px rgba(139, 92, 246, 0.2);
}

/* ===================================
   PREMIUM BUTTONS
   =================================== */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    text-decoration: none;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn i {
    font-size: 1.1rem;
    transition: transform 0.3s var(--spring);
}

.btn:hover i {
    transform: scale(1.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow:
        0 4px 20px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 30px var(--primary-glow),
        0 0 60px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: var(--glass-bg-strong);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* ===================================
   PREMIUM INPUTS
   =================================== */

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s var(--ease-out-expo);
    z-index: 1;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 16px 20px 16px 52px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.4s var(--ease-out-expo);
    backdrop-filter: blur(10px);
}

.input-group input::placeholder {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-group input:hover {
    border-color: var(--glass-border-strong);
    background: var(--glass-bg-strong);
}

.input-group input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow:
        0 0 0 4px rgba(139, 92, 246, 0.15),
        0 0 30px rgba(139, 92, 246, 0.1);
}

.input-group input:focus::placeholder {
    color: transparent;
}

.input-group input:focus+i,
.input-group input:focus~i,
.input-group:focus-within i {
    color: var(--primary);
    transform: scale(1.1);
}

.input-group.large input {
    padding: 20px 24px 20px 60px;
    font-size: 1.15rem;
    border-radius: var(--radius-lg);
}

.input-group.large i {
    left: 22px;
    font-size: 1.3rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===================================
   LOGIN SCREEN - PREMIUM
   =================================== */

.screen {
    min-height: 100vh;
}

.screen.active {
    display: block;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 56px 48px;
    position: relative;
    z-index: 10;
    animation: cardEntrance 0.8s var(--ease-out-expo);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.login-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), transparent, rgba(6, 182, 212, 0.2));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.login-card:hover::after {
    opacity: 1;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 48px;
}

.logo-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-xl);
    font-size: 2.2rem;
    color: white;
    position: relative;
    animation: logoFloat 3s ease-in-out infinite;
    box-shadow:
        0 10px 40px var(--primary-glow),
        0 0 80px rgba(139, 92, 246, 0.2);
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    z-index: -1;
    opacity: 0.5;
    filter: blur(15px);
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes logoPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.login-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.login-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.error-message {
    padding: 14px 18px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 16px;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Aurora Background */
.login-bg-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: auroraFloat 20s ease-in-out infinite;
}

.circle-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: var(--neon-pink);
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
}

.circle-3 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: 40%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes auroraFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-30px, 50px) scale(0.9);
        opacity: 0.3;
    }

    75% {
        transform: translate(-50px, -20px) scale(1.05);
        opacity: 0.45;
    }
}

/* ===================================
   MAIN APP LAYOUT
   =================================== */

#main-app {
    display: flex;
    min-height: 100vh;
}

/* Mobile Header - Premium */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(3, 0, 20, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.menu-toggle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
}

.menu-toggle:hover {
    background: var(--glass-bg-strong);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.header-title {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-user {
    font-size: 1.6rem;
    color: var(--primary);
}

/* ===================================
   SIDEBAR - PREMIUM
   =================================== */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(3, 0, 20, 0.95);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: all 0.5s var(--ease-out-expo);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), transparent, var(--accent));
    opacity: 0.3;
}

.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo i {
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.sidebar-close {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    margin-bottom: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 0 3px 3px 0;
    transition: height 0.3s var(--ease-out-expo);
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.15rem;
    transition: all 0.3s var(--spring);
}

.nav-item:hover {
    background: var(--glass-bg-strong);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--primary-light);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.nav-item.active::before {
    height: 60%;
}

.nav-item.active i {
    color: var(--primary);
}

.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin: 20px 8px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 150;
    backdrop-filter: blur(8px);
}

.sidebar-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===================================
   MAIN CONTENT
   =================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
}

.page {
    animation: pageEnter 0.5s var(--ease-out-expo);
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 40px;
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.page-header h2 i {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===================================
   DASHBOARD - PREMIUM
   =================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 22px;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 40px var(--primary-glow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.gradient-purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(168, 85, 247, 0.05));
    border-color: rgba(139, 92, 246, 0.25);
}

.stat-card.gradient-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(34, 211, 238, 0.05));
    border-color: rgba(6, 182, 212, 0.25);
}

.stat-card.gradient-pink {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(249, 115, 22, 0.05));
    border-color: rgba(236, 72, 153, 0.25);
}

.stat-card.gradient-green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(52, 211, 153, 0.05));
    border-color: rgba(16, 185, 129, 0.25);
}

.stat-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg-strong);
    border-radius: var(--radius-lg);
    font-size: 1.6rem;
    position: relative;
}

.stat-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, currentColor, transparent);
    opacity: 0.2;
    z-index: -1;
}

.gradient-purple .stat-icon {
    color: var(--primary);
}

.gradient-cyan .stat-icon {
    color: var(--accent);
}

.gradient-pink .stat-icon {
    color: var(--neon-pink);
}

.gradient-green .stat-icon {
    color: var(--success);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Quick Query - Premium */
.quick-query-section {
    margin-bottom: 48px;
}

.quick-query-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.quick-query-section h3 i {
    color: var(--warning);
    animation: pulse 2s infinite;
}

.quick-query-card {
    padding: 28px;
}

.quick-query-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.tab-btn:hover {
    background: var(--glass-bg-strong);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

#quick-query-form {
    display: flex;
    gap: 16px;
}

/* Recent Activity */
.recent-activity h3 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.recent-activity h3 i {
    color: var(--accent);
}

.activity-list {
    padding: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: var(--glass-bg-strong);
}

.activity-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg-strong);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 1rem;
}

.activity-info {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.activity-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.activity-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ===================================
   QUERY CARDS - PREMIUM
   =================================== */

.query-card {
    padding: 32px;
    margin-bottom: 32px;
}

.query-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===================================
   RESULT CARDS - PREMIUM
   =================================== */

.result-container {
    margin-top: 32px;
    animation: resultEnter 0.5s var(--ease-out-expo);
}

@keyframes resultEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-card {
    padding: 32px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.result-avatar {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-lg);
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 25px var(--primary-glow);
}

.result-title h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.result-title span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-item {
    padding: 18px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.result-item:hover {
    background: var(--glass-bg-strong);
    border-color: var(--glass-border-strong);
}

.result-item.clickable {
    cursor: pointer;
}

.result-item.clickable:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.result-item.full-width {
    grid-column: 1 / -1;
}

.result-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.result-item span {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

/* Family Grid */
.family-section {
    margin-top: 32px;
}

.family-section h4 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.family-section h4 i {
    color: var(--accent);
}

.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.family-card {
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.family-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
}

.family-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.family-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    color: white;
}

.family-avatar.male {
    background: linear-gradient(135deg, var(--info), #1e40af);
}

.family-avatar.female {
    background: linear-gradient(135deg, var(--neon-pink), #be185d);
}

.family-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.family-relation {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.family-tc {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, monospace;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ===================================
   LOGS - PREMIUM
   =================================== */

.logs-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.logs-table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th,
.logs-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.logs-table th {
    background: var(--glass-bg-strong);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.logs-table tr:hover td {
    background: var(--glass-bg);
}

.logs-table td {
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* ===================================
   LOADING OVERLAY
   =================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 0, 20, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    text-align: center;
}

.loader-ring {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
    box-shadow: 0 0 15px var(--primary-glow);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader span {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ===================================
   TOAST NOTIFICATIONS
   =================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    min-width: 320px;
    max-width: 420px;
    animation: slideIn 0.4s var(--ease-out-expo);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    font-size: 1.3rem;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ===================================
   RESPONSIVE - MOBILE PERFECTION
   =================================== */

@media (max-width: 1024px) {
    .main-content {
        padding: 30px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 300px;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
    }

    .sidebar-close {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: calc(var(--header-height) + 20px);
    }

    .page-header h2 {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 22px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    #quick-query-form {
        flex-direction: column;
    }

    .quick-query-tabs {
        flex-wrap: wrap;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .family-grid {
        grid-template-columns: 1fr;
    }

    .logs-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
    }

    .login-card {
        padding: 40px 28px;
    }

    .login-header h1 {
        font-size: 2rem;
    }

    .logo-icon {
        width: 76px;
        height: 76px;
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 1.4rem;
    }

    .page-header h2 i {
        display: none;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    .query-card,
    .result-card {
        padding: 24px;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }

    .stat-card {
        padding: 18px;
        gap: 16px;
    }

    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }
}

/* ===================================
   ANIMATIONS - SMOOTH & PREMIUM
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Hover Glow Effect */
.hover-glow {
    transition: all 0.4s var(--ease-out-expo);
}

.hover-glow:hover {
    box-shadow: 0 0 30px var(--primary-glow);
}

/* Focus ring for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {

    .sidebar,
    .mobile-header,
    .toast-container,
    .loading-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }
}
/* ===================================
   ADDED BY AGENT - Tapu Form Responsiveness
   =================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

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