/* ============================================
   NIGHTLIFE AI - Design System v2
   Font: Syne | Theme: Minimal Dark Neon
   ============================================ */

/* ---- RESET & BASE ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ── Base Palette ── */
    --bg-primary: #080b0e;
    --bg-card: rgba(20, 26, 34, 0.55);
    --bg-input: rgba(15, 19, 24, 0.7);
    --bg-surface: rgba(255, 255, 255, 0.02);

    --text-primary: #F1F1F1;
    --text-secondary: #A0A0B0;
    --text-muted: #5C6370;

    /* ── Neon Accents ── */
    --neon-purple: #8A2BE2;
    --neon-blue: #00D4FF;
    --neon-green: #39FF14;
    --neon-magenta: #FF2ED1;

    /* ── Legacy aliases ── */
    --accent-purple: var(--neon-purple);
    --accent-cyan: var(--neon-blue);
    --accent-pink: var(--neon-magenta);
    --accent-green: var(--neon-green);
    --accent-red: #FF4C4C;
    --accent-orange: #f59e0b;

    /* ── Borders ── */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(138, 43, 226, 0.35);

    /* ── Shadows ── */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-neon-purple: 0 0 12px rgba(138, 43, 226, 0.25);
    --shadow-neon-blue: 0 0 12px rgba(0, 212, 255, 0.25);
    --shadow-neon-green: 0 0 12px rgba(57, 255, 20, 0.25);
    --shadow-neon-magenta: 0 0 12px rgba(255, 46, 209, 0.25);

    /* ── Radii ── */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* ── Font ── */
    --font-main: 'Syne', sans-serif;

    /* ── Transition ── */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

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

/* ---- GRADIENT TEXT ---- */
.gradient-text {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
}

.login-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--neon-purple);
    top: -100px;
    right: -100px;
    animation: orbFloat 8s ease-in-out infinite;
}

.login-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--neon-blue);
    bottom: -80px;
    left: -80px;
    animation: orbFloat 10s ease-in-out infinite reverse;
}

.login-orb-3 {
    width: 200px;
    height: 200px;
    background: var(--neon-magenta);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat 12s ease-in-out infinite;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.login-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(138, 43, 226, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138, 43, 226, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

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

.logo-icon {
    margin-bottom: 16px;
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper input,
.select-wrapper select {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.select-wrapper select {
    padding-left: 16px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A0A0B0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.input-wrapper input:focus,
.select-wrapper select:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.15);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper input:focus~.input-icon {
    color: var(--neon-purple);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.select-wrapper {
    position: relative;
}

/* ============================================
   NEON BUTTONS
   All buttons: dark background + thin neon border
   GSAP animates the border glow on hover
   ============================================ */

/* ── Primary Neon Button ── */
.btn-primary-neon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: transparent;
    border: 1px solid var(--neon-purple);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary-neon:hover {
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5), inset 0 0 10px rgba(138, 43, 226, 0.2);
    border-color: var(--neon-purple);
    background: rgba(138, 43, 226, 0.05);
    color: #fff;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.8);
}

.btn-primary-neon:active {
    transform: scale(0.98);
}

/* ── Outline Neon Button ── */
.btn-outline-neon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 12px;
}

.btn-outline-neon:hover {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), inset 0 0 8px rgba(0, 212, 255, 0.15);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(255, 76, 76, 0.08);
    border: 1px solid rgba(255, 76, 76, 0.25);
    color: #ff8a8a;
}

.alert-success {
    background: rgba(57, 255, 20, 0.06);
    border: 1px solid rgba(57, 255, 20, 0.2);
    color: #6ffc4a;
}

.alert-info {
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: #67e8f9;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(8, 11, 14, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1.5px;
}

.brand-icon svg {
    display: block;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: transparent;
    transition: var(--transition);
    border-radius: 2px;
    box-shadow: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background: transparent;
}

.nav-link:hover::after {
    background: var(--neon-purple);
    box-shadow: 0 0 8px var(--neon-purple);
}

.nav-link.active {
    color: var(--neon-purple);
    background: transparent;
}

.nav-link.active::after {
    background: var(--neon-purple);
    box-shadow: 0 0 12px var(--neon-purple);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--neon-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--neon-purple);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-logout {
    color: var(--text-muted) !important;
}

.nav-logout:hover {
    color: var(--accent-red) !important;
    background: rgba(255, 76, 76, 0.06) !important;
}

/* Hamburger */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.navbar-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.navbar-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.open span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: calc(100vh - 64px - 80px);
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.page-description {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Thin top accent line */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:nth-child(1)::before {
    background: var(--neon-purple);
}

.stat-card:nth-child(2)::before {
    background: var(--neon-magenta);
}

.stat-card:nth-child(3)::before {
    background: var(--neon-blue);
}

.stat-card:nth-child(4)::before {
    background: var(--neon-green);
}

.stat-card:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 16px rgba(138, 43, 226, 0.4), inset 0 0 8px rgba(138, 43, 226, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card:nth-child(1) .stat-icon {
    background: rgba(138, 43, 226, 0.1);
    color: var(--neon-purple);
}

.stat-card:nth-child(2) .stat-icon {
    background: rgba(255, 46, 209, 0.1);
    color: var(--neon-magenta);
}

.stat-card:nth-child(3) .stat-icon {
    background: rgba(0, 212, 255, 0.1);
    color: var(--neon-blue);
}

.stat-card:nth-child(4) .stat-icon {
    background: rgba(57, 255, 20, 0.08);
    color: var(--neon-green);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* ── Quick Actions ── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.action-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: var(--transition);
    cursor: pointer;
}

.action-card:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 18px rgba(138, 43, 226, 0.35), inset 0 0 8px rgba(138, 43, 226, 0.1);
}

.action-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
}

.action-card:nth-child(1) .action-icon {
    background: rgba(138, 43, 226, 0.1);
}

.action-card:nth-child(2) .action-icon {
    background: rgba(0, 212, 255, 0.08);
}

.action-card:nth-child(3) .action-icon {
    background: rgba(255, 46, 209, 0.08);
}

.action-content h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.action-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Recent Activity / Section Cards ── */
.section-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
}

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

.section-title {
    font-size: 18px;
    font-weight: 700;
}

.section-body {
    padding: 0;
}

/* ============================================
   TAB SYSTEM – Neon border style
   ============================================ */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px;
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(138, 43, 226, 0.04);
    border-color: rgba(138, 43, 226, 0.15);
}

