/**
 * STOPAZZO - Main Stylesheet
 * Elegant Neutral Theme - Following Mockup Exactly
 * Born to Get Lost 🦙
 */

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

/* ===== CSS Variables ===== */
:root {
    --primary: #2D6A7A;
    --primary-hover: #245A68;
    --primary-light: rgba(45, 106, 122, 0.12);
    --secondary: #D4894A;
    --secondary-light: rgba(212, 137, 74, 0.15);
    --success: #6B8E4E;
    --success-light: rgba(107, 142, 78, 0.15);
    --warning: #D4894A;
    --warning-light: rgba(212, 137, 74, 0.15);
    --danger: #C75D5D;
    --danger-light: rgba(199, 93, 93, 0.15);
    
    --bg-body: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-sidebar: #2C2C2C;
    --bg-secondary: #F5F5F5;
    --bg-hover: #EEEEEE;
    
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #777777;
    --text-light: #FAFAFA;
    --text-on-primary: #FFFFFF;
    
    --border-color: #E0E0E0;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --font-family: 'Inter', -apple-system, sans-serif;
    --sidebar-width: 220px;
}

/* Themes */
[data-theme="terracotta"] { --primary: #D4894A; --primary-hover: #C27A3D; --primary-light: rgba(212, 137, 74, 0.15); }
[data-theme="teal"] { --primary: #3D8B8B; --primary-hover: #2D7A7A; --primary-light: rgba(61, 139, 139, 0.12); }
[data-theme="green"] { --primary: #6B8E4E; --primary-hover: #5A7A40; --primary-light: rgba(107, 142, 78, 0.15); }

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font-family); background: var(--bg-body); color: var(--text-primary); line-height: 1.5; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
[x-cloak] { display: none !important; }

/* ===== Typography ===== */
h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin: 0; }
h2 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin: 0; }
h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-small { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }

/* ===== Layout ===== */
.app-container { display: flex; min-height: 100vh; }
@media (max-width: 900px) { .app-container { flex-direction: column; padding-bottom: 70px; } }

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}
@media (max-width: 900px) { .sidebar { display: none; } }

.sidebar-logo { text-align: center; padding: var(--space-md) 0 var(--space-xl); border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: var(--space-lg); }
.sidebar-logo-icon { font-size: 2.5rem; margin-bottom: var(--space-xs); }
.sidebar-logo img { height: auto; border-radius: var(--radius-sm); margin-bottom: var(--space-xs); }
.sidebar-logo-text { color: var(--text-light); font-weight: 700; font-size: 1.25rem; letter-spacing: 1px; }
.sidebar-logo-tagline { color: var(--primary); font-size: 0.55rem; letter-spacing: 2px; margin-top: 2px; text-transform: uppercase; }

.sidebar-nav { flex: 1; }
.sidebar-nav a, .sidebar-nav button {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 11px 14px; border-radius: var(--radius-md);
    color: var(--text-light); font-size: 0.9rem; font-weight: 400;
    transition: all 0.2s; margin-bottom: 4px; width: 100%; text-align: left; opacity: 0.85;
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background: rgba(255,255,255,0.08); opacity: 1; }
.sidebar-nav a.active, .sidebar-nav button.active { background: var(--primary); color: var(--text-on-primary); font-weight: 600; opacity: 1; }
.sidebar-nav svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-user { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-md); display: flex; align-items: center; gap: var(--space-sm); }
.sidebar-user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: var(--text-on-primary); font-weight: 600; font-size: 0.85rem; }
.sidebar-user-name { color: var(--text-light); font-size: 0.9rem; font-weight: 500; }
.sidebar-user-role { color: var(--text-muted); font-size: 0.75rem; }

/* ===== Main Content ===== */
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
@media (max-width: 900px) { .main-content { margin-left: 0; } }

/* Page Header */
.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    flex-wrap: wrap;
}
.page-header-content { flex: 1; min-width: 200px; }
.page-header h1 { margin-bottom: var(--space-xs); }
.page-header-meta { color: var(--text-muted); font-size: 0.9rem; }
.page-header-actions { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }

/* Page Body */
.page-body { flex: 1; padding: var(--space-xl); }

/* Mobile Header */
.mobile-header { display: none; background: var(--bg-sidebar); padding: 14px var(--space-lg); align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.mobile-header-logo { display: flex; align-items: center; gap: var(--space-sm); color: var(--text-light); font-weight: 700; font-size: 1rem; }
.mobile-header-logo img { max-height: 32px; border-radius: var(--radius-sm); }
.mobile-menu-btn { color: var(--text-light); font-size: 1.5rem; padding: var(--space-sm); }
@media (max-width: 900px) { .mobile-header { display: flex; } }

/* Bottom Navigation */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-top: 1px solid var(--border-color); padding: var(--space-sm) var(--space-md) calc(var(--space-sm) + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-xs) var(--space-sm); color: var(--text-muted); font-size: 0.6rem; transition: color 0.2s; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-fab { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: var(--text-on-primary); display: flex; align-items: center; justify-content: center; font-size: 1.75rem; margin-top: -26px; box-shadow: var(--shadow-md); }
@media (max-width: 900px) { .bottom-nav { display: flex; } }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-color); margin-bottom: var(--space-xl); overflow-x: auto; }
.tab { padding: 10px 16px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; white-space: nowrap; background: transparent; }
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== Day Section ===== */
.day-section { margin-bottom: var(--space-xl); }
.day-section.past { opacity: 0.6; }

