/**
 * Optlyx Client Portal
 * Premium Design System - Zinc Monochrome
 * Font: Plus Jakarta Sans
 */

/* Ensure HTML hidden attribute always works regardless of CSS display rules */
[hidden] {
    display: none !important;
}

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* === CSS VARIABLES — Refined Warm Design System === */
:root {
    /* ── Core Palette — warm neutrals ── */
    --ink: #1a1a1a;
    --paper: #f7f4ef;
    --cream: #ffffff;
    --yellow: #fef9c3;
    --muted: #8c857c;
    --stone: #e8e4dd;

    /* ── Mapped to existing variable names for compatibility ── */
    --bg-primary: var(--paper);
    --bg-secondary: var(--stone);
    --bg-tertiary: #d9d4cc;
    --bg-card: var(--cream);
    --bg-elevated: var(--cream);
    --bg-dark: var(--ink);

    --text-primary: var(--ink);
    --text-secondary: #44403c;
    --text-tertiary: var(--muted);
    --text-muted: #b5afa6;
    --text-inverse: #ffffff;

    --accent-primary: var(--ink);
    --accent-secondary: #292524;
    --accent-light: var(--paper);
    --accent-glow: rgba(26, 26, 26, 0.04);
    --accent-gradient: var(--ink);

    /* Status Colors */
    --status-success: #16a34a;
    --status-success-bg: #f0fdf4;
    --status-warning: #d97706;
    --status-warning-bg: #fffbeb;
    --status-error: #dc2626;
    --status-error-bg: #fef2f2;
    --status-info: var(--muted);
    --status-info-bg: var(--paper);

    /* Borders — refined: thin, subtle */
    --border-light: var(--stone);
    --border-medium: #d4cfc6;
    --border-dark: #b8b2a8;
    --border-accent: var(--ink);

    /* Shadows — soft elevation, not flat offset */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-solid: var(--shadow-md);
    --shadow-glow: var(--shadow-lg);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);

    /* Font */
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* Spacing */
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Border Radius — soft, modern */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 0.12s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ── Geist-style icon overrides ──
   Makes Lucide icons look like Vercel's Geist:
   thinner strokes, tighter sizing, geometric feel */
[data-lucide],
.lucide {
    stroke-width: 1.5 !important;
    width: 18px;
    height: 18px;
}

/* Smaller contexts */
.card-item [data-lucide],
.panel-header [data-lucide],
.badge-count + [data-lucide],
.nav-badge + [data-lucide],
.appt-client-badge [data-lucide],
.upload-link-card-meta [data-lucide] {
    width: 14px;
    height: 14px;
    stroke-width: 1.5 !important;
}

/* Icon-only buttons */
.cl-appt-nav-btn [data-lucide],
.btn-preview-close [data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 1.8 !important;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Smooth scrolling & overscroll containment */
.view, .chat-stream, .neo-panel-scroll, .modal-scroll {
    overscroll-behavior-y: contain;
    scroll-behavior: smooth;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hidden {
    display: none !important;
}

/* === LOADING SCREEN — Neobrutalist === */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-gradient-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0.02) 0%, transparent 70%);
    z-index: 0;
}

.loading-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: min(100%, 460px);
    padding: 0 20px;
}

.loading-logo-container {
    position: relative;
}

.loading-logo {
    height: 56px;
    position: relative;
    z-index: 2;
    animation: logoFloat 3s ease-in-out infinite;
}

.loading-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(24, 24, 27, 0.08) 0%, transparent 70%);
    filter: blur(20px);
    animation: glowPulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Bouncing dots */
.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--muted);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }

    40% {
        transform: translateY(-12px) scale(1.1);
        opacity: 1;
    }
}

.loading-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    animation: textFade 2s ease-in-out infinite;
}

@keyframes textFade {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Roulette text ticker */
.loading-roulette {
    height: 28px;
    overflow: hidden;
    position: relative;
    width: 260px;
    text-align: center;
}

.loading-roulette::before,
.loading-roulette::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 10px;
    z-index: 2;
    pointer-events: none;
}

.loading-roulette::before {
    top: 0;
    background: linear-gradient(to bottom, var(--cream), transparent);
}

.loading-roulette::after {
    bottom: 0;
    background: linear-gradient(to top, var(--cream), transparent);
}

.loading-roulette-track {
    display: flex;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.loading-roulette-item {
    height: 28px;
    line-height: 28px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    margin: 0;
    opacity: 0.4;
    transition: opacity 0.4s ease;
    flex-shrink: 0;
}

.loading-roulette-item.active {
    opacity: 1;
    color: var(--text-primary);
}

/* ── Shimmer status indicator (ChatGPT-style) ── */
.loading-shimmer-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
}

.loading-shimmer-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--muted);
}

.loading-shimmer-icon .shimmer-spinner {
    transform-origin: center;
    animation: shimmerSpin 1.2s linear infinite;
}

@keyframes shimmerSpin {
    to { transform: rotate(360deg); }
}

.loading-shimmer-text {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
    background: linear-gradient(
        90deg,
        var(--text-tertiary) 0%,
        var(--text-tertiary) 40%,
        var(--ink) 50%,
        var(--text-tertiary) 60%,
        var(--text-tertiary) 100%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerSweep 2.4s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.loading-shimmer-text.fade-out {
    opacity: 0;
}

.loading-shimmer-text.fade-in {
    opacity: 1;
}

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

/* === APP CONTAINER === */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.app-container.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* === HEADER === */
.app-header {
    height: 64px;
    background: var(--ink);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    height: 38px;
    width: 38px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.brand-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--yellow);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

/* Accent logo tinting — filter chains to produce target hue from white base */
[data-accent="blue"] .brand-icon { filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(195deg); }
[data-accent="blue"] .brand-label { color: #93c5fd; }

[data-accent="purple"] .brand-icon { filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(240deg); }
[data-accent="purple"] .brand-label { color: #c4b5fd; }

[data-accent="green"] .brand-icon { filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(110deg); }
[data-accent="green"] .brand-label { color: #6ee7b7; }

[data-accent="orange"] .brand-icon { filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(345deg); }
[data-accent="orange"] .brand-label { color: #fdba74; }

[data-accent="rose"] .brand-icon { filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(310deg); }
[data-accent="rose"] .brand-label { color: #fda4af; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
    padding: 4px 12px 4px 4px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.user-pill span {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
}

.btn-icon-soft {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.btn-icon-soft:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
}

.btn-icon-soft i {
    width: 20px;
    height: 20px;
}

/* Desktop nav - hidden on mobile */
.desktop-nav {
    display: none;
}

/* === MAIN === */
.app-main {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.view {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-bottom: calc(90px + var(--safe-bottom));
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.view.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Scrollbar - Minimal */
.view::-webkit-scrollbar {
    width: 6px;
}

.view::-webkit-scrollbar-track {
    background: transparent;
}

.view::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

/* === WELCOME CARD === */
.welcome-card {
    background: var(--ink);
    border: none;
    padding: 24px 28px;
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    animation: cardEnter 0.4s ease forwards;
    opacity: 0;
    transform: translateY(8px);
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.welcome-card::before {
    display: none;
}

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

.welcome-greeting {
    font-size: 10px;
    font-weight: 700;
    color: var(--yellow);
    margin-bottom: 4px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.welcome-card h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cream);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.date-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: none;
}

/* === ACTION BUTTONS === */
.action-buttons-container {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
    animation: cardEnter 0.5s var(--ease-out) 0.05s forwards;
    opacity: 0;
}

.action-buttons-container .btn-scan {
    margin-bottom: 0;
    flex: 1;
}

.action-buttons-container .btn-secondary {
    flex: 1;
    margin-bottom: 0 !important;
    height: auto !important;
}

/* === PRIMARY SCAN BUTTON === */
.btn-scan {
    width: 100%;
    background: var(--ink);
    border: none;
    border-radius: var(--radius-lg);
    color: #ffffff;
    padding: 14px 24px;
    font-size: 13px;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease;
}

.btn-scan:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-scan:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn-scan::before { display: none; }

.btn-scan i {
    width: 20px;
    height: 20px;
}

/* === KPI CARDS === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

/* ═══ Neo Dashboard Header ═══ */
.neo-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.neo-dash-greeting {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
    letter-spacing: -0.02em;
}
.neo-dash-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 2px;
}
.neo-dash-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.neo-dash-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--cream);
    border: none;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}
.neo-dash-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.neo-dash-action:active {
    transform: scale(0.96);
}
.neo-dash-action i { width: 15px; height: 15px; }
.neo-dash-action-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border-medium);
    box-shadow: none;
}
.neo-dash-action-ghost:hover {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}

/* ═══ Neo KPI Strip — separate rounded cards ═══ */
.neo-kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.neo-kpi-hero {
    grid-column: 1 / -1;
    background: var(--ink);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    border: none;
    border-radius: var(--radius-xl);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-md);
}
.neo-kpi-hero:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.neo-kpi-hero:active { transform: scale(0.98); }
.neo-kpi-hero-icon {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.neo-kpi-hero-icon i {
    width: 22px;
    height: 22px;
    color: var(--yellow);
}
.neo-kpi-hero-num {
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    color: var(--yellow);
    letter-spacing: -0.04em;
}
.neo-kpi-hero-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.neo-kpi-hero-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--cream);
    letter-spacing: -0.01em;
}
.neo-kpi-hero-text span {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}
.neo-kpi-hero-arrow {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.neo-kpi-hero-arrow i {
    width: 20px;
    height: 20px;
}

/* KPI stat icon */
.neo-kpi-stat-icon {
    width: 20px;
    height: 20px;
    color: var(--muted);
    margin-bottom: 6px;
}

/* ═══ Quick Actions Strip ═══ */
.quick-actions-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    overflow: hidden;
}
.quick-action-btn:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}
.quick-action-btn:active {
    transform: scale(0.96);
}
.quick-action-btn span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    word-break: break-word;
}
.quick-action-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.quick-action-icon i {
    width: 18px;
    height: 18px;
}
.qa-chat { background: #dbeafe; }
.qa-chat i { color: #2563eb; }
.qa-scan { background: #fef3c7; }
.qa-scan i { color: #d97706; }
.qa-upload { background: #dcfce7; }
.qa-upload i { color: #16a34a; }
.qa-docs { background: #fee2e2; }
.qa-docs i { color: #dc2626; }
.qa-cal { background: #ede9fe; }
.qa-cal i { color: #7c3aed; }

/* ═══ Tips / Guide Section ═══ */
.tips-section {
    margin-bottom: 18px;
}

.tips-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 2px;
}

.tips-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.tips-title i {
    width: 16px;
    height: 16px;
    color: #d97706;
}

.tips-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

.tips-dismiss i {
    width: 16px;
    height: 16px;
}

.tips-dismiss:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tips-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tips-scroll::-webkit-scrollbar {
    display: none;
}

.tip-card {
    flex-shrink: 0;
    width: 260px;
    padding: 16px;
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    display: flex;
    gap: 12px;
    scroll-snap-align: start;
    transition: all 0.15s ease;
}

.tip-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.tip-emoji {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.tip-body strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
    line-height: 1.3;
}

.tip-body p {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-tertiary);
    margin: 0;
}

/* Last card — CTA style */
.tip-card.tip-cta {
    background: var(--ink);
    border-color: var(--ink);
}

.tip-card.tip-cta strong {
    color: var(--yellow);
}

.tip-card.tip-cta p {
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 374px) {
    .tip-card {
        width: 230px;
        padding: 14px;
    }
}

/* ═══ Empty state hint ═══ */
.empty-state-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.neo-kpi-stat {
    background: var(--cream);
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
}
.neo-kpi-stat:last-child { border-right: none; }
.neo-kpi-stat:hover { background: var(--yellow); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.neo-kpi-stat:active { transform: scale(0.97); }
.neo-kpi-stat-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.02em;
}
.neo-kpi-stat-lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-top: 6px;
}

@media (max-width: 767px) {
    .neo-dash-header { flex-direction: row; align-items: center; }
    .neo-dash-greeting { font-size: 20px; }
    .neo-dash-actions { gap: 6px; }
    .neo-dash-action { padding: 10px 12px; }
    .dash-action-label { display: none; }
}

@media (min-width: 768px) {
    .neo-kpi-strip {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
    }
}

/* ═══ Neo Panels Row — 2 columns side by side ═══ */
.neo-panels-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
@media (min-width: 768px) {
    .neo-panels-row {
        grid-template-columns: 1fr 1fr;
    }
}
.neo-panels-row .section-panel {
    margin-bottom: 0;
}

.neo-panel-title {
    font-weight: 700 !important;
    font-size: 13px !important;
    letter-spacing: -0.01em;
}

.neo-panel-scroll {
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 0;
}

/* Badge count — refined pill */
.badge-count {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--paper);
    color: var(--muted);
    border: 1px solid var(--border-light);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
.badge-count.warning {
    background: #fef7ed;
    color: #c4956a;
    border-color: #f5e6d3;
}
.badge-count.danger {
    background: #fef2f2;
    color: #e87c6a;
    border-color: #fde0dc;
}

/* ═══ Tab transition loader — logo pulse ═══ */
/* ═══ Tab Transition Loader — Optlyx style ═══ */
.neo-tab-loader {
    position: fixed;
    inset: 0;
    background: rgba(247, 244, 239, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}
.neo-tab-loader.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.neo-tab-loader-logo {
    width: 32px;
    height: 32px;
    animation: neoLogoBreathe 1s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
}
.neo-tab-loader-ring {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--ink);
    border-right-color: rgba(26, 26, 26, 0.2);
    animation: neoRingSpin 0.8s linear infinite;
}
@keyframes neoLogoBreathe {
    0% { opacity: 0.5; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.05); }
}
@keyframes neoRingSpin {
    to { transform: rotate(360deg); }
}

/* ═══ Neo Chat — Services, Welcome, Quick Actions ═══ */
.neo-chat-services {
    display: flex;
    gap: 0;
    padding: 0 20px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.neo-chat-services::-webkit-scrollbar { display: none; }
.neo-chat-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: all 0.15s ease;
    margin-right: 6px;
}
.neo-chat-chip:last-child { margin-right: 0; }
.neo-chat-chip:hover { background: var(--yellow); border-color: #FCD34D; }
.neo-chat-chip:active { transform: scale(0.95); }
.neo-chat-chip i { width: 14px; height: 14px; }

.neo-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    text-align: center;
    min-height: 300px;
}
.neo-chat-welcome-logo {
    width: 64px;
    height: 64px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    background: var(--cream);
}
.neo-chat-welcome-logo img {
    width: 40px;
    height: 40px;
}
.neo-chat-welcome h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 6px;
}
.neo-chat-welcome p {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 24px;
    max-width: 320px;
}
.neo-chat-quick {
    display: flex;
    gap: 0;
}
.neo-chat-quick button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 24px;
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-right-width: 0;
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.12s;
    min-width: 90px;
}
.neo-chat-quick button:last-child { border-right-width: 2px; }
.neo-chat-quick button:hover {
    background: var(--yellow);
    transform: translateY(-2px);
    box-shadow: 0 2px 0 var(--ink);
}
.neo-chat-quick button i { width: 20px; height: 20px; }

/* View entry animation */
.view.active {
    animation: neoViewIn 0.35s ease forwards;
}
@keyframes neoViewIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Badge count styling */
.badge-count {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    background: var(--ink);
    color: var(--yellow);
    border: 1px solid var(--border-light);
    margin-left: auto;
    letter-spacing: 0.04em;
}
.badge-count.warning {
    background: var(--yellow);
    color: var(--ink);
}
.badge-count.danger {
    background: var(--status-error);
    color: #fff;
}

/* ═══ Neo Hero KPI — Asymmetric hierarchy ═══ */
.neo-hero-kpi {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.neo-hero-kpi-main {
    background: var(--yellow);
    border: 1px solid var(--border-light);
    padding: 24px 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.12s;
    text-align: center;
}
.neo-hero-kpi-main:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-xl);
}
.neo-hero-kpi-value {
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.04em;
}
.neo-hero-kpi-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink);
    margin-top: 4px;
}
.neo-hero-kpi-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.neo-hero-kpi-side {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.neo-hero-kpi-item {
    background: var(--cream);
    border: 1px solid var(--border-light);
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.12s;
}
.neo-hero-kpi-item:hover {
    background: var(--yellow);
}
.neo-hero-kpi-item-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.02em;
}
.neo-hero-kpi-item-lbl {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .neo-hero-kpi {
        grid-template-columns: 1fr 2fr;
    }
    .neo-hero-kpi-side {
        grid-template-columns: repeat(3, 1fr);
    }
    .neo-hero-kpi-value {
        font-size: 64px;
    }
}

.kpi-card {
    background: var(--cream);
    border: 1px solid var(--border-light);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    animation: kpiEnter 0.4s ease forwards;
    opacity: 0;
    transform: translateY(8px);
    transition: transform 0.12s, box-shadow 0.12s;
}
.kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.kpi-card:nth-child(1) {
    animation-delay: 0.1s;
}

.kpi-card:nth-child(2) {
    animation-delay: 0.15s;
}

.kpi-card:nth-child(3) {
    animation-delay: 0.2s;
}

.kpi-card:nth-child(4) {
    animation-delay: 0.25s;
}

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

.kpi-card::before { display: none; }
.kpi-card::after { display: none; }

.kpi-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* === CHARTS ROW === */
.charts-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

.charts-row .cashflow-card {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

/* === CASHFLOW CHART CARD === */
.cashflow-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cashflow-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.cashflow-card-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cashflow-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.cashflow-card-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.cashflow-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cashflow-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.cashflow-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.cashflow-legend-dot.income {
    background: #14B8A6;
}

.cashflow-legend-dot.expense {
    background: #F87171;
}

.cashflow-legend-dot.docs-studio {
    background: #818CF8;
}

.cashflow-legend-dot.docs-client {
    background: #94A3B8;
}

.cashflow-chart-wrap {
    height: 160px;
    position: relative;
    margin-bottom: 16px;
}

.cashflow-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.cashflow-totals {
    display: flex;
    align-items: center;
    gap: 0;
    padding-top: 14px;
    border-top: 2px solid var(--border-light);
}

.cashflow-total-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cashflow-total-arrow {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.cashflow-total-arrow.income {
    color: #14B8A6;
}

.cashflow-total-arrow.expense {
    color: #F87171;
}

.cashflow-total-divider {
    width: 1px;
    height: 32px;
    background: var(--border-light);
    margin: 0 16px;
    flex-shrink: 0;
}

.cashflow-total-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.cashflow-total-value {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cashflow-total-value.income {
    color: #0F9488;
}

.cashflow-total-value.expense {
    color: #DC2626;
}

.cashflow-total-arrow.docs-studio,
.cashflow-total-value.docs-studio {
    color: #6366F1;
}

.cashflow-total-arrow.docs-client,
.cashflow-total-value.docs-client {
    color: #64748B;
}

/* ─── Prima Nota — settings-style card system ─── */
.pn-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8e3db;
}

.pn-page-title {
    font-size: 15px;
    font-weight: 700;
    color: #1c1917;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 3px;
}

.pn-page-sub {
    font-size: 12px;
    color: #78716c;
    margin: 0;
}

.pn-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.pn-kpi-card {
    background: #ffffff;
    border: 2px solid #e8e3db;
    border-radius: 10px;
    padding: 14px 14px 12px;
    transition: border-color 0.15s ease;
}

.pn-kpi-card:hover {
    border-color: #d6d0c6;
}

.pn-kpi-label {
    font-size: 10px;
    font-weight: 700;
    color: #a8a29e;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 5px;
}

.pn-kpi-value {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #1c1917;
}

.pn-kpi-sub {
    font-size: 10px;
    color: #a8a29e;
    margin-top: 4px;
}

/* === SDI INTEGRATION CARD (settings-style) === */
.sdi-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 2px solid #e8e3db;
    border-left: 3px solid #6366f1;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s;
}

.sdi-card:hover {
    border-color: #d6d0c6;
    border-left-color: #4f46e5;
    box-shadow: var(--shadow-sm);
}

.sdi-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.sdi-card-icon {
    width: 36px;
    height: 36px;
    background: #eef2ff;
    border: 2px solid #c7d2fe;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    flex-shrink: 0;
}

.sdi-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1c1917;
    margin-bottom: 2px;
}

.sdi-card-desc {
    font-size: 11px;
    color: #78716c;
    line-height: 1.4;
}

.sdi-card-desc strong {
    color: #4f46e5;
    font-family: monospace;
    font-size: 10.5px;
    letter-spacing: 0.03em;
}

.sdi-sync-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #292524;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.sdi-sync-btn:hover {
    background: #44403c;
}