.tab-btn.active {
    background: rgba(138, 43, 226, 0.05);
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.25), inset 0 0 4px rgba(138, 43, 226, 0.1);
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.4);
}

.tab-icon {
    font-size: 16px;
    line-height: 1;
}

.tab-label {
    display: inline;
}

/* Tab content panels */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 28px;
}

.tab-panel-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.tab-panel-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ── Form layout ── */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field .form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0;
}

/* ── Toggle switch ── */
.check-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 0;
}

.check-toggle input {
    display: none;
}

.check-toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.check-toggle-slider::after {
    content: '';
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.check-toggle input:checked+.check-toggle-slider {
    background: rgba(138, 43, 226, 0.15);
    border-color: var(--neon-purple);
}

.check-toggle input:checked+.check-toggle-slider::after {
    background: var(--neon-purple);
    transform: translateX(20px);
}

.check-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Common fields area */
.common-fields {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 24px 28px;
    margin-top: -1px;
}

/* ── Generate button (dark bg + purple neon border) ── */
.btn-generate {
    width: 100%;
    margin-top: 20px;
    padding: 16px 28px !important;
    font-size: 16px !important;
    gap: 10px;
}

/* ============================================
   ASK PAGE (Content Generation)
   ============================================ */
.ask-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: calc(100vh - 64px - 80px);
}

.ask-page .title-sec-page {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 28px;
    letter-spacing: 1px;
}

/* Top Row: Form + Sidebar */
.ask-top-row {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}

.ask-form-main {
    min-width: 0;
}

.ask-sidebar {
    position: sticky;
    top: 80px;
}

.ask-chat {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    height: fit-content;
}

.ask-chat h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.pdf-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.pdf-item a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.pdf-item a:hover {
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-neon-blue);
}

.pdf-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pdf-item small {
    font-size: 11px;
    color: var(--text-muted);
}

/* Select row */
.ask-selects-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ask-select-group {
    min-width: 0;
}

/* Card/Form */
.ask-page .card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: none !important;
    max-width: 100% !important;
}

.ask-page .card-body {
    padding: 28px !important;
}

/* Form Controls Override */
.ask-page .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ask-page .form-select,
.ask-page .form-control {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-main) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    transition: var(--transition);
    width: 100%;
}

.ask-page .form-select:focus,
.ask-page .form-control:focus {
    border-color: var(--neon-purple) !important;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.12) !important;
    outline: none !important;
}

.ask-page .form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Radio and Check – pill style */
.ask-check {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px !important;
}

.ask-check .form-check {
    padding: 0;
    margin: 0;
}

.ask-check .form-check-input {
    display: none;
}

.ask-check .form-check-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.ask-check .form-check-input:checked+.form-check-label {
    background: rgba(138, 43, 226, 0.08);
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.12);
}

.ask-check .form-check-label:hover {
    border-color: rgba(138, 43, 226, 0.3);
    color: var(--text-primary);
}

/* ── Submit (neon dark button) ── */
.ask-page .btn-primary {
    background: transparent !important;
    border: 1px solid var(--neon-purple) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 28px !important;
    font-family: var(--font-main) !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary) !important;
}

.ask-page .btn-primary:hover {
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4), inset 0 0 8px rgba(138, 43, 226, 0.2) !important;
    background: rgba(138, 43, 226, 0.05) !important;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
}