.day-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    transition: background 0.2s;
}
.day-header:hover { background: var(--bg-secondary); }

.day-badge {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: var(--text-on-primary); font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
}

.day-info { flex: 1; min-width: 0; }
.day-title { font-weight: 600; font-size: 1rem; }
.day-subtitle { font-size: 0.85rem; color: var(--text-muted); }
.day-meta { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }

/* Items List */
.items-list { display: flex; flex-direction: column; gap: 8px; padding-left: var(--space-xl); margin-bottom: var(--space-md); }

.option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}
.option-card:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); }
.option-card.status-selected { border-left-color: var(--primary); }
.option-card.status-booked { border-left-color: var(--success); }

.item-icon { font-size: 1.25rem; flex-shrink: 0; }
.item-title { flex: 1; font-weight: 500; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.item-time { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.item-price { font-size: 0.85rem; font-weight: 600; color: var(--primary); background: var(--primary-light); padding: 4px 10px; border-radius: var(--radius-sm); flex-shrink: 0; margin-left: auto; }
.item-status { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; cursor: help; }
.item-status.proposed { background: var(--warning); } /* Giallo */
.item-status.selected { background: var(--primary); } /* Blu */
.item-status.booked { background: var(--success); } /* Verde */

/* Extra items for proposals */
.item-meta { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.item-votes { font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }
.item-like-btn { flex-shrink: 0; padding: 4px 8px !important; min-width: auto !important; }

/* Hide meta on small screens to avoid clutter */
@media (max-width: 600px) {
    .item-meta { display: none; }
    .option-card { gap: var(--space-sm); padding: 10px 12px; }
}

.empty-day { padding: var(--space-xl); text-align: center; color: var(--text-muted); }

/* Multi-day items */
.multi-day-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--warning-light);
    color: var(--warning);
    border-radius: var(--radius-sm);
    font-weight: 600;
    white-space: nowrap;
    margin-left: var(--space-xs);
}
.option-card.multi-day-item {
    border-left-color: var(--warning);
}
.option-card.multi-day-continues {
    opacity: 0.7;
    background: var(--bg-secondary);
    border-style: dashed;
}
.option-card.multi-day-continues .item-title {
    font-style: italic;
}
.option-card.multi-day-continues .multi-day-badge {
    background: var(--bg-card);
    color: var(--text-muted);
}

/* ===== Expenses Box (In Itinerary) ===== */
.expenses-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--space-xl);
}
.expenses-box-header {
    padding: 14px var(--space-lg);
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}
.expenses-box-header span:last-child { font-weight: 400; font-size: 0.85rem; color: var(--text-muted); }

.expenses-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.expenses-table th {
    padding: 12px var(--space-lg);
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}
.expenses-table td { padding: 14px var(--space-lg); border-bottom: 1px solid var(--border-color); }
.expenses-table tr:last-child td { border-bottom: none; }
.expenses-table tr:hover td { background: var(--bg-secondary); }
.expenses-table th:nth-child(2), .expenses-table td:nth-child(2) { text-align: right; }
.expense-amount { font-weight: 600; color: var(--primary); }

/* ===== Stats Grid ===== */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); margin-top: var(--space-xl); }
@media (max-width: 768px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-light); }
.stat-icon.secondary { background: var(--secondary-light); }
.stat-icon.success { background: var(--success-light); }
.stat-icon.danger { background: var(--danger-light); }

.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.stat-value { font-size: 1.25rem; font-weight: 700; }
.stat-value.primary { color: var(--primary); }
.stat-value.secondary { color: var(--secondary); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }

/* ===== Cards ===== */
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.card-header { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: var(--space-lg); }
.card-title { font-weight: 600; font-size: 1rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
    padding: 10px 16px; border-radius: var(--radius-md);
    font-size: 0.9rem; font-weight: 500;
    transition: all 0.2s; white-space: nowrap; border: none;
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: var(--text-on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success { background: var(--success); color: var(--text-on-primary); }
.btn-danger { background: var(--danger); color: var(--text-on-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-secondary); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Forms ===== */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-xs); }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    background: var(--bg-card); color: var(--text-primary); font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ===== Modals ===== */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden;
    transition: all 0.2s; padding: var(--space-md);
}
.modal-backdrop.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 500px; max-height: 90vh;
    overflow: hidden; display: flex; flex-direction: column;
    transform: scale(0.95); transition: transform 0.2s;
}
.modal-backdrop.active .modal { transform: scale(1); }
.modal-header { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-title { font-weight: 600; font-size: 1.1rem; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all 0.2s; }
.modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
.modal-body { 
    padding: var(--space-lg); 
    overflow-y: auto; 
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(90vh - 140px);
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.modal-footer { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: var(--space-sm); flex-shrink: 0; }

/* ===== Detail Modal Styles ===== */
.detail-modal-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.detail-type-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}
.detail-header-info { flex: 1; }
.detail-type-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-preview-image {
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.detail-preview-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}
@media (max-width: 480px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.detail-card.detail-card-full {
    grid-column: 1 / -1;
}
.detail-card-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.detail-card-content { flex: 1; min-width: 0; }
.detail-card-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.detail-card-value {
    font-weight: 500;
    word-break: break-word;
}
.detail-card-value.detail-price {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
}
.detail-card-value.detail-description {
    font-weight: 400;
    color: var(--text-secondary);
    white-space: pre-wrap;
}
.detail-card-value.detail-value-small {
    font-size: 0.85rem;
    word-break: break-all;
}
.detail-card-date {
    display: inline;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: var(--space-xs);
}
.detail-card-date::before {
    content: "·";
    margin-right: var(--space-xs);
}

/* Multi-day detail in popup */
.multi-day-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.multi-day-label {
    font-weight: 600;
    color: var(--warning);
}
.multi-day-dates {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Detail Card Split (2 columns) */
.detail-card.detail-card-split .detail-split-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    width: 100%;
}
.detail-split-main {
    flex: 1;
    min-width: 0;
}
.detail-split-action {
    flex-shrink: 0;
    padding-top: 16px;
}

.detail-link {
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
.detail-link:hover { text-decoration: underline; }

.detail-attachments {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.detail-attachments-label {
    font-weight: 600;
    margin-bottom: var(--space-sm);
}
.detail-attachments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 120px;
    overflow-y: auto;
}
.detail-attachment-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}
.detail-attachment-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.detail-attachment-item .doc-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
}
.detail-attachment-item .download-icon {
    font-size: 0.9rem;
    color: var(--primary);
}

.detail-likes-section,
.detail-voting {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.detail-likes-header,
.detail-voting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}
.detail-likes-count { font-size: 1rem; }
.detail-likes-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.liker-chip {
    display: inline-flex;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}
.detail-voting-buttons {
    display: flex;
    gap: var(--space-sm);
}

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* ===== Trip Status ===== */
.trip-status { display: inline-flex; padding: 6px 14px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.trip-status.planning { background: var(--primary-light); color: var(--primary); }
.trip-status.booking { background: var(--warning-light); color: var(--warning); }
.trip-status.confirmed { background: var(--success-light); color: var(--success); }
.trip-status.ongoing { background: var(--primary-light); color: var(--primary); }
.trip-status.completed { background: var(--bg-secondary); color: var(--text-muted); }

/* ===== Trips Grid ===== */
.trips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-lg); }

.trip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.2s;
}
.trip-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.trip-card-header { display: flex; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-md); }
.trip-card-icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.trip-card-info { flex: 1; min-width: 0; }
.trip-card-title { font-weight: 600; font-size: 1.1rem; margin-bottom: 2px; }
.trip-card-dest { font-size: 0.9rem; color: var(--text-muted); }
.trip-card-body { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); }

/* ===== Expenses Section ===== */
.expenses-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}
.expenses-section-header {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}
.expenses-section-header h3 { margin: 0; font-size: 1rem; }
.expenses-section-body { padding: var(--space-lg); }

/* Balance Table */
.balance-table-wrapper { overflow-x: auto; }
.balance-table {
    width: 100%;
    border-collapse: collapse;
}
.balance-table th {
    padding: 12px var(--space-lg);
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}
.balance-table td {
    padding: 14px var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}
.balance-table tr:last-child td { border-bottom: none; }
.balance-table tr:hover td { background: var(--bg-secondary); }
.balance-table .positive { color: var(--success); font-weight: 600; }
.balance-table .negative { color: var(--danger); font-weight: 600; }
.balance-table .balance-negative { color: var(--danger); font-weight: 700; } /* Rosso - deve pagare */
.balance-table .balance-positive { color: var(--primary); font-weight: 700; } /* Blu - deve ricevere */
.balance-table .balance-even { color: var(--success); font-weight: 700; } /* Verde - in pari */

.balance-footer {
    padding: 14px var(--space-lg);
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* Expense History Items */
.expense-history {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.expense-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}
.expense-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.expense-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.expense-desc {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.expense-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.expense-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

/* Settlement Items */
.settlement-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
}

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

.settlement-main {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.settlement-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}

/* ===== Participants ===== */
.participants-grid { display: flex; flex-direction: column; gap: var(--space-md); }

.participant-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}
.participant-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--primary); font-size: 1rem; flex-shrink: 0; }
.participant-info { flex: 1; min-width: 0; }
.participant-name { font-weight: 600; font-size: 1rem; }
.participant-email { font-size: 0.85rem; color: var(--text-muted); }
.participant-actions { display: flex; gap: var(--space-sm); }

/* ===== Documents ===== */
.documents-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.documents-list {
    display: flex;
    flex-direction: column;
}

.document-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.document-card:last-child { border-bottom: none; }
.document-card:hover { background: var(--bg-secondary); }