.sdi-sync-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filter-chip-sdi {
    background: rgba(99, 102, 241, 0.08) !important;
    color: #6366F1 !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

.filter-chip-sdi.active {
    background: #6366F1 !important;
    color: white !important;
}

/* Action buttons row */
.pn-action-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.pn-btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #292524;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    letter-spacing: -0.01em;
}

.pn-btn-primary:hover {
    background: #44403c;
    transform: translateY(-1px);
}

.pn-btn-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e8e3db;
    border-radius: 10px;
    cursor: pointer;
    color: #78716c;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.pn-btn-icon:hover {
    border-color: #d6d0c6;
    color: #1c1917;
}

/* Batch banner */
.pn-batch-card {
    background: #ffffff;
    border: 2px solid #e8e3db;
    border-left: 3px solid #6366f1;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pn-batch-title {
    font-size: 13px;
    font-weight: 700;
    color: #1c1917;
    margin: 0 0 2px;
}

.pn-batch-sub {
    font-size: 11px;
    color: #a8a29e;
    margin: 0;
}

.pn-batch-btn {
    padding: 9px 16px;
    background: #292524;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.pn-batch-btn:hover {
    background: #44403c;
}

/* ─── Quick-Add Bar ─── */
.pn-quick-add {
    background: #ffffff;
    border: 2px solid #e8e3db;
    border-radius: 10px;
    padding: 14px 16px 12px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.pn-quick-type-row {
    display: flex;
    background: #f4f3f0;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 12px;
    gap: 3px;
}

.pn-quick-type {
    flex: 1;
    padding: 7px 10px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: #78716c;
    text-align: center;
    font-family: inherit;
}

.pn-quick-type.active.expense {
    background: #fff;
    color: #dc2626;
    box-shadow: var(--shadow-sm);
}

.pn-quick-type.active.income {
    background: #fff;
    color: #16a34a;
    box-shadow: var(--shadow-sm);
}

.pn-quick-amount-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #e8e3db;
    border-radius: 10px;
    padding: 6px 16px;
    background: #faf9f7;
    margin-bottom: 10px;
    transition: border-color 0.15s, background 0.15s;
}

.pn-quick-amount-wrap:focus-within {
    border-color: #6366f1;
    background: #fff;
}

.pn-quick-eur {
    font-size: 22px;
    font-weight: 700;
    color: #c8c4be;
    flex-shrink: 0;
    line-height: 1;
}

.pn-quick-amount {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 28px;
    font-weight: 700;
    color: #1c1917;
    outline: none;
    font-variant-numeric: tabular-nums;
    min-width: 0;
    letter-spacing: -0.02em;
    font-family: inherit;
}

.pn-quick-amount::placeholder {
    color: #d6d3d1;
}

.pn-quick-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pn-quick-desc {
    flex: 1;
    border: 1.5px solid #e8e3db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    color: #1c1917;
    background: #faf9f7;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    min-width: 0;
    font-family: inherit;
}

.pn-quick-desc:focus {
    border-color: #6366f1;
    background: #fff;
}

.pn-quick-save {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #292524;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

.pn-quick-save:hover {
    background: #44403c;
    transform: scale(1.05);
}

.pn-quick-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pn-quick-scan {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 10px;
    background: #f4f3f0;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: #78716c;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.pn-quick-scan:hover {
    background: #e8e3db;
}

.pn-quick-more {
    font-size: 11px;
    font-weight: 600;
    color: #a8a29e;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
    font-family: inherit;
}

.pn-quick-more:hover {
    color: #6366f1;
}

/* ─── Month group with totals ─── */
.pn-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pn-month-totals {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pn-month-total-item {
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pn-month-total-item.income {
    color: #16a34a;
}

.pn-month-total-item.expense {
    color: #dc2626;
}

.pn-month-total-sep {
    font-size: 11px;
    color: #d6d3d1;
}

/* ─── Category chips (in modal) ─── */
.pn-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-bottom: 4px;
}

.pn-cat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 4px 7px;
    border: 1.5px solid #e8e3db;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.pn-cat-chip:hover {
    border-color: #d6d0c6;
    background: #faf9f7;
}

.pn-cat-chip.selected {
    border-color: var(--cat-color);
    background: var(--cat-bg);
}

.pn-cat-chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cat-bg, #f4f3f0);
    color: var(--cat-color, #78716c);
    flex-shrink: 0;
    transition: all 0.15s;
}

.pn-cat-chip.selected .pn-cat-chip-icon {
    background: var(--cat-color);
    color: #fff;
}

.pn-cat-chip-label {
    font-size: 9px;
    font-weight: 700;
    color: #78716c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.pn-cat-chip.selected .pn-cat-chip-label {
    color: var(--cat-color);
}

/* ─── Payment chips (in modal) ─── */
.pn-pay-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.pn-pay-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 9px 4px 7px;
    border: 1.5px solid #e8e3db;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 9px;
    font-weight: 700;
    color: #78716c;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: inherit;
}

.pn-pay-chip:hover {
    border-color: #d6d0c6;
    background: #faf9f7;
}

.pn-pay-chip .pay-icon {
    font-size: 18px;
}

.pn-pay-chip.selected {
    border-color: #292524;
    background: #292524;
    color: #fff;
}

/* ─── Shared modal input ─── */
.pn-modal-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e8e3db;
    border-radius: 10px;
    font-size: 14px;
    color: #1c1917;
    background: #faf9f7;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}

.pn-modal-input:focus {
    border-color: #6366f1;
    background: #fff;
}

/* ─── Detail modal stat cells ─── */
.pn-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.pn-detail-cell {
    padding: 12px 14px;
    background: #faf9f7;
    border: 2px solid #e8e3db;
    border-radius: 10px;
}

.pn-detail-cell-label {
    font-size: 10px;
    font-weight: 700;
    color: #a8a29e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.pn-detail-cell-value {
    font-size: 14px;
    font-weight: 600;
    color: #1c1917;
}

/* Entries list */
.pn-month-group {
    margin-bottom: 20px;
}

.pn-month-label {
    font-size: 10px;
    font-weight: 700;
    color: #a8a29e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 8px 2px;
}

.pn-entry-card {
    background: #ffffff;
    border: 2px solid #e8e3db;
    border-radius: 10px;
    padding: 13px 16px 12px 19px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.pn-entry-card:hover {
    border-color: #d6d0c6;
    box-shadow: var(--shadow-sm);
}

.pn-entry-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.pn-entry-card.income::before {
    background: #22c55e;
}

.pn-entry-card.expense::before {
    background: #ef4444;
}

.pn-entry-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.pn-entry-desc {
    font-size: 12px;
    font-weight: 600;
    color: #1c1917;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.pn-entry-amount {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.pn-entry-amount.income {
    color: #16a34a;
}

.pn-entry-amount.expense {
    color: #dc2626;
}

.pn-entry-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pn-entry-date {
    font-size: 11px;
    color: #a8a29e;
}

.pn-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
}

.pn-badge-draft {
    background: #f1f5f9;
    color: #64748b;
}

.pn-badge-submitted {
    background: #fef3c7;
    color: #d97706;
}

.pn-badge-approved {
    background: #dcfce7;
    color: #16a34a;
}

.pn-badge-rejected {
    background: #fef2f2;
    color: #dc2626;
}

.pn-badge-posted {
    background: #dbeafe;
    color: #2563eb;
}

.pn-badge-category {
    background: #f8f7f5;
    color: #78716c;
    border: 2px solid #e8e3db;
}

.pn-badge-sdi {
    background: #eef2ff;
    color: #6366f1;
}

.pn-badge-ai {
    background: #eff6ff;
    color: #3b82f6;
}

/* === SECTION PANELS — OpenAI-inspired minimal === */
.section-panel {
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: none;
    animation: panelEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    opacity: 0;
    transform: translateY(10px);
    transition: border-color 0.2s ease;
}

.section-panel:nth-of-type(1) { animation-delay: 0.08s; }
.section-panel:nth-of-type(2) { animation-delay: 0.14s; }
.section-panel:nth-of-type(3) { animation-delay: 0.20s; }
.section-panel:nth-of-type(4) { animation-delay: 0.26s; }

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

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: none;
    background: transparent;
}

.panel-header-content {
    flex: 1;
    min-width: 0;
}

.panel-tagline {
    font-size: 11px;
    font-weight: 600;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    margin-bottom: 3px;
}

.panel-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
}