.ask-page .btn-outline-secondary {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-main) !important;
    font-weight: 600 !important;
    transition: var(--transition);
}

.ask-page .btn-outline-secondary:hover {
    border-color: var(--neon-blue) !important;
    color: var(--neon-blue) !important;
    background: rgba(0, 212, 255, 0.05) !important;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.3), inset 0 0 6px rgba(0, 212, 255, 0.1) !important;
}

.pulsanti-risposta-pdf {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── AI Response ── */
.ask-risposta-full {
    margin-top: 32px;
    width: 100%;
}

.ask-risposta-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(138, 43, 226, 0.25);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.06);
}

.ask-risposta-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(138, 43, 226, 0.03);
}

.ask-risposta-icon {
    font-size: 28px;
    line-height: 1;
}

.ask-risposta-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.ask-risposta-body {
    padding: 28px;
}

.ask-risposta-body p {
    line-height: 1.9;
    color: var(--text-primary);
    white-space: pre-wrap;
    font-size: 14px;
}

/* Legacy support */
.ask-risposta {
    margin-top: 24px;
}

.ask-risposta .alert-success {
    background: var(--bg-card) !important;
    border: 1px solid rgba(57, 255, 20, 0.2) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-primary) !important;
    padding: 24px !important;
}

.ask-risposta h5 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--neon-green);
}

.ask-risposta p {
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ============================================
   ARCHIVIO / MONITORING TABLE
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.monitoring-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.monitoring-table th {
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.monitoring-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(31, 38, 48, 0.5);
    vertical-align: middle;
}

.monitoring-table tr {
    transition: var(--transition);
}

.monitoring-table tbody tr:hover {
    background: rgba(138, 43, 226, 0.03);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(57, 255, 20, 0.08);
    color: var(--neon-green);
    border: 1px solid rgba(57, 255, 20, 0.15);
}

.badge-error {
    background: rgba(255, 76, 76, 0.08);
    color: var(--accent-red);
    border: 1px solid rgba(255, 76, 76, 0.15);
}

.badge-genre {
    background: rgba(138, 43, 226, 0.08);
    color: var(--neon-purple);
    border: 1px solid rgba(138, 43, 226, 0.18);
}

/* Filter */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group select,
.filter-group input[type="date"],
.filter-group input[type="text"] {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    min-width: 160px;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--neon-purple);
}

.btn-filter {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: var(--radius-sm);
    color: var(--neon-purple);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-filter:hover {
    box-shadow: var(--shadow-neon-purple);
    border-color: var(--neon-purple);
}

.btn-reset {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-reset:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-download-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: var(--radius-sm);
    color: var(--neon-blue);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-download-sm:hover {
    box-shadow: var(--shadow-neon-blue);
    border-color: var(--neon-blue);
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand span {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
}

.footer-brand p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-dot {
    opacity: 0.3;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted {
    color: var(--text-muted) !important;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 16px;
}

.me-2 {
    margin-right: 8px;
}

.py-2 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.d-block {
    display: block;
}

.d-grid {
    display: grid;
}

/* ============================================
   BG EFFECTS
   ============================================ */
.page-bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.page-bg-effects .bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.08;
}

.page-bg-effects .bg-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--neon-purple);
    top: -200px;
    right: -200px;
}

.page-bg-effects .bg-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--neon-blue);
    bottom: -150px;
    left: -150px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(11, 15, 20, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: stretch;
        padding: 24px;
        gap: 8px;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .navbar-menu.open {
        transform: translateX(0);
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: var(--radius-md);
    }

    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: auto;
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* Ask Page */
    .ask-top-row {
        grid-template-columns: 1fr;
    }

    .ask-sidebar {
        position: relative;
        top: 0;
        order: -1;
    }

    .ask-selects-row {
        grid-template-columns: 1fr;
    }

    .ask-page .title-sec-page {
        font-size: 24px;
    }

    .ask-risposta-header {
        padding: 16px 20px;
    }

    .ask-risposta-body {
        padding: 20px;
    }

    .page-title {
        font-size: 24px;
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    /* Filter */
    .filter-bar {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
        min-width: auto;
    }

    /* Footer */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    /* Pulsanti */
    .pulsanti-risposta-pdf {
        flex-direction: column;
    }

    /* Tab System Mobile */
    .tab-bar {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 0 45%;
        padding: 12px 10px;
        font-size: 12px;
    }

    .tab-label {
        display: none;
    }

    .tab-icon {
        font-size: 20px;
    }

    .tab-panel {
        padding: 20px 16px;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .common-fields {
        padding: 20px 16px;
    }
}

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

    .login-card {
        padding: 28px 20px;
    }

    .ask-check {
        flex-direction: column;
    }

    .stat-value {
        font-size: 24px;
    }

    .ask-page {
        padding: 20px 16px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes neonPulse {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(138, 43, 226, 0.2);
    }

    50% {
        box-shadow: 0 0 14px rgba(138, 43, 226, 0.4);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease-out forwards;
}