.document-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.document-icon.type-pdf { background: var(--danger-light); }
.document-icon.type-doc, .document-icon.type-docx { background: var(--primary-light); }
.document-icon.type-jpg, .document-icon.type-jpeg, .document-icon.type-png, .document-icon.type-gif { background: var(--success-light); }

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

.document-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.document-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* ===== Contacts ===== */
.contacts-filters {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.contacts-filters .search-box { flex: 2; }
.contacts-filters .filter-box { flex: 1; }
@media (max-width: 600px) {
    .contacts-filters { flex-direction: column; }
}

.contacts-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.contacts-list {
    display: flex;
    flex-direction: column;
}

.contact-card-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.contact-card-row:last-child { border-bottom: none; }
.contact-card-row:hover { background: var(--bg-secondary); }

.contact-avatar { 
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    background: var(--primary-light); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 600; 
    color: var(--primary); 
    font-size: 1.1rem; 
    flex-shrink: 0; 
}

.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; margin-bottom: 2px; }
.contact-details { font-size: 0.85rem; color: var(--text-muted); }
.contact-trips { font-size: 0.8rem; margin-top: 4px; }

.contact-actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

/* Trips Checkbox List (for assign contact modal) */
.trips-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 300px;
    overflow-y: auto;
}

.trip-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}
.trip-checkbox-item:hover { border-color: var(--text-muted); }
.trip-checkbox-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.trip-checkbox-item input { width: 18px; height: 18px; margin: 0; }
.trip-checkbox-name { font-weight: 500; flex: 1; }
.trip-checkbox-dest { flex-shrink: 0; }

/* ===== Settings ===== */
.settings-section { margin-bottom: var(--space-xl); }
.settings-section-title { font-size: 1rem; font-weight: 600; margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border-color); }