.panel-icon i {
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.panel-icon.blue { background: #f0f4ff; }
.panel-icon.blue i { color: #6b7eff; }
.panel-icon.amber { background: #fef7ed; }
.panel-icon.amber i { color: #c4956a; }
.panel-icon.purple { background: #f5f3ff; }
.panel-icon.purple i { color: #8b7ade; }
.panel-icon.red { background: #fef2f2; }
.panel-icon.red i { color: #e87c6a; }

.panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #0c0c0e;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Scadenze Panel — subtle warm tint */
.scadenze-panel {
    background: var(--cream);
}

.scadenze-panel .panel-header {
    background: transparent;
}

.scadenze-content .card-item {
    border-left: none;
    background: var(--cream);
}

.scadenze-content .card-item .countdown {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    background: #f7f7f8;
    color: #3b3d45;
    letter-spacing: 0.01em;
    border: 1px solid rgba(101,106,118,0.12);
    border-radius: 100px;
    font-variant-numeric: tabular-nums;
}

.scadenze-content .card-item .countdown.urgent {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.scadenze-content .card-item .countdown.ok {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.scadenze-content .card-item .countdown.ok {
    background: var(--status-success-bg);
    color: var(--status-success);
}

/* === NEWSLETTER PANEL - Il Bollettino === */
.newsletter-panel {
    border-color: #E5E7EB;
    background: #FAFAFA;
    position: relative;
    overflow: hidden;
}

.newsletter-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #27272A;
}

.newsletter-header {
    background: transparent;
    border-color: #E5E7EB;
    flex-wrap: wrap;
}

.newsletter-title-box {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.newsletter-title-box .panel-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.newsletter-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.newsletter-content {
    padding: 12px;
}

/* News Article Card */
.news-article {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all 0.2s var(--ease-out);
    cursor: pointer;
    position: relative;
}

.news-article:hover {
    border-color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.news-article:last-child {
    margin-bottom: 0;
}

.news-date {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.news-headline {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.news-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--border-light);
}

.news-category {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-category.fiscale {
    background: #EFF6FF;
    color: #2563EB;
}

.news-category.normativa {
    background: #FEF3C7;
    color: #D97706;
}

.news-category.importante {
    background: #FEE2E2;
    color: #DC2626;
}

.news-category.info {
    background: #F0FDF4;
    color: #16A34A;
}

.news-read-more {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.news-read-more i {
    width: 12px;
    height: 12px;
}

/* Featured News (first article) */
.news-article.featured {
    background: #F9FAFB;
    border: 2px solid var(--text-primary);
    padding: 20px;
}

.news-article.featured .news-headline {
    font-size: 20px;
}

.news-article.featured::after {
    content: '★ IN EVIDENZA';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-primary);
    background: #F3F4F6;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.1em;
}

.panel-title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.badge-count {
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    min-width: 24px;
    text-align: center;
}

.badge-count.warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-count.danger {
    background: #fee2e2;
    color: #dc2626;
}

.panel-content {
    padding: 6px;
}

/* === EMPTY STATE === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state i {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    opacity: 0.25;
}

.empty-state span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
}

/* === CARD ITEMS — Neobrutalist === */
.card-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    background: var(--cream);
    border: 1px solid rgba(101,106,118,0.12);
    border-radius: 12px;
    transition: border-color 0.15s ease;
    min-height: 44px;
    margin: 0 12px 6px;
}
.card-item:last-child {
    margin-bottom: 12px;
}
.card-item:active {
    border-color: rgba(101,106,118,0.3);
}

.card-item.selected {
    border-color: var(--ink);
}

.card-item-content {
    flex: 1;
    min-width: 0;
}

.card-item-tagline {
    font-size: 11px;
    font-weight: 600;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
    margin-bottom: 3px;
}

.card-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0c0c0e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    letter-spacing: -0.01em;
    display: block;
}

.card-item-meta {
    font-size: 12px;
    color: #656a76;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-item-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.01em;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.card-item-badge.new {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.card-item-badge.pending {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.card-item-badge.urgent {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* === CHAT VIEW - PREMIUM DESIGN === */
.chat-view {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    transform: none !important;
    background: var(--paper);
    overflow: hidden;
}

.chat-header-bar {
    padding: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.chat-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.header-action-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.header-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-action-btn:active {
    transform: scale(0.92);
}

.header-action-btn i {
    width: 18px;
    height: 18px;
}

/* Services Bar */
.chat-services-bar {
    display: flex;
    gap: 8px;
    padding: 0 24px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chat-services-bar::-webkit-scrollbar {
    display: none;
}

.service-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.service-chip:hover {
    background: var(--yellow);
    border-color: #FCD34D;
}

.service-chip:active {
    transform: scale(0.95);
}

.service-chip i {
    width: 14px;
    height: 14px;
}

.service-chip.ai-chip {
    background: #FEF3C7;
    border-color: #FCD34D;
    color: #B45309;
}

.service-chip.ai-chip i {
    color: #D97706;
}

.chat-recipient {
    display: flex;
    align-items: center;
    gap: 16px;
}

.recipient-avatar {
    width: 44px;
    height: 44px;
    background: var(--ink);
    color: var(--yellow);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.avatar-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--status-success);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 8px var(--status-success);
}

.recipient-info h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.status-online {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--status-success);
}

.status-online .dot {
    width: 8px;
    height: 8px;
    background: var(--status-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--status-success);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px var(--status-success);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.9);
        box-shadow: 0 0 4px var(--status-success);
    }
}

/* === CHAT STREAM === */
.chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 20px 8px;
    background: var(--paper);
    background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.018) 1px, transparent 0);
    background-size: 24px 24px;
    scroll-behavior: smooth;
}

/* Chat Welcome State */
.chat-empty,
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 24px;
}

.chat-welcome-icon,
.chat-empty i {
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.chat-welcome-icon i,
.chat-empty i {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    opacity: 0.6;
}

.chat-empty>i {
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    color: var(--text-muted);
    opacity: 1;
}

.chat-welcome h3,
.chat-empty h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.chat-welcome p,
.chat-empty p {
    font-size: 14px;
    color: var(--text-tertiary);
    max-width: 280px;
    line-height: 1.5;
    margin-bottom: 28px;
}

/* Quick Start Grid */
.quick-start-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 340px;
    width: 100%;
    margin-top: 8px;
}

.quick-start-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.quick-start-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-start-card:active {
    transform: scale(0.96);
    background: var(--bg-secondary);
}

.quick-start-card i {
    width: 28px;
    height: 28px;
    color: var(--text-primary);
}

.quick-start-card span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

/* Composer Attachments Group */
.composer-attachments {
    display: flex;
    gap: 8px;
}

/* Chat Date Separator — WhatsApp pill */
.chat-date {
    text-align: center;
    margin: 16px 0 12px;
    position: relative;
}

.chat-date::before {
    display: none;
}

.chat-date span {
    position: relative;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.04);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Chat Bubbles - WhatsApp-Style Rounded with Avatars */
.chat-bubble-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 3px;
    padding: 0 12px;
    animation: bubbleSlide 0.3s var(--ease-out) forwards;
}

/* Add spacing between different senders */
.chat-bubble-wrapper.incoming + .chat-bubble-wrapper.outgoing,
.chat-bubble-wrapper.outgoing + .chat-bubble-wrapper.incoming {
    margin-top: 14px;
}

@keyframes bubbleSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.chat-bubble-wrapper.incoming {
    justify-content: flex-start;
}

.chat-bubble-wrapper.outgoing {
    justify-content: flex-end;
}

/* ── Chat Avatars ── */
.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.chat-avatar-studio {
    background: var(--ink);
    color: var(--yellow);
}

.chat-avatar-client {
    background: #dbeafe;
    color: #2563eb;
    order: 1;
}

/* Hide avatar on consecutive messages from same sender */
.chat-bubble-wrapper.incoming + .chat-bubble-wrapper.incoming .chat-avatar,
.chat-bubble-wrapper.outgoing + .chat-bubble-wrapper.outgoing .chat-avatar {
    visibility: hidden;
}

/* Hide sender label on consecutive messages */
.chat-bubble-wrapper.incoming + .chat-bubble-wrapper.incoming .chat-bubble-sender {
    display: none;
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    min-width: 60px;
}

/* Incoming Messages - Studio (left, white) */
.chat-bubble-wrapper.incoming .chat-bubble {
    background: var(--cream);
    color: var(--ink);
    border-radius: 4px 18px 18px 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Consecutive incoming: no tail */
.chat-bubble-wrapper.incoming + .chat-bubble-wrapper.incoming .chat-bubble {
    border-radius: 18px;
}

/* Outgoing Messages - Client (right, dark) */
.chat-bubble-wrapper.outgoing .chat-bubble {
    background: var(--ink);
    color: var(--cream);
    border-radius: 18px 4px 18px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Consecutive outgoing: no tail */
.chat-bubble-wrapper.outgoing + .chat-bubble-wrapper.outgoing .chat-bubble {
    border-radius: 18px;
}

.chat-bubble-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 3px;
    letter-spacing: 0.01em;
}

.chat-bubble-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-bubble-time {
    font-size: 11px;
    opacity: 0.45;
    text-align: right;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.chat-bubble-time i {
    width: 14px;
    height: 14px;
}

/* Mobile: smaller avatars */
@media (max-width: 767px) {
    .chat-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    .chat-bubble-wrapper {
        gap: 6px;
        padding: 0 8px;
    }
    .chat-bubble {
        max-width: 78%;
    }
}

/* === CHAT COMPOSER — Rounded Modern === */
.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 10px;
    padding-bottom: calc(8px + var(--safe-bottom) + 72px);
    background: var(--cream);
    border-top: 1px solid rgba(0,0,0,0.04);
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .chat-composer {
        padding-bottom: 10px;
        padding: 10px 16px;
    }
}

.composer-attachments {
    display: flex;
    gap: 4px;
}

.btn-attach {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-attach:hover {
    background: var(--bg-secondary);
    color: var(--ink);
}

.btn-attach:active {
    transform: scale(0.9);
    background: var(--bg-tertiary);
}

.btn-attach i {
    width: 20px;
    height: 20px;
}

.input-field {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: 22px;
    padding: 10px 18px;
    transition: all 0.15s ease;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.input-field:focus-within {
    background: #fff;
    border-color: var(--border-light);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.input-field input,
.input-field textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    font-weight: 400;
    resize: none;
    outline: none;
    max-height: 120px;
    color: var(--ink);
    line-height: 1.45;
    -webkit-appearance: none;
    appearance: none;
}

.input-field input::placeholder,
.input-field textarea::placeholder {
    color: var(--muted);
}

.btn-send {
    width: 42px;
    height: 42px;
    background: var(--ink);
    border: none;
    border-radius: 50%;
    color: var(--cream);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-send:active {
    transform: scale(0.92);
    box-shadow: none;
}

.btn-send i {
    width: 16px;
    height: 16px;
}

/* === BOTTOM NAV - Modern Floating === */
.bottom-nav {
    position: fixed;
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 62px;
    padding: 0 6px;
    padding-bottom: var(--safe-bottom);
    background: var(--ink);
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    flex: 1;
    min-width: 0;
}

.nav-item:hover {
    color: rgba(255,255,255,0.7);
}

.nav-item i, .nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.7;
}

.nav-item span:not(.nav-badge) {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.nav-item.active::before {
    display: none;
}

.nav-item.nav-ai {
    color: rgba(255,255,255,0.4);
}

.nav-item.nav-ai.active {
    color: #ffffff;
}

/* ── Nav Slider Indicator ── */
.nav-slider {
    position: absolute;
    top: 6px;
    height: calc(100% - 12px - var(--safe-bottom));
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-lg);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    z-index: 0;
    pointer-events: none;
}

.nav-item {
    z-index: 1;
}

.nav-item.active {
    background: transparent;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    min-width: 16px;
    height: 16px;
    background: var(--status-error);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--ink);
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 13, 13, 0.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-overlay.hidden {
    display: none;
}

.modal-panel {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--cream);
    border: none;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
}

@keyframes modalSlide {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.modal-header h2 i {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.about-modal-header {
    background: var(--bg-secondary);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-group i {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.btn-close-pill {
    width: 34px;
    height: 34px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}
.btn-close-pill:hover {
    background: var(--bg-tertiary);
}
.btn-close-pill:active {
    transform: scale(0.9);
}

.btn-close-pill i {
    width: 16px;
    height: 16px;
}

/* === SCANNER === */
.scanner-state {
    display: none;
    padding: 24px;
}

.scanner-state.active {
    display: block;
}

.camera-box {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--text-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.camera-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.camera-placeholder i {
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
}

.camera-placeholder p {
    font-size: 13px;
}

.camera-frame {
    position: absolute;
    inset: 18px;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: var(--accent-primary);
    border-style: solid;
    border-width: 3px;
}

.corner.tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 10px;
}

.corner.tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 4px 0 0;
}

.corner.bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 4px;
}

.corner.br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 4px 0;
}

.capture-btn {
    width: 68px;
    height: 68px;
    background: var(--text-primary);
    border: none;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

.capture-ring {
    width: 52px;
    height: 52px;
    border: 4px solid white;
    border-radius: 50%;
}

.scanner-hint {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
}

/* Analyzing State */
#scanner-analyzing {
    text-align: center;
    padding: 56px 24px;
}

.analyzing-anim {
    width: 90px;
    height: 90px;
    margin: 0 auto 28px;
    position: relative;
}

.analyzing-anim::before,
.analyzing-anim::after {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    opacity: 0;
    animation: ringExpand 2s ease-out infinite;
}

.analyzing-anim::after {
    animation-delay: 0.6s;
}

@keyframes ringExpand {
    0% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.anim-circle {
    width: 90px;
    height: 90px;
    background: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {

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

    50% {
        transform: scale(1.04);
    }
}

.anim-circle i {
    width: 40px;
    height: 40px;
    color: white;
}

#scanner-analyzing h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

#scanner-analyzing p {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Result */
.preview-box {
    aspect-ratio: 4/3;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 2px solid var(--border-light);
    margin-bottom: 18px;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.quality-box {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
}

.quality-box.success {
    background: var(--status-success-bg);
    border: 2px solid var(--status-success);
}

.quality-box.warning {
    background: var(--status-warning-bg);
    border: 2px solid var(--status-warning);
}

.quality-box.error {
    background: var(--status-error-bg);
    border: 2px solid var(--status-error);
}

.quality-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.quality-header i {
    width: 18px;
    height: 18px;
}

.quality-header strong {
    font-size: 13px;
    font-weight: 600;
}

.quality-box.success .quality-header {
    color: var(--status-success);
}

.quality-box.warning .quality-header {
    color: var(--status-warning);
}

.quality-box.error .quality-header {
    color: var(--status-error);
}

.quality-box p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 26px;
}

/* Quality Feedback (Scanner AI Result) */
.quality-feedback {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
}

.quality-feedback.good {
    background: var(--status-success-bg);
    border: 2px solid var(--status-success);
}

.quality-feedback.warning {
    background: var(--status-warning-bg);
    border: 2px solid var(--status-warning);
}

.quality-feedback.error {
    background: var(--status-error-bg);
    border: 2px solid var(--status-error);
}

.quality-feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.quality-feedback-header i {
    width: 20px;
    height: 20px;
}

.quality-feedback.good .quality-feedback-header {
    color: var(--status-success);
}

.quality-feedback.good .quality-feedback-header i {
    color: var(--accent-primary);
}

.quality-feedback.warning .quality-feedback-header {
    color: var(--status-warning);
}

.quality-feedback-header strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-analysis-details {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-analysis-details strong {
    color: var(--text-primary);
    font-weight: 600;
}

.quality-feedback p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.action-row {
    display: flex;
    gap: 12px;
}

.btn-secondary,
.btn-primary {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: all 0.15s ease;
}

.btn-secondary {
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--ink);
}
.btn-secondary:hover {
    background: var(--paper);
    border-color: var(--border-dark);
}

.btn-primary {
    background: var(--ink);
    border: none;
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary i,
.btn-primary i {
    width: 18px;
    height: 18px;
}

.btn-primary.full {
    width: 100%;
}

/* Error State */
#scanner-error {
    text-align: center;
    padding: 44px 24px;
}

.error-icon {
    width: 68px;
    height: 68px;
    background: var(--status-error-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.error-icon i {
    width: 30px;
    height: 30px;
    color: var(--status-error);
}

#scanner-error h3 {
    font-size: 17px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

#scanner-error p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 22px;
}

/* ═══════════════════════════════════════════════════════════════
   Privacy & F24 Views — Editorial Warm Design
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero Banner ── */
.pv-hero-banner {
    background: var(--ink);
    border-radius: var(--radius-2xl);
    padding: 28px 24px 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    animation: pvHeroIn 0.5s var(--ease-out) forwards;
    opacity: 0;
    transform: translateY(10px);
}
@keyframes pvHeroIn {
    to { opacity: 1; transform: translateY(0); }
}

.pv-hero-banner-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 80% 20%, rgba(124, 58, 237, 0.12), transparent),
        radial-gradient(ellipse 50% 80% at 10% 80%, rgba(254, 249, 195, 0.06), transparent);
    pointer-events: none;
}

.pv-hero-banner-amber .pv-hero-banner-bg {
    background:
        radial-gradient(ellipse 80% 60% at 80% 20%, rgba(217, 119, 6, 0.15), transparent),
        radial-gradient(ellipse 50% 80% at 10% 80%, rgba(254, 249, 195, 0.08), transparent);
}

.pv-hero-banner-content {
    position: relative;
    z-index: 1;
}

.pv-hero-shield {
    width: 48px;
    height: 48px;
    background: rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.pv-hero-shield i {
    width: 24px;
    height: 24px;
    color: #c4b5fd;
}
.pv-hero-shield-amber {
    background: rgba(217, 119, 6, 0.2);
}
.pv-hero-shield-amber i {
    color: #fcd34d;
}

.pv-hero-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--cream);
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.pv-hero-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin: 6px 0 0;
    line-height: 1.5;
    max-width: 340px;
}

/* Trust badges */
.pv-trust-badges {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pv-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.pv-trust-badge i {
    width: 11px;
    height: 11px;
}

/* ── Cards ── */
.pv-card {
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    margin-bottom: 12px;
    overflow: hidden;
    animation: pvCardIn 0.4s var(--ease-out) forwards;
    opacity: 0;
    transform: translateY(8px);
}
.pv-card:nth-child(2) { animation-delay: 0.05s; }
.pv-card:nth-child(3) { animation-delay: 0.1s; }
.pv-card:nth-child(4) { animation-delay: 0.15s; }
.pv-card:nth-child(5) { animation-delay: 0.2s; }
.pv-card:nth-child(6) { animation-delay: 0.25s; }
.pv-card:nth-child(7) { animation-delay: 0.3s; }
.pv-card:nth-child(8) { animation-delay: 0.35s; }
.pv-card:nth-child(9) { animation-delay: 0.4s; }
.pv-card:nth-child(10) { animation-delay: 0.45s; }

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

.pv-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.pv-card-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pv-card-icon i { width: 17px; height: 17px; }
.pv-icon-purple { background: #ede9fe; }
.pv-icon-purple i { color: #7c3aed; }
.pv-icon-blue { background: #dbeafe; }
.pv-icon-blue i { color: #2563eb; }
.pv-icon-amber { background: #fef3c7; }
.pv-icon-amber i { color: #d97706; }
.pv-icon-green { background: #dcfce7; }
.pv-icon-green i { color: #16a34a; }

.pv-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.01em;
}
.pv-card-sub {
    font-size: 11px;
    color: var(--muted);
    display: block;
    margin-top: 2px;
}
.pv-card-body {
    padding: 14px 16px;
}
.pv-scroll-200 { max-height: 200px; overflow-y: auto; }
.pv-scroll-250 { max-height: 250px; overflow-y: auto; }

.pv-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Info boxes ── */
.pv-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pv-info-box {
    padding: 14px 16px;
    background: var(--paper);
    border-radius: var(--radius-lg);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 3px solid var(--border-medium);
    transition: border-color 0.15s ease;
}
.pv-info-box:hover {
    border-left-color: #7c3aed;
}
.pv-info-box strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* ── Rights buttons ── */
.pv-rights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
@media (max-width: 400px) {
    .pv-rights-grid { grid-template-columns: 1fr; }
}

.pv-right-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    background: var(--paper);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    cursor: pointer;
    text-align: center;
    width: 100%;
    font-family: inherit;
    transition: all 0.2s var(--ease-out);
}
.pv-right-btn:hover {
    background: var(--cream);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.pv-right-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}
.pv-right-emoji {
    font-size: 26px;
    line-height: 1;
}
.pv-right-btn strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.3;
}
.pv-right-btn small {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

.pv-right-danger {
    background: #fef2f2;
    border-color: #fecaca;
    grid-column: 1 / -1;
    flex-direction: row;
    padding: 14px 16px;
    text-align: left;
    gap: 12px;
}
.pv-right-danger:hover {
    background: #fee2e2;
    border-color: #f87171;
}
.pv-right-danger strong {
    color: var(--status-error);
}

/* Info note — full width in grid */
.pv-info-note {
    padding: 14px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    font-size: 12px;
    color: #1e40af;
    line-height: 1.6;
    grid-column: 1 / -1;
}
.pv-info-note strong {
    color: #1e40af;
}
.pv-info-note-spaced {
    margin-top: 4px;
}

/* ── Export button ── */
.pv-export-btn {
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    color: var(--ink);
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 5px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.pv-export-btn:hover {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}

/* ── Footer ── */
.pv-footer {
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.pv-footer a {
    font-size: 13px;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    padding: 8px 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    transition: all 0.15s ease;
}
.pv-footer a:hover {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}
.pv-footer .pv-footer-garante {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    border: none;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pv-footer .pv-footer-garante:hover {
    background: transparent;
    color: var(--ink);
}
.pv-footer p {
    font-size: 10px;
    color: var(--text-muted);
    margin: 0;
    max-width: 280px;
    line-height: 1.4;
}

/* ── F24 empty state ── */
.f24-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 20px;
    text-align: center;
}
.f24-empty-icon {
    width: 56px;
    height: 56px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.f24-empty-icon i {
    width: 26px;
    height: 26px;
    color: #16a34a;
}
.f24-empty-state strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}
.f24-empty-state p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0 0 8px;
    line-height: 1.5;
}
.f24-empty-hint {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 260px;
    line-height: 1.4;
}

/* ═══ Theme / Accent / Font Size Pickers ═══ */

/* Logo upload */
.logo-upload-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo-upload-preview {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--paper);
    border: 1.5px dashed var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.logo-upload-preview:hover {
    border-color: var(--ink);
    background: var(--bg-secondary);
}
.logo-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.logo-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.logo-preview-placeholder i {
    width: 20px;
    height: 20px;
    color: var(--muted);
}
.logo-preview-placeholder span {
    font-size: 9px;
    font-weight: 600;
    color: var(--muted);
}
.logo-upload-info p {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

/* When custom logo is active, override header brand */
.brand-icon.has-custom-logo {
    filter: none !important;
    border-radius: var(--radius-sm);
}

/* Theme picker */
.theme-picker {
    display: flex;
    gap: 6px;
}
.theme-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: var(--paper);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.theme-option i { width: 15px; height: 15px; }
.theme-option:hover { border-color: var(--border-medium); }
.theme-option.active {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}
.theme-option.active i { color: var(--yellow); }

/* Accent picker */
.accent-picker {
    display: flex;
    gap: 8px;
}
.accent-dot {
    width: 36px;
    height: 36px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    padding: 3px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.accent-dot span {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}
.accent-dot:hover { transform: scale(1.1); }
.accent-dot.active {
    border-color: var(--ink);
    transform: scale(1.15);
}

/* Font size picker */
.fontsize-picker {
    display: flex;
    gap: 6px;
}
.fontsize-option {
    flex: 1;
    padding: 10px 8px;
    background: var(--paper);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}
.fontsize-option[data-size="small"] { font-size: 12px; }
.fontsize-option[data-size="medium"] { font-size: 15px; }
.fontsize-option[data-size="large"] { font-size: 19px; }
.fontsize-option:hover { border-color: var(--border-medium); }
.fontsize-option.active {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}

/* ═══ Dark Theme ═══ */
[data-theme="dark"] {
    --ink: #f5f0e8;
    --paper: #141210;
    --cream: #1e1c19;
    --yellow: #fef9c3;
    --muted: #8c857c;
    --stone: #2a2724;

    --bg-primary: var(--paper);
    --bg-secondary: var(--stone);
    --bg-tertiary: #3a3632;
    --bg-card: var(--cream);
    --bg-elevated: var(--cream);
    --bg-dark: #f5f0e8;

    --text-primary: #f5f0e8;
    --text-secondary: #c4beb5;
    --text-tertiary: var(--muted);
    --text-muted: #6b655c;
    --text-inverse: #141210;

    --accent-primary: #f5f0e8;
    --accent-secondary: #d9d4cc;

    --border-light: #2a2724;
    --border-medium: #3a3632;
    --border-dark: #4a4540;
    --border-accent: #f5f0e8;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .app-header { background: #0d0b09; }
[data-theme="dark"] .bottom-nav { background: #0d0b09; }
[data-theme="dark"] .neo-kpi-hero { background: #f5f0e8; }
[data-theme="dark"] .neo-kpi-hero-num { color: #141210; }
[data-theme="dark"] .neo-kpi-hero-text strong { color: #141210; }
[data-theme="dark"] .neo-kpi-hero-text span { color: rgba(20,18,16,0.5); }
[data-theme="dark"] .neo-kpi-hero-icon { background: rgba(20,18,16,0.1); }
[data-theme="dark"] .neo-kpi-hero-icon i { color: #141210; }
[data-theme="dark"] .neo-kpi-hero-arrow { color: rgba(20,18,16,0.3); }
[data-theme="dark"] .chat-bubble-wrapper.outgoing .chat-bubble { background: #f5f0e8; color: #141210; }
[data-theme="dark"] .chat-avatar-client { background: #dbeafe; color: #2563eb; }
[data-theme="dark"] .btn-send { background: #f5f0e8; color: #141210; }
[data-theme="dark"] .neo-dash-action { background: #f5f0e8; color: #141210; }
[data-theme="dark"] .pv-hero-banner { background: #0d0b09; }
[data-theme="dark"] .settings-input { background: #2a2724; }
[data-theme="dark"] .theme-option { background: #2a2724; }
[data-theme="dark"] .fontsize-option { background: #2a2724; }
[data-theme="dark"] .pv-info-box { background: #2a2724; }
[data-theme="dark"] .pv-right-btn { background: #2a2724; }

/* ═══ Accent Colors ═══ */
[data-accent="blue"] {
    --accent-primary: #2563eb;
    --accent-secondary: #1d4ed8;
}
[data-accent="blue"] .neo-kpi-hero { background: #2563eb; }
[data-accent="blue"] .btn-primary { background: #2563eb; }
[data-accent="blue"] .btn-send { background: #2563eb; }
[data-accent="blue"] .nav-item.active { background: rgba(37, 99, 235, 0.2); }
[data-accent="blue"] .neo-dash-action:not(.neo-dash-action-ghost) { background: #2563eb; }

[data-accent="purple"] {
    --accent-primary: #7c3aed;
    --accent-secondary: #6d28d9;
}
[data-accent="purple"] .neo-kpi-hero { background: #7c3aed; }
[data-accent="purple"] .btn-primary { background: #7c3aed; }
[data-accent="purple"] .btn-send { background: #7c3aed; }
[data-accent="purple"] .nav-item.active { background: rgba(124, 58, 237, 0.2); }
[data-accent="purple"] .neo-dash-action:not(.neo-dash-action-ghost) { background: #7c3aed; }

[data-accent="green"] {
    --accent-primary: #059669;
    --accent-secondary: #047857;
}
[data-accent="green"] .neo-kpi-hero { background: #059669; }
[data-accent="green"] .btn-primary { background: #059669; }
[data-accent="green"] .btn-send { background: #059669; }
[data-accent="green"] .nav-item.active { background: rgba(5, 150, 105, 0.2); }
[data-accent="green"] .neo-dash-action:not(.neo-dash-action-ghost) { background: #059669; }

[data-accent="orange"] {
    --accent-primary: #ea580c;
    --accent-secondary: #c2410c;
}
[data-accent="orange"] .neo-kpi-hero { background: #ea580c; }
[data-accent="orange"] .btn-primary { background: #ea580c; }
[data-accent="orange"] .btn-send { background: #ea580c; }
[data-accent="orange"] .nav-item.active { background: rgba(234, 88, 12, 0.2); }
[data-accent="orange"] .neo-dash-action:not(.neo-dash-action-ghost) { background: #ea580c; }

[data-accent="rose"] {
    --accent-primary: #e11d48;
    --accent-secondary: #be123c;
}
[data-accent="rose"] .neo-kpi-hero { background: #e11d48; }
[data-accent="rose"] .btn-primary { background: #e11d48; }
[data-accent="rose"] .btn-send { background: #e11d48; }
[data-accent="rose"] .nav-item.active { background: rgba(225, 29, 72, 0.2); }
[data-accent="rose"] .neo-dash-action:not(.neo-dash-action-ghost) { background: #e11d48; }

/* ═══ Font Size Modes ═══ */
[data-fontsize="small"] { font-size: 13px; }
[data-fontsize="small"] .neo-dash-greeting { font-size: 18px; }
[data-fontsize="small"] .pv-hero-title { font-size: 18px; }
[data-fontsize="small"] .panel-title { font-size: 13px; }

[data-fontsize="large"] { font-size: 17px; }
[data-fontsize="large"] .neo-dash-greeting { font-size: 24px; }
[data-fontsize="large"] .pv-hero-title { font-size: 24px; }
[data-fontsize="large"] .panel-title { font-size: 17px; }
[data-fontsize="large"] .card-item-title { font-size: 16px; }
[data-fontsize="large"] .card-item-meta { font-size: 14px; }
[data-fontsize="large"] .chat-bubble { font-size: 17px; }
[data-fontsize="large"] .nav-item span:not(.nav-badge) { font-size: 11px; }

/* === SETTINGS MODAL === */
.settings-content {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Profile Photo Upload */
.profile-photo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-photo-wrapper {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-photo-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--ink);
    color: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-display);
    overflow: hidden;
}

.profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: white;
}

.profile-photo-overlay i {
    width: 22px;
    height: 22px;
}

.profile-photo-wrapper:hover .profile-photo-overlay,
.profile-photo-wrapper:active .profile-photo-overlay {
    opacity: 1;
}

.profile-photo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-photo-hint {
    font-size: 13px;
    color: var(--muted);
}

.profile-photo-remove-btn {
    background: none;
    border: none;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: var(--status-error);
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.profile-photo-remove-btn:hover {
    text-decoration: underline;
}

.settings-section {
    margin-bottom: 26px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.settings-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.settings-input {
    width: 100%;
    padding: 10px 16px;
    background: var(--paper);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    color: var(--ink);
    outline: none;
    transition: all 0.15s ease;
}
.settings-input:focus {
    background: #fff;
    border-color: var(--border-medium);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.settings-input:focus {
    border-color: var(--ink);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

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

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.settings-toggle input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
}

.settings-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.settings-toggle input[type="checkbox"]:checked {
    background: var(--text-primary);
}

.settings-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

/* Settings Divider */
.settings-divider {
    height: 1px;
    background: var(--border-light);
    margin: 24px 0 16px;
}

/* Settings Link Buttons */
.settings-link-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 10px;
}

.settings-link-btn i {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
}

.settings-link-btn .chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.settings-link-btn span {
    flex: 1;
    text-align: left;
}

.settings-link-btn.logout-btn {
    background: var(--status-error-bg);
    border-color: transparent;
    color: var(--status-error);
    margin-bottom: 0;
}

.settings-link-btn.logout-btn i {
    color: var(--status-error);
}

/* === ABOUT MODAL === */
.about-content {
    padding: 28px 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.about-hero {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 2px solid var(--border-light);
}

.about-logo {
    height: 44px;
    margin-bottom: 14px;
}

.about-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.trust-badge i {
    width: 14px;
    height: 14px;
    color: var(--status-success);
}

.about-section {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--border-light);
}

.about-section:last-of-type {
    border-bottom: none;
}

.about-section-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.about-section-icon i {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.about-section-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.about-section-content strong {
    color: var(--text-primary);
}

.about-footer {
    text-align: center;
    padding-top: 22px;
    border-top: 2px solid var(--border-light);
}

.about-footer p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.about-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.about-version {
    font-size: 11px;
    color: var(--text-muted) !important;
}

/* === DESKTOP RESPONSIVE === */

/* Tablet */
@media (min-width: 768px) {
    .app-main {
        padding: 32px;
    }

    .view {
        padding: 32px;
        max-width: 100%;
        margin: 0;
    }

    .welcome-card {
        padding: 32px 36px;
    }

    .welcome-card h1 {
        font-size: 32px;
    }

    .kpi-value {
        font-size: 44px;
    }

    .bottom-nav {
        max-width: 360px;
    }

    .modal-panel {
        border-radius: var(--radius-2xl);
        margin-bottom: 32px;
    }
}

/* Desktop — Neobrutalist Sidebar */
@media (min-width: 1024px) {
    .app-container {
        flex-direction: row;
        height: 100vh;
    }

    /* ═══ Desktop Sidebar ═══ */
    .app-header {
        flex-direction: column;
        width: 80px;
        min-width: 80px;
        height: 100vh;
        padding: 0;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        flex-shrink: 0;
        justify-content: flex-start;
        gap: 0;
        background: var(--ink);
        position: sticky;
        top: 0;
        left: 0;
        align-items: center;
        overflow: hidden;
    }

    .header-brand {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Logo frame */
    .brand-icon {
        height: 26px;
        width: 26px;
        padding: 4px;
        border: none;
        box-shadow: none;
        filter: brightness(0) invert(1);
    }

    .brand-label { display: none; }

    .desktop-nav {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        flex: 1;
        overflow-y: auto;
        padding: 6px 0;
    }

    /* Nav items — matches studio #main-sidebar .nav-item */
    .desktop-nav-btn {
        display: grid;
        justify-items: center;
        align-content: center;
        gap: 4px;
        width: calc(100% - 12px);
        min-height: 64px;
        padding: 8px 6px;
        font-size: 8px;
        font-weight: 700;
        font-family: var(--font-body);
        color: rgba(255,255,255,0.35);
        background: transparent;
        border: 2px solid transparent;
        cursor: pointer;
        text-align: center;
        position: relative;
        transition: all 0.12s;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        line-height: 1.1;
        margin: 0 auto 4px;
    }

    .desktop-nav-btn:hover {
        background: rgba(255,255,255,0.08);
        color: rgba(255,255,255,0.85);
    }
    .desktop-nav-btn:hover i { color: rgba(255,255,255,0.85) !important; }

    .desktop-nav-btn i {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .desktop-nav-btn>span:not(.nav-badge) {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 64px;
    }

    .desktop-nav-btn.active {
        background: rgba(255,255,255,0.12);
        color: #ffffff;
        font-weight: 700;
        border-color: transparent;
    }
    .desktop-nav-btn.active i { color: #ffffff !important; }

    .desktop-nav-btn.active::before { display: none; }

    .desktop-nav-btn .nav-badge {
        position: absolute;
        top: 6px;
        right: 4px;
        margin-left: 0;
        min-width: 16px;
        height: 16px;
        font-size: 9px;
        padding: 0 4px;
    }

    .desktop-nav-btn.desktop-nav-ai { color: rgba(255,255,255,0.4); }
    .desktop-nav-btn.desktop-nav-ai:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.08); }
    .desktop-nav-btn.desktop-nav-ai.active { color: #ffffff; background: rgba(255,255,255,0.12); }

    .nav-divider { display: none; }

    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 4px;
        margin-top: auto;
        padding: 8px 0;
        border-top: 1px solid rgba(255,255,255,0.08);
        align-items: center;
    }

    .user-pill {
        width: calc(100% - 12px);
        height: auto;
        padding: 8px 6px;
        justify-content: center;
        background: transparent;
        border: 1px solid transparent;
        margin: 0 auto;
    }
    .user-pill:hover {
        background: rgba(255,255,255,0.08);
        border-color: transparent;
    }
    .user-pill:hover .user-avatar { color: #ffffff; }

    .user-pill>span { display: none; }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
        background: transparent;
        color: rgba(255,255,255,0.5);
        border: 2px solid rgba(254,249,195,0.3);
    }

    .btn-icon-soft {
        width: calc(100% - 12px);
        height: auto;
        min-height: 40px;
        color: rgba(255,255,255,0.35);
        border: 2px solid transparent;
        margin: 0 auto;
    }
    .btn-icon-soft:hover {
        background: var(--yellow);
        color: var(--ink);
        border-color: var(--yellow);
    }

    .charts-row { flex-direction: row; }
    .bottom-nav { display: none; }

    .app-main {
        flex: 1;
        padding: 0;
    }

    .view {
        padding: 32px 40px;
        padding-bottom: 32px;
        max-width: 100%;
        margin: 0;
    }

    .view.chat-view {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .modal-overlay { align-items: center; }
    .modal-panel { margin: 0; }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .view {
        max-width: 100%;
        padding: 40px 48px;
    }

    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .welcome-card h1 {
        font-size: 36px;
    }

    .kpi-value {
        font-size: 48px;
    }
}

/* === SCADENZE & DOCUMENTI MODALS === */
.scadenze-modal,
/* === DOCUMENTI MODAL — Jakarta/Zinc Bottom-Sheet === */

.documenti-modal {
    max-height: 85vh;
    width: 100%;
    max-width: 480px;
    border-radius: 10px;
    overflow: hidden;
    animation: doc-sheet-up .4s cubic-bezier(.16,1,.3,1) both;
}

@media (min-width: 768px) {
    .documenti-modal {
        border-radius: 10px;
        animation: doc-fade-scale .35s cubic-bezier(.16,1,.3,1) both;
    }
}

@keyframes doc-sheet-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes doc-fade-scale {
    from { transform: scale(.96) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.scadenze-modal .modal-header,
.documenti-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 2px solid #E4E4E7;
    background: rgba(250,250,250,.85);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
    position: sticky;
    top: 0;
    z-index: 2;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-group i {
    width: 20px;
    height: 20px;
    color: #3F3F46;
}

.modal-title-group h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #18181B;
    margin: 0;
    letter-spacing: -.01em;
}

.scadenze-modal .modal-body,
.documenti-modal .modal-body {
    padding: 16px 18px 24px;
    max-height: calc(85vh - 62px);
    overflow-y: auto;
    background: #FAFAFA;
}

.scadenze-list,
.documenti-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    color: #A1A1AA;
}

.loading-spinner i {
    width: 28px;
    height: 28px;
    margin-bottom: 14px;
    color: #71717A;
}

.loading-spinner i.spin {
    animation: spin .9s cubic-bezier(.4,0,.2,1) infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #A1A1AA;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    text-align: center;
}

.empty-state i {
    width: 40px;
    height: 40px;
    color: #D4D4D8;
    margin-bottom: 14px;
    stroke-width: 1.5;
}

.empty-state h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #3F3F46;
    margin-bottom: 6px;
}

.empty-state p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #A1A1AA;
    line-height: 1.5;
}

.documenti-modal .modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F4F5;
    border: 2px solid #E4E4E7;
    border-radius: 10px;
    color: #71717A;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease, color .15s ease;
}

.documenti-modal .modal-close:active {
    background: #E4E4E7;
    color: #18181B;
}

.documenti-modal .modal-close i {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.scadenza-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-solid);
}

.scadenza-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.scadenza-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.scadenza-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.scadenza-badge.urgent {
    background: var(--status-error-bg);
    color: var(--status-error);
}

.scadenza-badge.soon {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.scadenza-badge.normal {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.scadenza-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.scadenza-date i {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
}

.scadenza-description {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* — Document card rows — */

.documento-card {
    background: #FFFFFF;
    border: 2px solid #E4E4E7;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow .2s cubic-bezier(.16,1,.3,1),
                border-color .2s cubic-bezier(.16,1,.3,1);
    animation: doc-card-in .35s cubic-bezier(.16,1,.3,1) both;
}

.documento-card:active {
    box-shadow: 0 0 0 3px rgba(24,24,27,.06);
    border-color: #D4D4D8;
}

@keyframes doc-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.documenti-list .documento-card:nth-child(1) { animation-delay: 0s; }
.documenti-list .documento-card:nth-child(2) { animation-delay: .04s; }
.documenti-list .documento-card:nth-child(3) { animation-delay: .08s; }
.documenti-list .documento-card:nth-child(4) { animation-delay: .12s; }
.documenti-list .documento-card:nth-child(5) { animation-delay: .16s; }
.documenti-list .documento-card:nth-child(n+6) { animation-delay: .2s; }

.documento-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.documento-icon.pdf {
    background: #FEE2E2;
    color: #DC2626;
}

.documento-icon.image {
    background: #DCFCE7;
    color: #16A34A;
}

.documento-icon.doc {
    background: #DBEAFE;
    color: #2563EB;
}

.documento-icon.excel {
    background: #D1FAE5;
    color: #059669;
}

.documento-icon.generic {
    background: #F4F4F5;
    color: #71717A;
}

.documento-icon i {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
}

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

.documento-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #18181B;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.01em;
}

.documento-meta {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11.5px;
    color: #A1A1AA;
    display: flex;
    gap: 6px;
    align-items: center;
}

.documento-meta span + span::before {
    content: '\00B7';
    margin-right: 6px;
    color: #D4D4D8;
}

.documento-action {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #F4F4F5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #71717A;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}

.documento-action:active {
    background: #E4E4E7;
    color: #18181B;
}

.documento-action i {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* === ENHANCED CHAT MESSAGES === */

/* Message Actions Menu */
.message-actions {
    position: absolute;
    top: -10px;
    right: 8px;
    display: flex;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    background: var(--cream);
    padding: 4px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
}

.chat-bubble-wrapper:hover .message-actions,
.chat-bubble-wrapper:active .message-actions {
    opacity: 1;
    visibility: visible;
}

.chat-bubble {
    position: relative;
}

.action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.12s ease;
}

.action-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.action-btn:active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(0.9);
}

.action-btn.delete:hover {
    background: #fef2f2;
    color: var(--status-error);
}

.action-btn.delete:active {
    background: var(--status-error-bg);
    color: var(--status-error);
}

.action-btn i {
    width: 14px;
    height: 14px;
}

/* Chat Bubble Footer */
.chat-bubble-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.chat-bubble-status {
    display: flex;
    align-items: center;
}

.chat-bubble-status i {
    width: 14px;
    height: 14px;
}

.chat-bubble-status.read i {
    color: var(--accent-primary);
}

.chat-edited {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    margin-left: 6px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* Chat input editing mode */
#chat-input.editing {
    border-color: var(--accent-primary);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Chat Attachments */
.chat-attachment {
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
}

.chat-attachment.image {
    position: relative;
    max-width: 280px;
}

.chat-attachment.image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

.attachment-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-attachment.image:active .attachment-overlay {
    opacity: 1;
}

.attachment-overlay i {
    width: 32px;
    height: 32px;
    color: white;
}

.chat-attachment.file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.chat-bubble-wrapper.outgoing .chat-attachment.file {
    background: rgba(255, 255, 255, 0.1);
}

.chat-bubble-wrapper.outgoing .attachment-name {
    color: var(--cream);
}

.chat-bubble-wrapper.outgoing .attachment-action {
    color: rgba(255, 255, 255, 0.6);
}

.attachment-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attachment-icon.pdf {
    background: #E53E3E;
    color: white;
}

.attachment-icon.image {
    background: #38A169;
    color: white;
}

.attachment-icon.doc {
    background: #3182CE;
    color: white;
}

.attachment-icon.excel {
    background: #48BB78;
    color: white;
}

.attachment-icon.generic {
    background: #A0AEC0;
    color: white;
}

.attachment-icon i {
    width: 20px;
    height: 20px;
}

.attachment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-action {
    font-size: 11px;
    color: var(--accent-primary);
}

/* Image Preview Overlay */
.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg);
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.image-preview-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.btn-preview-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* Upload Preview Modal */
.upload-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.upload-preview-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.upload-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-light);
}

.upload-preview-header h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.upload-preview-content {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.upload-preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.upload-preview-file {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
}

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

.upload-preview-icon.pdf {
    background: #E53E3E;
    color: white;
}

.upload-preview-icon.image {
    background: #38A169;
    color: white;
}

.upload-preview-icon.doc {
    background: #3182CE;
    color: white;
}

.upload-preview-icon.excel {
    background: #48BB78;
    color: white;
}

.upload-preview-icon.generic {
    background: #A0AEC0;
    color: white;
}

.upload-preview-icon i {
    width: 28px;
    height: 28px;
}

.upload-preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.upload-preview-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-preview-size {
    font-size: 12px;
    color: var(--text-tertiary);
}

.upload-preview-options {
    padding: 0 20px 16px;
}

.upload-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 12px;
}

.upload-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.option-icon i {
    width: 18px;
    height: 18px;
}

.upload-option span:last-child {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-caption-wrapper {
    margin-top: 8px;
}

.upload-caption-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    font-size: 14px;
    color: var(--text-primary);
}

.upload-caption-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.upload-preview-actions {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 2px solid var(--border-light);
}

.upload-preview-actions .btn-secondary,
.upload-preview-actions .btn-primary {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: none;
}

.upload-preview-actions .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.upload-preview-actions .btn-primary {
    background: var(--accent-primary);
    color: white;
}

.upload-preview-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-notification i {
    width: 18px;
    height: 18px;
}

.toast-notification.success {
    background: var(--status-success);
}

.toast-notification.error {
    background: var(--status-error);
}

.toast-notification.info {
    background: var(--accent-primary);
}

/* Editing State */
#chat-input.editing {
    border-color: var(--accent-primary);
    background: rgba(217, 119, 6, 0.05);
}

/* Quick Start Grid in Welcome */
.chat-welcome .quick-start-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.chat-welcome .quick-start-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.chat-welcome .quick-start-card:active {
    transform: scale(0.97);
}

.chat-welcome .quick-start-card i {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.chat-welcome .quick-start-card span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* === SCADENZE & DOCUMENTI — Helios-inspired rounded cards === */

.card-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f7f7f8;
    border: none;
}

.card-item-icon i {
    width: 16px;
    height: 16px;
    color: #656a76;
}

/* Task items — clean white card */
.card-item.task {
    background: var(--cream);
    border: 1px solid rgba(101,106,118,0.12);
    border-radius: 12px;
    margin: 0 12px 6px;
    padding: 10px 14px;
    gap: 12px;
}

.card-item.task .card-item-icon {
    background: #fffbeb;
}
.card-item.task .card-item-icon i {
    color: #b45309;
}

/* Deadline items */
.card-item.deadline {
    background: var(--cream);
    border: 1px solid rgba(101,106,118,0.12);
    border-radius: 12px;
    margin: 0 12px 6px;
    padding: 10px 14px;
    gap: 12px;
}

.card-item.deadline .card-item-icon {
    background: #fef7ed;
}
.card-item.deadline .card-item-icon i {
    color: #c4956a;
}

/* Document request items */
.card-item.doc-request {
    background: var(--cream);
    border: 1px solid rgba(101,106,118,0.12);
    border-radius: 12px;
    margin: 0 12px 6px;
    padding: 10px 14px;
    flex-wrap: wrap;
}

.card-item.doc-request .card-item-icon {
    background: #f5f3ff;
}

.card-item.doc-request .card-item-icon i {
    color: #7c3aed;
}

/* Card actions container */
.card-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* F24 Approve / FEA Sign buttons */
.btn-approve {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    white-space: nowrap;
}

.btn-approve.btn-fes {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.25);
}
.btn-approve.btn-fes:hover {
    background: rgba(16, 185, 129, 0.25);
}

.btn-approve.btn-fea {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 2px solid rgba(59, 130, 246, 0.25);
}
.btn-approve.btn-fea:hover {
    background: rgba(59, 130, 246, 0.25);
}

.btn-approve:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════
   F24 PAYMENTS — Premium Redesign
   ═══════════════════════════════════════════════ */

/* Summary strip */
.f24-summary {
    display: flex;
    gap: 8px;
    padding: 0 0 16px;
    overflow-x: auto;
}
.f24-summary-card {
    flex: 1;
    min-width: 0;
    padding: 14px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    text-align: center;
}
.f24-summary-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.f24-summary-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* F24 card */
.f24-card {
    margin: 0 0 12px;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}
.f24-card:hover {
    box-shadow: var(--shadow-md);
}

.f24-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.f24-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.f24-card-icon.fes { background: #ecfdf5; }
.f24-card-icon.fea { background: #eff6ff; }

.f24-card-info { flex: 1; min-width: 0; }

.f24-card-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.f24-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.f24-card-due {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.f24-card-mode {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.f24-card-mode.fes {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.f24-card-mode.fea {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.f24-card-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--paper);
    border-top: 1px solid var(--border-light);
}

.f24-card-attach {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-decoration: none;
    min-width: 0;
}
.f24-card-attach:hover { color: var(--text-primary); }
.f24-card-attach svg { flex-shrink: 0; }
.f24-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.f24-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    white-space: nowrap;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}
.f24-btn.fes {
    background: #059669;
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.f24-btn.fes:hover {
    background: #047857;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.f24-btn.reject {
    background: #b91c1c;
    color: #fff;
}
.f24-btn.reject:hover {
    background: #991b1b;
    transform: translateY(-1px);
}
.f24-btn.other {
    background: #0f172a;
    color: #fff;
}
.f24-btn.other:hover {
    background: #020617;
    transform: translateY(-1px);
}
.f24-btn.fea {
    background: #2563eb;
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.f24-btn.fea:hover {
    background: #1d4ed8;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.f24-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.f24-btn .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Empty state */
.f24-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
    text-align: center;
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
}
.f24-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
}
.f24-empty h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.f24-empty p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    max-width: 260px;
}

/* FES Approval Modal — Premium */
.f24-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: f24FadeIn 0.2s ease;
}
@keyframes f24FadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.f24-modal {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: f24SlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes f24SlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.f24-modal-header {
    padding: 32px 28px 20px;
    text-align: center;
}
.f24-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-xl);
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
    border: 2px solid #a7f3d0;
}
.f24-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}
.f24-modal-amount {
    font-size: 32px;
    font-weight: 700;
    color: #059669;
    letter-spacing: -0.03em;
    margin: 8px 0 0;
}
.f24-modal-due {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.f24-modal-legal {
    margin: 0 28px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
}
.f24-modal-legal-title {
    font-size: 10px;
    font-weight: 700;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 4px;
}
.f24-modal-legal-text {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.55;
    margin: 0;
}

.f24-modal-alt {
    margin: 12px 28px 0;
    padding: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
}
.f24-modal-alt-label {
    display: block;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
}
.f24-modal-alt-select,
.f24-modal-alt-note {
    width: 100%;
    border: 1px solid #d4d4d8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: #fff;
    font-family: var(--font-body);
}
.f24-modal-alt-note {
    margin-top: 8px;
    resize: vertical;
    min-height: 72px;
}
.f24-modal-reject {
    width: 100%;
    margin-top: 8px;
    padding: 11px;
    border-radius: 10px;
    border: 1px solid #fca5a5;
    background: #fff1f2;
    color: #9f1239;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.f24-modal-reject:hover {
    background: #ffe4e6;
}
.f24-modal-reject:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.f24-modal-actions {
    display: flex;
    gap: 10px;
    padding: 20px 28px 28px;
}
.f24-modal-cancel {
    flex: 1;
    padding: 14px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.15s;
}
.f24-modal-cancel:hover { background: var(--bg-tertiary); }
.f24-modal-approve {
    flex: 2;
    padding: 14px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.f24-modal-approve:hover {
    background: #047857;
    box-shadow: var(--shadow-sm);
}
.f24-modal-approve:disabled { opacity: 0.5; cursor: not-allowed; }
.f24-modal-approve .btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.f24-modal-reject .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(15,23,42,0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Success overlay */
.f24-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255,255,255,0.95);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: f24FadeIn 0.3s ease;
}
.f24-success-content {
    text-align: center;
    padding: 40px;
    animation: f24SuccessPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes f24SuccessPop {
    0% { opacity: 0; transform: scale(0.8); }
    50% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}
.f24-success-check {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
}
.f24-success-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}
.f24-success-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 28px;
}
.f24-success-btn {
    padding: 12px 32px;
    background: var(--text-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.15s;
}
.f24-success-btn:hover { opacity: 0.85; }

/* F24 Card Document Preview */
.f24-card-preview {
    padding: 0 16px 4px;
    cursor: pointer;
}
.f24-card-preview img {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    display: block;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    background: var(--bg-secondary);
}
.f24-card-preview canvas {
    border: 2px solid var(--border-light);
    background: #fff;
}
.f24-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
}

/* In-app Document Viewer */
.f24-doc-viewer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.6);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: f24FadeIn 0.2s ease;
}
.f24-doc-viewer {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    height: min(85vh, 800px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: f24SlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.f24-doc-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 2px solid var(--border-light);
    flex-shrink: 0;
    background: var(--bg-card);
}
.f24-doc-viewer-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 8px;
}

/* Consent spinner */
.consent-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* Upload button styling */
.btn-upload-doc {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(139, 92, 246, 0.12);
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    color: #7C3AED;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.btn-upload-doc:hover {
    background: rgba(139, 92, 246, 0.2);
}

.btn-upload-doc:active {
    opacity: 0.9;
}

.btn-upload-doc i {
    width: 16px;
    height: 16px;
}

/* Complete task button */
.btn-complete-task {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #16a34a;
    cursor: pointer;
    transition: border-color 0.15s ease;
    flex-shrink: 0;
}

.btn-complete-task:active {
    border-color: #16a34a;
}

.btn-complete-task i {
    width: 15px;
    height: 15px;
}

/* Priority badge */
.priority-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    letter-spacing: 0.01em;
    margin-left: 6px;
    border: 1px solid transparent;
}

.priority-badge.high {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Countdown badges */
.countdown {
    font-size: 10px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 10px;
    white-space: nowrap;
    background: var(--status-success-bg);
    color: var(--status-success);
}

.countdown.urgent {
    background: var(--status-error-bg);
    color: var(--status-error);
    animation: pulseUrgent 2s ease-in-out infinite;
}

@keyframes pulseUrgent {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.countdown.ok {
    background: var(--status-success-bg);
    color: var(--status-success);
}

/* Rejection reason styling */
.rejection-reason {
    color: var(--status-error) !important;
    font-style: italic;
    background: var(--status-error-bg);
    padding: 6px 10px;
    border-radius: 10px;
    margin-top: 8px;
}

/* Scadenze section styling */
.scadenze-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.scadenze-section-header .section-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scadenze-section-header .section-icon i {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

.scadenze-section-header h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.scadenze-section-header .section-count {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    background: var(--accent-light);
    color: var(--accent-primary);
    border-radius: 10px;
}

/* Documenti section header */
.documenti-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.documenti-section-header .section-icon {
    width: 32px;
    height: 32px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.documenti-section-header .section-icon i {
    width: 16px;
    height: 16px;
    color: #8B5CF6;
}

.documenti-section-header h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.documenti-section-header .section-count {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
    border-radius: 10px;
}

/* Archive view styles moved to archive-view.css */

/* === DOCUMENT PREVIEW MODAL — Jakarta/Zinc === */

.doc-preview-modal {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    animation: doc-preview-in .35s cubic-bezier(.16,1,.3,1) both;
}

@keyframes doc-preview-in {
    from { opacity: 0; transform: scale(.97); }
    to { opacity: 1; transform: scale(1); }
}

@media (min-width: 768px) {
    .doc-preview-modal {
        width: 90vw;
        height: 88vh;
        max-width: 1100px;
        border-radius: var(--radius-xl);
        overflow: hidden;
        box-shadow: 0 24px 48px -12px rgba(0,0,0,.18),
                    0 0 0 1px rgba(0,0,0,.05);
    }
}

.doc-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.doc-preview-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.doc-preview-title i {
    width: 18px;
    height: 18px;
    color: #71717A;
    flex-shrink: 0;
    stroke-width: 1.8;
}

.doc-preview-title span {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 650;
    color: #18181B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.01em;
}

.doc-preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-preview-download {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ink);
    color: #ffffff;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: opacity .15s ease;
}

.btn-preview-download:active {
    opacity: .8;
}

.btn-preview-download i {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

.btn-preview-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--paper);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.btn-preview-close:active {
    background: #E4E4E7;
    color: #18181B;
}

.btn-preview-close i {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.doc-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F4F5;
    overflow: hidden;
    position: relative;
}

.doc-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.doc-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.preview-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #A1A1AA;
}

.preview-loader i {
    width: 28px;
    height: 28px;
    color: #71717A;
}

.preview-loader span {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #A1A1AA;
}

.preview-unsupported {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 32px;
    text-align: center;
}

.preview-unsupported i {
    width: 40px;
    height: 40px;
    color: #D4D4D8;
    stroke-width: 1.5;
}

.preview-unsupported p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: #71717A;
    line-height: 1.5;
}

.preview-unsupported .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #18181B;
    color: #FAFAFA;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: .01em;
}

.preview-unsupported .btn-primary:active {
    opacity: .8;
}

/* All archive/timeline/skeleton/pagination/filter styles in archive-view.css */

/* === PIPELINE STATUS TRACKER === */
.pipeline-panel {
    border-color: rgba(99, 102, 241, 0.12);
    background: #fafaff;
}

.pipeline-panel .panel-header {
    background: transparent;
    border-color: rgba(99, 102, 241, 0.08);
}

.pipeline-tracker {
    padding: 4px 0;
}

.pipeline-dots-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0 4px;
}

/* Grey track line behind dots */
.pipeline-track {
    position: absolute;
    top: 50%;
    left: 16px;
    right: 16px;
    height: 2px;
    background: #e2e8f0;
    transform: translateY(-50%);
    border-radius: 10px;
}

/* Filled portion of track */
.pipeline-track-fill {
    position: absolute;
    top: 50%;
    left: 16px;
    height: 2px;
    background: #6366f1;
    transform: translateY(-50%);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Dot base */
.pipeline-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Completed dot */
.pipeline-dot.completed {
    background: #6366f1;
    border-color: #6366f1;
}

/* Active dot */
.pipeline-dot.active {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    animation: dotPulse 2s ease-in-out infinite;
}

.pipeline-dot.active::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
}

@keyframes dotPulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.08);
    }
}

/* Labels row */
.pipeline-labels-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0 0;
}

.pipeline-label {
    font-size: 9px;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
    flex: 1;
    line-height: 1.2;
}

.pipeline-label.active {
    color: #4f46e5;
    font-weight: 600;
}

.pipeline-desc {
    text-align: center;
    background: rgba(99, 102, 241, 0.04);
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid rgba(99, 102, 241, 0.08);
}

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

/* ===============================================
   SMART DOCUMENT CHECKLIST
   =============================================== */

.checklist-view {
    padding: 20px;
}

.checklist-header {
    margin-bottom: 20px;
    animation: cardEnter 0.4s var(--ease-out) forwards;
    opacity: 0;
}

.checklist-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.checklist-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    color: var(--text-primary);
}

.checklist-header h2 i {
    width: 22px;
    height: 22px;
    color: var(--text-tertiary);
}

.checklist-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Progress Card */
.checklist-progress-card {
    background: var(--cream);
    border: 1px solid var(--border-light);
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    animation: cardEnter 0.4s ease 0.05s forwards;
    opacity: 0;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.progress-pct {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: var(--stone);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--ink);
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar-fill::after { display: none; }

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

    100% {
        transform: translateX(100%);
    }
}

/* Checklists Container */
.checklists-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checklist-empty {
    margin-top: 40px;
}

/* Single Checklist Group */
.checklist-group {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-solid);
    animation: panelEnter 0.4s var(--ease-out) forwards;
    opacity: 0;
}

.checklist-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.checklist-group-header:hover {
    background: var(--bg-tertiary);
}

.checklist-group-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.checklist-group-title {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-group-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.checklist-group-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checklist-mini-progress {
    width: 48px;
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.checklist-mini-progress-fill {
    height: 100%;
    background: var(--status-success);
    border-radius: var(--radius-full);
    transition: width 0.4s var(--ease-out);
}

.checklist-group-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.checklist-group-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.checklist-group-chevron i {
    width: 18px;
    height: 18px;
}

.checklist-group.collapsed .checklist-group-chevron {
    transform: rotate(-90deg);
}

.checklist-group.collapsed .checklist-items {
    display: none;
}

/* Deadline Badge */
.deadline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.deadline-badge.urgent {
    background: var(--status-error-bg);
    color: var(--status-error);
}

.deadline-badge.soon {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.deadline-badge.ok {
    background: var(--status-success-bg);
    color: var(--status-success);
}

/* Checklist Items */
.checklist-items {
    padding: 4px 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-light);
    transition: background var(--transition-fast);
}

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

.checklist-item:hover {
    background: var(--bg-secondary);
}

/* Status Indicator */
.checklist-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.checklist-status-icon i {
    width: 16px;
    height: 16px;
}

.checklist-status-icon.pending {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 2px dashed var(--border-medium);
}

.checklist-status-icon.uploaded {
    background: #EFF6FF;
    color: #3B82F6;
    border: 2px solid #BFDBFE;
}

.checklist-status-icon.approved {
    background: var(--status-success-bg);
    color: var(--status-success);
    border: 2px solid #A7F3D0;
}

.checklist-status-icon.rejected {
    background: var(--status-error-bg);
    color: var(--status-error);
    border: 2px solid #FECACA;
}

/* Item Content */
.checklist-item-content {
    flex: 1;
    min-width: 0;
}

.checklist-item-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.checklist-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.checklist-item-status-text {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.checklist-item-status-text.uploaded {
    color: #3B82F6;
}

.checklist-item-status-text.approved {
    color: var(--status-success);
}

.checklist-item-status-text.rejected {
    color: var(--status-error);
}

/* Item Actions */
.checklist-item-action {
    flex-shrink: 0;
}

.btn-checklist-upload {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-checklist-upload i {
    width: 14px;
    height: 14px;
}

.btn-checklist-upload:hover {
    background: #27272A;
    box-shadow: var(--shadow-sm);
}

.btn-checklist-upload.reupload {
    background: var(--status-error-bg);
    color: var(--status-error);
}

.btn-checklist-upload.reupload:hover {
    background: #FEE2E2;
}

.btn-checklist-view {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--status-success-bg);
    color: var(--status-success);
    border: none;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-checklist-view i {
    width: 14px;
    height: 14px;
}

.btn-checklist-view:hover {
    background: #D1FAE5;
}

/* Rejection note */
.rejection-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--status-error-bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--status-error);
    line-height: 1.4;
}

.rejection-note i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Upload Modal for Checklist */
.checklist-upload-modal {
    max-width: 440px;
    width: calc(100% - 32px);
}

/* Responsive */
@media (max-width: 768px) {
    .checklist-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .checklist-item-action {
        width: 100%;
    }

    .btn-checklist-upload,
    .btn-checklist-view {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
}

/* ====================================
   TESORERIA — Treasury Dashboard
   ==================================== */

.treasury-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.treasury-kpi-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.treasury-kpi-card.kpi-accent {
    background: #fafafa;
    border-color: #d4d4d8;
}

.treasury-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.treasury-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.treasury-kpi-sub {
    font-size: 11px;
    color: #94a3b8;
}

.treasury-duo-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.treasury-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.treasury-amount {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

/* Aging bars */
.aging-bar-track {
    display: flex;
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    margin-bottom: 8px;
}

.aging-bar-seg {
    min-width: 4px;
    transition: width 0.3s ease;
}

.aging-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aging-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
}

.aging-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Aging pills for open items */
.aging-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
}

.aging-ok {
    background: #dcfce7;
    color: #16a34a;
}

.aging-late {
    background: #fef3c7;
    color: #d97706;
}

.aging-warn {
    background: #fed7aa;
    color: #ea580c;
}

.aging-critical {
    background: #fee2e2;
    color: #dc2626;
}

/* Monthly Chart */
.chart-bars-container {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding: 0 4px;
    margin-bottom: 8px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.chart-bar-pair {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    width: 100%;
    height: 120px;
}

.chart-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.4s ease;
}

.chart-bar-revenue {
    background: #6366f1;
}

.chart-bar-cost {
    background: #e2e8f0;
}

.chart-label {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 4px;
}

/* Treasury list items */
.treasury-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 2px solid #f1f5f9;
}

.treasury-list-item:last-child {
    border-bottom: none;
}

.treasury-list-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.treasury-list-primary {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.treasury-list-secondary {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.treasury-list-amount {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Responsive */
@media (max-width: 640px) {
    .treasury-kpi-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .treasury-kpi-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
    }

    .treasury-kpi-value {
        font-size: 18px;
    }

    .treasury-duo-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .chart-bars-container {
        height: 100px;
    }
}

/* ─── Fisco Chat Entry Card ──────────────────────────────────────────────── */
.pn-fisco-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #faf5ff 0%, #eff6ff 100%);
    border: 2px solid #ddd6fe;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.pn-fisco-card:hover {
    border-color: #c4b5fd;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.pn-fisco-card:active {
    transform: translateY(0);
}

.pn-fisco-card.used {
    background: #fafaf9;
    border-color: #e8e3db;
    cursor: default;
}

.pn-fisco-card.used:hover {
    transform: none;
    box-shadow: none;
}

.pn-fisco-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.pn-fisco-card-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.pn-fisco-card.used .pn-fisco-card-icon {
    background: #e8e3db;
    box-shadow: none;
}

.pn-fisco-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #1c1917;
    letter-spacing: -.01em;
    margin-bottom: 2px;
}

.pn-fisco-card-sub {
    font-size: 11px;
    color: #78716c;
}

.pn-fisco-card-cta {
    padding: 7px 14px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.pn-fisco-card.used .pn-fisco-card-cta {
    background: #e8e3db;
    color: #a8a29e;
    box-shadow: none;
}

/* ─── Fisco Chat — dedicated view ─────────────────────────────────────────── */
.view.fisco-view {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.fisco-view-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 16px 11px;
    border-bottom: 2px solid #e8e3db;
    flex-shrink: 0;
    background: #ffffff;
}

.fisco-view-back {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f5f4f2;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #78716c;
    transition: background 0.15s;
    flex-shrink: 0;
}

.fisco-view-back:hover {
    background: #e8e3db;
}

.fisco-view-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.fisco-view-title {
    font-size: 13px;
    font-weight: 700;
    color: #1c1917;
    letter-spacing: -0.02em;
}

.fisco-view-sub {
    font-size: 10px;
    color: #a8a29e;
    margin-top: 1px;
}

.fisco-view-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    background: #fafaf9;
}

.fisco-msg {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    max-width: 88%;
}

.fisco-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.fisco-msg-bubble {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #1c1917;
    background: #f5f4f2;
    border: 2px solid #e8e3db;
}

.fisco-msg.user .fisco-msg-bubble {
    background: #292524;
    color: #ffffff;
    border-color: #292524;
    border-radius: 14px 14px 4px 14px;
}

.fisco-msg.ai .fisco-msg-bubble {
    border-radius: 14px 14px 14px 4px;
}

.fisco-msg-icon {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-top: 2px;
}

.fisco-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 9px 13px;
    border-radius: 14px 14px 14px 4px;
    background: #f5f4f2;
    border: 2px solid #e8e3db;
    width: fit-content;
}

.fisco-typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #a8a29e;
    animation: fisco-bounce 1.2s ease-in-out infinite;
}

.fisco-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.fisco-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fisco-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

.fisco-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 9px 16px 7px;
    flex-shrink: 0;
    background: #ffffff;
    border-top: 2px solid #f0ece8;
}

.fisco-chip {
    padding: 5px 11px;
    border-radius: 10px;
    background: #f5f4f2;
    border: 2px solid #e8e3db;
    font-size: 11px;
    font-weight: 500;
    color: #44403c;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.fisco-chip:hover {
    background: #e8e3db;
    border-color: #d6d0c6;
}

.fisco-chat-input-row {
    display: flex;
    gap: 9px;
    align-items: flex-end;
    padding: 10px 14px 16px;
    border-top: 2px solid #e8e3db;
    flex-shrink: 0;
    background: #ffffff;
}

.fisco-chat-input {
    flex: 1;
    padding: 10px 13px;
    border: 2px solid #e8e3db;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    resize: none;
    line-height: 1.4;
    max-height: 90px;
    overflow-y: auto;
    color: #1c1917;
    background: #fafaf9;
    font-family: inherit;
    transition: border-color 0.15s;
}

.fisco-chat-input:focus {
    border-color: #6366f1;
    background: #fff;
}

.fisco-chat-input::placeholder {
    color: #a8a29e;
}

.fisco-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #292524;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.12s;
}

.fisco-chat-send:hover {
    background: #44403c;
    transform: translateY(-1px);
}

.fisco-chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.fisco-quota-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px 18px;
    border-top: 2px solid #e8e3db;
    flex-shrink: 0;
    background: #fafaf9;
}

.fisco-quota-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.fisco-quota-title {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 600;
    color: #1c1917;
}

.fisco-quota-sub {
    margin: 0;
    font-size: 10.5px;
    color: #a8a29e;
}


/* ============================================
   APPUNTAMENTI — Client Portal (Jakarta/Zinc)
   ============================================ */

/* ── Entrance animation ── */
@keyframes apptCardEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes apptPulse {
    0%, 100% { opacity: .35; }
    50%      { opacity: .8; }
}

/* ── Section header (frosted glass, matches chat-header-bar) ── */
.cl-appt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}

.cl-appt-header-text {
    flex: 1;
    min-width: 0;
}

.cl-appt-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #18181B);
    margin: 0 0 2px;
    letter-spacing: -0.01em;
}

.cl-appt-sub {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: var(--text-tertiary, #71717A);
    margin: 0;
    font-weight: 400;
}

/* ── Month nav ── */
.cl-appt-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cl-appt-nav-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light, #E4E4E7);
    border-radius: 50%;
    background: var(--bg-card, #fff);
    color: var(--text-secondary, #3F3F46);
    cursor: pointer;
    transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.cl-appt-nav-btn:hover {
    background: var(--bg-secondary, #F4F4F5);
    border-color: var(--border-medium, #D4D4D8);
}

.cl-appt-nav-btn:active {
    transform: scale(0.94);
}

.cl-appt-nav-btn i {
    width: 15px;
    height: 15px;
}

.cl-appt-month-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #18181B);
    white-space: nowrap;
    text-transform: capitalize;
    min-width: 120px;
    text-align: center;
}

/* ── Mini month calendar ── */
.cl-appt-cal-wrap {
    margin: 16px 20px;
    border: 2px solid var(--border-light, #E4E4E7);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card, #fff);
    box-shadow: var(--shadow-sm);
    animation: apptCardEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cl-appt-cal-days-hdr {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-secondary, #F4F4F5);
    border-bottom: 2px solid var(--border-light, #E4E4E7);
}

.cl-appt-cal-day-name {
    padding: 8px 2px;
    text-align: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #A1A1AA);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.cl-appt-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cl-appt-cal-cell {
    min-height: 36px;
    padding: 4px 2px;
    text-align: center;
    position: relative;
}

.cl-appt-cal-cell.cl-other-month .cl-appt-day-num {
    color: var(--text-muted, #A1A1AA);
    opacity: 0.5;
}

.cl-appt-cal-cell.cl-today .cl-appt-day-num {
    background: var(--text-primary, #18181B);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.cl-appt-day-num {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, #3F3F46);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 50%;
    transition: background .12s, color .12s;
}

/* ── Loading / empty states (matches chat-welcome) ── */
.appt-client-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-tertiary, #71717A);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.appt-client-state p {
    margin: 0;
    max-width: 260px;
}

.cl-appt-empty-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #F4F4F5);
    border-radius: 10px;
    color: var(--text-muted, #A1A1AA);
    box-shadow: var(--shadow-sm);
}

.cl-appt-empty-icon svg {
    width: 24px;
    height: 24px;
}

.client-spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--border-light, #E4E4E7);
    border-top-color: var(--text-primary, #18181B);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Section label (above cards) ── */
.appt-section-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #A1A1AA);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 0 20px;
    margin: 4px 0 10px;
}

/* ── Booking cards container ── */
#appt-client-cards {
    padding: 0 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Booking card (matches inbox quick-start-card style) ── */
.appt-booking-card {
    background: var(--bg-card, #fff);
    border: 2px solid var(--border-light, #E4E4E7);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow .2s cubic-bezier(0.16, 1, 0.3, 1);
    animation: apptCardEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.appt-booking-card:nth-child(2) { animation-delay: .06s; }
.appt-booking-card:nth-child(3) { animation-delay: .12s; }
.appt-booking-card:nth-child(4) { animation-delay: .18s; }
.appt-booking-card:nth-child(5) { animation-delay: .24s; }

.appt-booking-card:hover {
    border-color: var(--border-medium, #D4D4D8);
}

.appt-booking-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.appt-booking-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--bg-secondary, #F4F4F5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-primary, #18181B);
}

.appt-booking-card-icon i {
    width: 20px;
    height: 20px;
}

.appt-booking-card-info {
    flex: 1;
    min-width: 0;
}

.appt-booking-card-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #18181B);
    margin: 0 0 2px;
    line-height: 1.3;
}

.appt-booking-card-desc {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: var(--text-tertiary, #71717A);
    margin: 0;
    line-height: 1.4;
}

/* ── Badges (pill style, matches service-chip) ── */
.appt-booking-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.appt-client-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.appt-client-badge.fiscal   { background: #EFF6FF; color: #1D4ED8; }
.appt-client-badge.labor    { background: #F0FDF4; color: #166534; }
.appt-client-badge.finance  { background: #FFFBEB; color: #92400E; }
.appt-client-badge.general  { background: var(--bg-secondary, #F4F4F5); color: var(--text-tertiary, #71717A); }
.appt-client-badge.remote   { background: #ECFDF5; color: #065F46; }
.appt-client-badge.in-person { background: #F5F3FF; color: #6D28D9; }
.appt-client-badge.virtual  { background: #ECFDF5; color: #065F46; }
.appt-client-badge.custom   { background: #FEF3C7; color: #92400E; }
.appt-client-badge.both     { background: var(--bg-secondary, #F4F4F5); color: var(--text-tertiary, #71717A); }

/* ── Action buttons (matches inbox btn-send / btn-attach) ── */
.appt-booking-card-actions {
    display: flex;
    gap: 8px;
}

.appt-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 20px;
    border-radius: var(--radius-full);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.appt-book-btn:active {
    transform: scale(0.97);
}

.appt-book-btn-primary {
    background: var(--text-primary, #18181B);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.appt-book-btn-primary:hover {
    background: #27272A;
    box-shadow: var(--shadow-sm);
}

.appt-book-btn-secondary {
    background: var(--bg-secondary, #F4F4F5);
    color: var(--text-secondary, #3F3F46);
    border: 1px solid var(--border-light, #E4E4E7);
}

.appt-book-btn-secondary:hover {
    background: var(--bg-tertiary, #E4E4E7);
    border-color: var(--border-medium, #D4D4D8);
}

.appt-book-btn i {
    width: 15px;
    height: 15px;
}

/* ── Booking embed modal ── */
.booking-embed-content {
    background: var(--bg-card, #fff);
    border-radius: 10px;
    width: 100%;
    max-width: 760px;
    height: 88vh;
    max-height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0,0,0,.1));
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.booking-embed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--bg-secondary, #F4F4F5);
    border-bottom: 2px solid var(--border-light, #E4E4E7);
    flex-shrink: 0;
}

.booking-embed-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #18181B);
}

.booking-embed-actions {
    display: flex;
    gap: 6px;
}

.booking-embed-actions .btn-icon-soft {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #fff);
    border: 2px solid var(--border-light, #E4E4E7);
    color: var(--text-tertiary, #71717A);
    cursor: pointer;
    transition: all .12s;
}

.booking-embed-actions .btn-icon-soft:hover {
    background: var(--bg-tertiary, #E4E4E7);
    color: var(--text-primary, #18181B);
}

.booking-embed-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #fff;
}

/* ── Booking embed fallback ── */
.booking-embed-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 32px;
    text-align: center;
    height: 100%;
}

.booking-embed-fallback p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text-tertiary, #71717A);
    line-height: 1.6;
    margin: 0;
    max-width: 300px;
}

.booking-embed-fallback .appt-book-btn-primary {
    flex: none;
    padding: 12px 24px;
    font-size: 14px;
}

/* ── Slot picker modal (bottom sheet) ── */
.slot-picker-panel {
    background: var(--bg-card, #fff);
    border-radius: 10px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0,0,0,.1));
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.slot-picker-header {
    padding: 22px 24px;
    border-bottom: 2px solid var(--border-light, #E4E4E7);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-picker-header h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #18181B);
}

.slot-picker-header p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: var(--text-tertiary, #71717A);
    margin: 4px 0 0;
}

.slot-picker-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-secondary, #F4F4F5);
    border: 2px solid var(--border-light, #E4E4E7);
    color: var(--text-tertiary, #71717A);
    cursor: pointer;
    font-size: 18px;
    transition: all .12s;
}

.slot-picker-close:hover {
    background: var(--bg-tertiary, #E4E4E7);
    color: var(--text-primary, #18181B);
}

.slot-picker-body {
    padding: 20px 24px 28px;
}

.slot-picker-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary, #71717A);
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.slot-picker-date-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-light, #E4E4E7);
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text-primary, #18181B);
    background: var(--bg-card, #fff);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}

.slot-picker-date-input:focus {
    outline: none;
    border-color: var(--text-primary, #18181B);
    box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.06);
}

.slot-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* ── Slot buttons ── */
.slot-btn {
    padding: 11px 8px;
    border: 1.5px solid var(--border-light, #E4E4E7);
    border-radius: 10px;
    background: var(--bg-card, #fff);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #3F3F46);
    cursor: pointer;
    transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.slot-btn:hover {
    border-color: var(--text-primary, #18181B);
    color: var(--text-primary, #18181B);
    background: var(--bg-secondary, #F4F4F5);
}

.slot-btn:active {
    transform: scale(0.96);
}

.slot-btn.selected {
    border-color: var(--text-primary, #18181B);
    background: var(--text-primary, #18181B);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.slot-picker-empty {
    text-align: center;
    padding: 24px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text-tertiary, #71717A);
}

.slot-picker-loading {
    text-align: center;
    padding: 24px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text-tertiary, #71717A);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .cl-appt-header {
        padding: 16px 16px 12px;
        flex-wrap: wrap;
    }

    .cl-appt-cal-wrap {
        margin: 12px 16px;
    }

    #appt-client-cards {
        padding: 0 16px 20px;
    }

    .appt-booking-card {
        padding: 14px;
    }

    .appt-booking-card-actions {
        flex-direction: column;
    }

    .booking-embed-content {
        border-radius: 10px;
        height: 100%;
        max-height: 100%;
    }
}

@media (min-width: 768px) {
    .booking-embed-content {
        border-radius: 10px;
        margin: auto;
    }

    .slot-picker-panel {
        border-radius: 10px;
        margin: auto;
    }
}

/* ===========================================
   ARCHIVE UPLOAD LINKS - Notion-style cards
   =========================================== */
.upload-links-panel {
    margin-bottom: 24px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: none;
    box-shadow: none;
}

.upload-links-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
    padding-bottom: 0;
    border-bottom: none;
}

.upload-links-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0c0c0e;
    letter-spacing: -0.02em;
}

.upload-links-head h3 i {
    display: none;
}

.upload-links-head p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #656a76;
}

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

.upload-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    background: #f7f7f8;
    transition: background 0.15s ease;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.upload-link-card:active {
    background: #ededef;
}

.upload-link-card-left {
    min-width: 0;
    flex: 1;
}

.upload-link-card-title {
    font-size: 14px;
    font-weight: 620;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-link-card-meta {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.upload-link-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6b7280;
}

.upload-link-card-meta i {
    width: 13px;
    height: 13px;
}

.upload-link-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.upload-link-card-btn:active {
    background: var(--ink);
    border-color: var(--ink);
    color: #ffffff;
}

.upload-link-card-btn i {
    width: 14px;
    height: 14px;
}

@media (max-width: 640px) {
    .upload-links-head {
        flex-direction: column;
        gap: 4px;
    }

    .upload-links-head p {
        white-space: normal;
    }

    .upload-link-card {
        align-items: flex-start;
    }
}

/* === EXPENSES === */
.panel-link-btn {
    border: 1px solid var(--border-light);
    background: var(--paper);
    color: var(--ink);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.panel-link-btn:active {
    transform: scale(0.98);
}

.expense-focus-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 18px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 246, 242, 0.92)),
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.08), transparent 44%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.expense-focus-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expense-focus-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    background: rgba(15, 23, 42, 0.06);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.expense-focus-copy h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    color: var(--ink);
}

.expense-focus-copy p {
    margin: 0;
    max-width: 560px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.expense-focus-status {
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.72);
}

.expense-sync-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.expense-sync-pill.ready {
    background: #ecfdf5;
    color: #047857;
}

.expense-sync-pill.loading {
    background: #eff6ff;
    color: #1d4ed8;
}

.expense-sync-pill.warn {
    background: #fff7ed;
    color: #c2410c;
}

.expense-sync-pill.muted {
    background: #f5f5f4;
    color: #57534e;
}

.expense-focus-status small {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.expenses-home-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 16px 16px;
}

.expense-stat,
.expense-summary-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.expense-stat strong,
.expense-summary-card strong {
    font-size: 22px;
    line-height: 1;
    color: var(--ink);
}

.expense-stat-label,
.expense-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.expense-action-btn,
.expense-toolbar-btn,
.expense-inline-btn {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--ink);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s ease;
}

.expense-action-btn {
    min-height: 100%;
    padding: 12px 14px;
}

.expense-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px;
    position: sticky;
    top: 12px;
    z-index: 4;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    background: rgba(248, 246, 242, 0.88);
    backdrop-filter: blur(16px);
}

.expense-toolbar-btn {
    min-height: 48px;
    padding: 0 16px;
}

.expense-toolbar-btn-secondary,
.expense-inline-btn {
    background: var(--paper);
    color: var(--ink);
}

.expense-upload-console {
    margin-bottom: 16px;
}

.expense-upload-console.hidden {
    display: none;
}

.expense-upload-console-card {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(160deg, rgba(19, 27, 44, 0.96), rgba(36, 43, 60, 0.92)),
        radial-gradient(circle at top right, rgba(148, 163, 184, 0.24), transparent 42%);
    color: #f8fafc;
    padding: 18px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.expense-upload-console-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.expense-upload-console-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.expense-upload-console-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.72);
}

.expense-upload-console-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.expense-upload-console-badge.loading {
    background: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
}

.expense-upload-console-badge.success {
    background: rgba(74, 222, 128, 0.18);
    color: #bbf7d0;
}

.expense-upload-console-badge.error {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

.expense-upload-console-badge.muted {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

.expense-upload-console-head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.expense-upload-console-head p {
    margin: 8px 0 0;
    max-width: 560px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.76);
}

.expense-upload-console-meta {
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.expense-upload-console-meta strong {
    font-size: 24px;
    line-height: 1;
}

.expense-upload-console-meta span {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.62);
}

.expense-upload-progress-track {
    height: 8px;
    margin-top: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.expense-upload-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #93c5fd, #60a5fa);
    transition: width 0.24s ease;
}

.expense-upload-progress-fill.processing {
    background: linear-gradient(90deg, #c4b5fd, #a78bfa);
}

.expense-upload-progress-fill.success {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.expense-upload-progress-fill.error {
    background: linear-gradient(90deg, #fca5a5, #ef4444);
}

.expense-upload-console-status {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.expense-upload-console-logs {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.expense-upload-log {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    line-height: 1.5;
}

.expense-upload-log-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.expense-upload-log.active .expense-upload-log-dot {
    background: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.expense-upload-log.done .expense-upload-log-dot {
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
}

.expense-upload-log.error .expense-upload-log-dot {
    background: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.expense-upload-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.expense-upload-result-item {
    padding: 12px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.expense-upload-result-item span {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.58);
}

.expense-upload-result-item strong {
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
}

.expense-upload-console-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.expense-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.expense-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.expense-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.expense-filter-chip {
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.74);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.expense-filter-chip.active,
.expense-filter-chip:active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.expense-list-caption {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-tertiary);
}

.expense-list-panel {
    min-height: 280px;
}

.expense-item-card {
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.78);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.expense-item-card + .expense-item-card {
    margin-top: 10px;
}

.expense-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.expense-item-top h3 {
    font-size: 15px;
    margin: 0 0 4px;
}

.expense-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.expense-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
    flex-shrink: 0;
}

.expense-item-side strong {
    font-size: 16px;
}

.expense-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.expense-status-pill.pending {
    background: #fff7ed;
    color: #c2410c;
}

.expense-status-pill.validated {
    background: #ecfdf5;
    color: #047857;
}

.expense-deductibility {
    margin-top: 12px;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.expense-deductibility strong {
    font-size: 12px;
}

.expense-deductibility.good {
    background: #ecfdf5;
    color: #047857;
}

.expense-deductibility.warn {
    background: #fffbeb;
    color: #b45309;
}

.expense-deductibility.bad {
    background: #fef2f2;
    color: #b91c1c;
}

.expense-deductibility.muted {
    background: #f5f5f4;
    color: #57534e;
}

.expense-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.expense-inline-btn {
    min-height: 40px;
    padding: 0 12px;
}

.expense-inline-btn-primary {
    background: var(--ink);
    color: #fff;
}

.expense-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.expense-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.expense-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expense-field span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.expense-field input,
.expense-field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 0 14px;
    font-size: 14px;
    color: var(--ink);
    font-family: inherit;
}

.expense-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 6px;
}

.spin {
    animation: spin .9s linear infinite;
}

@media (max-width: 768px) {
    .expense-focus-card {
        flex-direction: column;
    }

    .expense-focus-status {
        min-width: 0;
        width: 100%;
    }

    .expenses-home-summary,
    .expense-summary-grid {
        grid-template-columns: 1fr;
    }

    .expense-upload-result-grid {
        grid-template-columns: 1fr;
    }

    .expense-upload-console-head {
        flex-direction: column;
    }

    .expense-upload-console-meta {
        min-width: 0;
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }

    .expenses-toolbar {
        top: 8px;
    }

    .expense-list-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .expense-filter-group {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .expense-filter-chip {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .expense-action-btn,
    .expense-toolbar-btn,
    .expense-inline-btn {
        width: 100%;
    }

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