.color-picker-grid { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.color-option {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0; /* Hide checkmark by default */
}
.color-option:hover { transform: scale(1.1); }
.color-option.active { border-color: var(--text-primary); box-shadow: var(--shadow-md); font-size: 1.25rem; }
.color-option[data-color="petrolio"] { background: #2D6A7A; }
.color-option[data-color="terracotta"] { background: #D4894A; }
.color-option[data-color="teal"] { background: #3D8B8B; }
.color-option[data-color="green"] { background: #6B8E4E; }

/* Logo Upload */
.logo-upload-section { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.logo-upload-box {
    flex: 1; min-width: 200px;
    padding: var(--space-lg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.logo-upload-box:hover { border-color: var(--primary); background: var(--primary-light); }
.logo-upload-box img { max-height: 60px; margin-bottom: var(--space-sm); }
.logo-upload-label { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Toast Notifications ===== */
.toast-container { position: fixed; top: var(--space-lg); right: var(--space-lg); z-index: 2000; display: flex; flex-direction: column; gap: var(--space-sm); }
.toast { padding: 12px 20px; border-radius: var(--radius-md); background: var(--bg-sidebar); color: var(--text-light); font-size: 0.9rem; box-shadow: var(--shadow-lg); transform: translateX(120%); transition: transform 0.3s; }
.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@media (max-width: 768px) { .toast-container { top: auto; bottom: 80px; right: var(--space-md); left: var(--space-md); } }

/* ===== Loading ===== */
.loading-overlay { position: fixed; inset: 0; background: rgba(250, 250, 250, 0.8); display: flex; align-items: center; justify-content: center; z-index: 3000; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Login Page ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-lg); background: linear-gradient(135deg, var(--bg-sidebar) 0%, #3a3a3a 100%); }
.login-container { width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: var(--space-xl); }
.login-logo-icon { font-size: 4rem; margin-bottom: var(--space-sm); }
.login-logo img { height: auto; border-radius: var(--radius-md); margin-bottom: var(--space-sm); }
.login-logo h1 { color: var(--text-light); font-size: 1.75rem; margin-bottom: var(--space-xs); }
.login-logo p { color: var(--primary); font-size: 0.9rem; }
.login-logo .login-custom-logo-full { 
    width: 80%; 
    max-width: 200px; 
    height: auto;
    border-radius: var(--radius-md); 
    margin-bottom: var(--space-lg); 
}
.login-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: var(--space-xl); box-shadow: var(--shadow-lg); }

/* Custom Logo in Sidebar - Full (no text) */
.sidebar-custom-logo-full { 
    width: calc(100% - 20px);
    max-width: 180px;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md); 
}

/* Custom Logo in Mobile Header - Full (no text) */
.mobile-custom-logo-full { height: 36px; width: auto; border-radius: var(--radius-sm); }
.mobile-default-logo { display: flex; align-items: center; gap: var(--space-sm); }

/* Logo Upload Box */
.logo-upload-placeholder { font-size: 2rem; margin-bottom: var(--space-sm); }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: var(--space-xl) * 2; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: var(--space-md); opacity: 0.5; }
.empty-state-text { font-size: 0.95rem; }

/* ===== Utilities ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.ml-auto { margin-left: auto; }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

/* Vote counts */
.vote-count { font-size: 0.8rem; font-weight: 600; padding: 4px 8px; border-radius: var(--radius-sm); }
.vote-count.positive { background: var(--success-light); color: var(--success); }
.proposal-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Sortable */
.sortable-ghost { opacity: 0.4; }
.sortable-chosen { background: var(--primary-light) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Print */
/* ===== Print Styles ===== */
@media print { 
    .sidebar, .bottom-nav, .mobile-header, .btn, .modal-backdrop, .fab-button, .page-header-actions { 
        display: none !important; 
    } 
    .main-content { 
        margin-left: 0 !important; 
        padding: 0 !important;
    }
    .page-body {
        padding: 10px !important;
    }
    
    /* Expenses print layout */
    .expenses-section {
        page-break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #ccc !important;
    }
    .expenses-section-header {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .balance-table {
        width: 100%;
        border-collapse: collapse;
    }
    .balance-table th,
    .balance-table td {
        border: 1px solid #ddd !important;
        padding: 8px;
        text-align: left;
    }
    .balance-table .balance-negative { color: #d00 !important; }
    .balance-table .balance-positive { color: #00c !important; }
    .balance-table .balance-even { color: #090 !important; }
    
    /* Expense form print */
    .expense-form-section {
        margin-bottom: 15px;
        padding: 10px;
        border: 1px solid #ddd;
    }
    .split-type-grid {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    .split-type-card {
        border: 1px solid #ccc;
        padding: 8px;
    }
    .split-type-card.active {
        border: 2px solid #000;
        background: #f0f0f0 !important;
    }
    
    /* Day sections */
    .day-section {
        page-break-inside: avoid;
        margin-bottom: 15px;
    }
    .day-header {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Hide colors that don't print well */
    .item-status {
        border: 2px solid currentColor !important;
    }
    
    /* General improvements */
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    h1 { font-size: 18pt; }
    h2 { font-size: 16pt; }
    h3 { font-size: 14pt; }
}

/* ===== Modal Sizes ===== */
.modal.modal-lg { max-width: 600px; }
.modal.modal-xl { max-width: 800px; }

/* ===== Day Selector (Singolo/Multi Giorno) ===== */
.day-selector {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
}
.day-toggle {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}
.day-toggle.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ===== Expense Options Panel ===== */
.expense-options-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-top: var(--space-sm);
}

/* ===== Split Type Options ===== */
.split-type-options-sm {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xs);
}
@media (max-width: 480px) {
    .split-type-options-sm { grid-template-columns: repeat(2, 1fr); }
}

.split-type-option-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.split-type-option-sm input { display: none; }
.split-type-option-sm span { font-size: 0.85rem; font-weight: 500; }
.split-type-option-sm.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}
.split-type-option-sm:hover:not(.active) {
    border-color: var(--text-muted);
}

/* ===== Split Panel Compact ===== */
.split-panel-compact {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* ===== Participant Chips (Scegli chi partecipa) ===== */
.participant-checkboxes-compact {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.participant-chip {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.participant-chip input { display: none; }
.participant-chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}
.participant-chip:hover:not(.active) {
    border-color: var(--text-muted);
}

/* ===== Splits List (Custom amounts) ===== */
.splits-list-compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.split-row-compact {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}
.split-row-compact:last-child { border-bottom: none; }

.split-row-compact input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.split-name-compact {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
}

.split-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-sm);
}
.split-input-wrapper .currency-symbol {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.split-input-sm {
    width: 80px;
    border: none !important;
    padding: 8px 4px !important;
    background: transparent !important;
    text-align: right;
}
.split-input-sm:focus {
    box-shadow: none !important;
}

.split-total-compact {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: right;
}
.split-total-compact.error {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===== Document Select List ===== */
.document-select-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 150px;
    overflow-y: auto;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.document-select-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.document-select-item:hover { background: var(--bg-secondary); }
.document-select-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.document-select-item input { margin: 0; }
.document-select-item .doc-icon { font-size: 1.1rem; }
.document-select-item .doc-name { flex: 1; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Document Select List Compact (for popups - max 3 visible) */
.document-select-list-compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 132px; /* ~3 items */
    overflow-y: auto;
    padding: var(--space-xs);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.document-select-list-compact::-webkit-scrollbar { width: 4px; }
.document-select-list-compact::-webkit-scrollbar-track { background: transparent; }
.document-select-list-compact::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.document-select-item-compact {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    min-height: 36px;
}
.document-select-item-compact:hover { background: var(--bg-body); }
.document-select-item-compact.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.document-select-item-compact input[type="checkbox"] { 
    width: 16px; 
    height: 16px; 
    margin: 0;
    flex-shrink: 0;
}
.document-select-item-compact .doc-icon { 
    font-size: 1rem; 
    flex-shrink: 0;
}
.document-select-item-compact .doc-name-text { 
    flex: 1; 
    font-size: 0.8rem; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    font-weight: 500;
}

/* ===== User Expense Detail Styles ===== */
.user-expense-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
@media (max-width: 500px) {
    .user-expense-summary { grid-template-columns: 1fr; }
}

.summary-card {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}
.summary-card .summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}
.summary-card .summary-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}
.summary-card.positive {
    background: var(--primary-light);
    border-color: var(--primary);
}
.summary-card.positive .summary-value {
    color: var(--primary);
}
.summary-card.negative {
    background: var(--danger-light);
    border-color: var(--danger);
}
.summary-card.negative .summary-value {
    color: var(--danger);
}

.expense-detail-section {
    margin-bottom: var(--space-lg);
}
.expense-detail-section .section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
}

.expense-detail-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.expense-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--warning);
}
.expense-detail-item.paid {
    border-left-color: var(--success);
}

.expense-detail-info {
    flex: 1;
    min-width: 0;
}
.expense-detail-desc {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.expense-detail-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.expense-detail-amounts {
    text-align: right;
    flex-shrink: 0;
}
.expense-detail-share {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}
.expense-detail-share.positive {
    color: var(--success);
}
.expense-detail-total {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.expense-detail-subtotal {
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    text-align: right;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

/* ===== Expense Form Styles ===== */
.expense-form-section {
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.expense-form-section:first-of-type { 
    background: transparent; 
    border: none; 
    padding: 0;
    margin-bottom: var(--space-lg);
}
.expense-form-section-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
}

/* Expense form row - 3 columns */
.expense-form-section .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-md);
}
@media (max-width: 600px) {
    .expense-form-section .form-row { 
        grid-template-columns: 1fr; 
    }
}

/* Split Type Grid */
.split-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xs);
}
@media (max-width: 500px) {
    .split-type-grid { grid-template-columns: repeat(2, 1fr); }
}

.split-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--space-sm);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    min-height: 60px;
}
.split-type-card input { display: none; }
.split-type-card:hover { border-color: var(--text-muted); }
.split-type-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.split-type-card .split-type-icon { font-size: 1.25rem; }
.split-type-card .split-type-name { font-size: 0.75rem; font-weight: 600; }

/* Expense Split Panel */
.expense-split-panel {
    background: var(--bg-card);
    margin-top: var(--space-sm);
}

.participant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.participant-chip {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
}
.participant-chip input { display: none; }
.participant-chip:hover { border-color: var(--text-muted); }
.participant-chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.split-summary-box {
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
}

/* Custom Splits List */
.custom-splits-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 200px;
    overflow-y: auto;
}
.custom-split-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}
.custom-split-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex-shrink: 0; }
.custom-split-name { flex: 1; font-weight: 500; font-size: 0.85rem; }
.custom-split-input {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-xs);
}
.custom-split-input span { color: var(--text-muted); font-size: 0.8rem; }
.custom-split-input input {
    width: 70px;
    border: none;
    padding: 6px 4px;
    background: transparent;
    text-align: right;
    font-size: 0.85rem;
}
.custom-split-input input:focus { box-shadow: none; }

.split-total-box {
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: right;
    font-weight: 600;
    font-size: 0.85rem;
}
.split-total-box.error {
    background: var(--danger-light);
    color: var(--danger);
}

.expense-personal-note {
    background: var(--warning-light);
    color: var(--warning);
    text-align: center;
    font-size: 0.9rem;
}

/* Legacy styles (kept for compatibility) */
.split-type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}
@media (max-width: 480px) {
    .split-type-options { grid-template-columns: 1fr; }
}

.split-type-option {
    display: block;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    padding: var(--space-md);
}
.split-type-option input { display: none; }
.split-type-option:hover { border-color: var(--text-muted); }
.split-type-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.split-type-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}
.split-type-icon { font-size: 1.5rem; }
.split-type-label { font-weight: 600; font-size: 0.9rem; }
.split-type-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Custom Splits Section ===== */
.custom-splits {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

/* Participant Checkboxes (equal_some) */
.participant-checkboxes {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.participant-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}
.participant-checkbox:hover { border-color: var(--text-muted); }
.participant-checkbox.active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.participant-checkbox input { width: 18px; height: 18px; margin: 0; }
.participant-checkbox-name { flex: 1; font-weight: 500; }
.participant-checkbox-amount {
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.split-summary {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
}

/* Splits List (custom amounts) */
.splits-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.split-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.split-checkbox input { width: 18px; height: 18px; margin: 0; }
.split-name { flex: 1; font-weight: 500; }
.split-input { width: 100px; text-align: right; }

.split-total {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.split-total.error {
    background: var(--danger-light);
    color: var(--danger);
}
.split-diff { font-weight: 400; font-size: 0.85rem; }

/* =====================
   TODOS (Da fare)
   ===================== */

.todos-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.todo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    border-left: 3px solid var(--primary);
}

.todo-card.todo-private {
    border-left-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 5%, var(--bg-card));
}

.todo-card.todo-done {
    opacity: 0.6;
    border-left-color: var(--success);
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
}

.todo-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.todo-expand-icon {
    font-size: 0.6rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.todo-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.todo-cost {
    color: var(--success);
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
}

.todo-body {
    margin: var(--space-xs) 0;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.todo-description {
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
}

.todo-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
}

.todo-link:hover {
    text-decoration: underline;
}

.todo-meta {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    flex-wrap: wrap;
}

.todo-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.todo-actions .form-input-sm {
    padding: 3px 6px;
    font-size: 0.75rem;
}

.todo-statuses-grid {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
}

.todo-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 2px 5px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    font-size: 0.65rem;
    font-weight: 500;
}

.todo-status-badge.status-done {
    background: color-mix(in srgb, var(--success) 20%, transparent);
    color: var(--success);
}

.todo-status-badge.status-pending {
    background: color-mix(in srgb, var(--warning) 20%, transparent);
    color: var(--warning);
}

.todo-status-badge.status-cancelled {
    background: color-mix(in srgb, var(--danger) 20%, transparent);
    color: var(--danger);
}

.todo-status-badge.status-todo {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .todo-header {
        flex-wrap: wrap;
    }
    
    .todo-title-row {
        width: 100%;
    }
    
    .todo-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: var(--space-xs);
    }
}

/* =====================================================
   MOBILE OPTIMIZATIONS - Complete overhaul
   ===================================================== */

@media (max-width: 640px) {
    /* === TABS - Grid layout instead of scroll === */
    .tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        border-bottom: none;
        margin-bottom: var(--space-md);
        background: var(--bg-secondary);
        padding: 4px;
        border-radius: var(--radius-md);
    }
    
    .tab {
        padding: 8px 4px;
        font-size: 0.75rem;
        text-align: center;
        border-bottom: none;
        border-radius: var(--radius-sm);
        margin-bottom: 0;
    }
    
    .tab.active {
        background: var(--bg-card);
        box-shadow: var(--shadow-sm);
    }
    
    /* === PAGE BODY - Reduce lateral padding === */
    .page-body {
        padding: var(--space-sm);
    }
    
    /* === DAY SECTIONS - Closer to edges === */
    .day-section {
        margin-bottom: var(--space-md);
    }
    
    .day-header {
        padding: var(--space-sm) var(--space-md);
        margin-left: -4px;
        margin-right: -4px;
        border-radius: var(--radius-md);
    }
    
    .day-options {
        padding-left: 0;
        margin-left: -4px;
        margin-right: -4px;
    }
    
    /* === OPTION CARDS - Vertical layout with full title === */
    .option-card {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-xs);
        padding: var(--space-sm);
        margin-left: 0;
        margin-right: 0;
    }
    
    .option-card .item-icon {
        order: 1;
        font-size: 1rem;
    }
    
    .option-card .item-title {
        order: 2;
        flex: 1 1 calc(100% - 40px);
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .option-card .item-status {
        order: 3;
    }
    
    .option-card .multi-day-badge {
        order: 4;
    }
    
    .option-card .item-time {
        order: 5;
    }
    
    .option-card .item-price {
        order: 6;
    }
    
    .option-card .item-votes {
        order: 7;
    }
    
    .option-card .item-like-btn {
        order: 8;
    }
    
    .item-time, .item-price, .item-status, .item-votes, .item-like-btn {
        font-size: 0.75rem;
    }
    
    .item-price {
        padding: 2px 6px;
    }
    
    /* Multi-day badge smaller */
    .multi-day-badge {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    
    /* === PROPOSALS - Same vertical layout === */
    .proposal-card,
    .options-list .option-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* === BALANCE TABLE - Card layout for mobile === */
    .balance-table-wrapper {
        overflow-x: visible;
    }
    
    .balance-table {
        display: block;
        width: 100%;
    }
    
    .balance-table thead {
        display: none;
    }
    
    .balance-table tbody {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .balance-table tr {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto;
        gap: var(--space-xs);
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: var(--space-sm);
        position: relative;
    }
    
    .balance-table td {
        border: none;
        padding: 2px 4px;
        font-size: 0.75rem;
        text-align: center;
    }
    
    /* Nome - full width top row */
    .balance-table td:first-child {
        grid-column: 1 / -1;
        font-size: 0.9rem;
        font-weight: 600;
        text-align: left;
        padding-bottom: var(--space-xs);
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Costo, Pagato, Saldo - in seconda riga */
    .balance-table td:nth-child(2)::before {
        content: "Costo";
        display: block;
        font-size: 0.65rem;
        color: var(--text-muted);
        margin-bottom: 2px;
    }
    
    .balance-table td:nth-child(3)::before {
        content: "Contribuito";
        display: block;
        font-size: 0.65rem;
        color: var(--text-muted);
        margin-bottom: 2px;
    }
    
    .balance-table td:nth-child(4)::before {
        content: "Saldo";
        display: block;
        font-size: 0.65rem;
        color: var(--text-muted);
        margin-bottom: 2px;
    }
    
    /* Button column - in alto a destra */
    .balance-table td:last-child {
        position: absolute;
        right: var(--space-sm);
        top: var(--space-sm);
        padding: 0;
    }
    
    /* === EXPENSE ITEMS - Vertical layout === */
    .expense-item {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-xs);
        padding: var(--space-sm);
    }
    
    .expense-item .expense-icon {
        display: none;
    }
    
    .expense-info {
        width: 100%;
    }
    
    .expense-desc {
        font-size: 0.9rem;
        white-space: normal;
    }
    
    .expense-meta {
        font-size: 0.75rem;
    }
    
    .expense-amount {
        font-size: 0.95rem;
        align-self: flex-start;
    }
    
    /* === SETTLEMENT ITEMS - Vertical === */
    .settlement-item {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-xs);
        padding: var(--space-sm);
    }
    
    .settlement-amount {
        font-size: 0.95rem;
    }
    
    /* === PARTICIPANT CARDS - Stacked layout === */
    .participants-list {
        gap: var(--space-sm);
    }
    
    .participant-card {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto auto;
        gap: var(--space-xs);
        padding: var(--space-sm);
        align-items: center;
    }
    
    .participant-card .participant-avatar {
        grid-row: 1 / 3;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .participant-card .participant-info {
        grid-column: 2;
        grid-row: 1;
    }
    
    .participant-name {
        font-size: 0.9rem;
    }
    
    .participant-email {
        font-size: 0.7rem;
    }
    
    /* Badges sotto nome/email */
    .participant-card > .flex.items-center.gap-sm {
        grid-column: 2;
        grid-row: 2;
    }
    
    .participant-card .badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    /* Azioni in alto a destra */
    .participant-actions {
        grid-column: 3;
        grid-row: 1 / 3;
        flex-direction: column;
        gap: 2px;
    }
    
    .participant-actions .btn {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    /* === DOCUMENT CARDS - Compact === */
    .document-card {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }
    
    .document-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .document-name {
        font-size: 0.85rem;
    }
    
    .document-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .document-actions .btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    /* === TODO CARDS - Already compact, minor tweaks === */
    .todo-card {
        margin-left: -4px;
        margin-right: -4px;
    }
    
    /* === MODALS - Keep as is but reduce padding === */
    .modal {
        margin: var(--space-sm);
        max-height: calc(100vh - var(--space-lg));
    }
    
    .modal-body {
        padding: var(--space-md);
    }
    
    /* === FORM ROWS - Stack on mobile === */
    .form-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    /* === BUTTONS - Smaller === */
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .btn-xs {
        padding: 2px 6px;
        font-size: 0.7rem;
    }
    
    /* === PAGE HEADERS - Compact === */
    .page-header {
        padding: var(--space-md) var(--space-sm);
    }
    
    .page-header h1 {
        font-size: 1.2rem;
    }
    
    .page-header h2 {
        font-size: 1rem;
    }
    
    /* === EMPTY STATES === */
    .empty-state {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .empty-state-icon {
        font-size: 2rem;
    }
}

/* =====================
   FUND (Cassa Viaggio)
   ===================== */

.fund-section {
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
}

.fund-balance-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    border: 1px solid var(--border-color);
}

.fund-balance-card.fund-positive {
    border-color: var(--success);
    background: linear-gradient(135deg, color-mix(in srgb, var(--success) 10%, var(--bg-secondary)) 0%, var(--bg-card) 100%);
}

.fund-balance-card.fund-negative {
    border-color: var(--danger);
    background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 10%, var(--bg-secondary)) 0%, var(--bg-card) 100%);
}

.fund-balance-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.fund-balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.fund-positive .fund-balance-amount {
    color: var(--success);
}

.fund-negative .fund-balance-amount {
    color: var(--danger);
}

.fund-balance-details {
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.fund-summary-row {
    display: flex;
    justify-content: space-around;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.fund-summary-item {
    text-align: center;
}

.fund-summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.fund-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Checkbox per pagato dalla cassa */
.fund-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.fund-check:hover {
    border-color: var(--primary);
}

.fund-check.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

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

.fund-check-icon {
    font-size: 1.25rem;
}

.fund-check-balance {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .fund-balance-card {
        padding: var(--space-lg);
    }
    
    .fund-balance-amount {
        font-size: 2rem;
    }
    
    .fund-balance-details {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .fund-balance-details span:nth-child(2) {
        display: none;
    }
    
    .fund-summary-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .fund-check {
        flex-wrap: wrap;
    }
    
    .fund-check-balance {
        width: 100%;
        margin-left: 0;
        margin-top: var(--space-xs);
    }
}

/* Maniglia di trascinamento voci itinerario (drag & drop) */
.option-card .option-drag{
  cursor: grab; color: var(--muted, #8a8a86); font-size: 15px; line-height: 1;
  padding: 0 4px; opacity: .55; user-select: none; flex-shrink: 0;
}
.option-card .option-drag:hover{ opacity: 1; }
.option-card .option-drag:active{ cursor: grabbing; }
body.is-dragging{ cursor: grabbing; }
.sortable-ghost{ opacity: .4; }
.sortable-chosen{ box-shadow: 0 2px 10px rgba(0,0,0,.15); }

/* Effetto trascinamento più fluido (elemento che segue il cursore) */
.sortable-fallback{
  opacity: .95 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.22) !important;
  cursor: grabbing;
}
.sortable-drag{ opacity: 1 !important; }
