/* ══════════════════════════════════════════════
   IBIS Tours Portal — Stylesheet
   ══════════════════════════════════════════════ */

:root {
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --accent: #d4a03c;
    --accent-light: #e9b949;
    --success: #52b788;
    --danger: #c1292e;
    --warning: #f1c40f;
    --info: #3498db;
    --bg: #f5f3f0;
    --bg-card: #ffffff;
    --bg-sidebar: #1b2a1e;
    --bg-sidebar-hover: #2d4a35;
    --text: #2c3e2e;
    --text-light: #6b7b6e;
    --text-sidebar: #b8c9bb;
    --border: #d6d0c8;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
    --sidebar-w: 240px;
    --topbar-h: 56px;
    --transition: 0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; font-size: 14px; -webkit-text-size-adjust: 100%; }
html { scroll-behavior: smooth; }
a { color: var(--primary); text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.3; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ═══ LOGIN ═══ */
.login-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #2e7d50 100%);
    padding: 20px;
}
.login-box {
    background: var(--bg-card); border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 380px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 22px; color: var(--primary); margin: 4px 0 0; }
.login-logo p { color: var(--text-light); font-size: 13px; margin-top: 2px; }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--text); text-transform: uppercase; letter-spacing: .3px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px;
    transition: border-color var(--transition); outline: none; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,.1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-full { grid-column: 1 / -1; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; padding: 8px 12px; background: #fde8e8; border-radius: 6px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; margin: 2px; font-size: 13px; cursor: pointer; border-radius: var(--radius-sm); }
.checkbox-label:hover { background: var(--bg); }
.checkbox-label input[type="checkbox"] { margin: 0; }

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: var(--radius);
    font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; border-radius: 4px; }
.btn-icon:hover { background: rgba(0,0,0,.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ═══ SIDEBAR (Dark Theme) ═══ */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 150; }
.sidebar-overlay.visible { display: block; }
.sidebar {
    width: var(--sidebar-w); background: var(--bg-sidebar); color: var(--text-sidebar);
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100; transition: width 0.25s ease, transform 0.25s ease; overflow: hidden;
}
/* ── Collapsed (default): icon-only strip ── */
.sidebar.collapsed { width: 52px; }
.sidebar.collapsed .nav-label, .sidebar.collapsed .sidebar-title, .sidebar.collapsed .sidebar-close,
.sidebar.collapsed .nav-group-label, .sidebar.collapsed .user-info span, .sidebar.collapsed .nav-external span:last-child { display: none; }
.sidebar.collapsed .sidebar-header { padding: 12px 10px; justify-content: center; }
.sidebar.collapsed .nav-item { padding: 10px 0; justify-content: center; gap: 0; }
.sidebar.collapsed .nav-item.active { padding-left: 0; border-left: 3px solid var(--accent); }
.sidebar.collapsed .nav-icon { width: auto; font-size: 20px; }
.sidebar.collapsed .sidebar-footer { padding: 12px 8px; }
.sidebar.collapsed .user-info { justify-content: center; }
/* ── Hover expand: autohide flyout on desktop ── */
.sidebar.collapsed:hover { width: var(--sidebar-w); box-shadow: 4px 0 20px rgba(0,0,0,.25); }
.sidebar.collapsed:hover .nav-label, .sidebar.collapsed:hover .sidebar-title,
.sidebar.collapsed:hover .nav-group-label, .sidebar.collapsed:hover .user-info span,
.sidebar.collapsed:hover .nav-external span:last-child { display: inline; }
.sidebar.collapsed:hover .sidebar-close { display: none; }
.sidebar.collapsed:hover .sidebar-header { padding: 16px 20px; justify-content: flex-start; }
.sidebar.collapsed:hover .nav-item { padding: 10px 20px; justify-content: flex-start; gap: 12px; }
.sidebar.collapsed:hover .nav-item.active { padding-left: 17px; }
.sidebar.collapsed:hover .sidebar-footer { padding: 12px 20px; }
.sidebar.collapsed:hover .user-info { justify-content: space-between; }
/* ── Pinned: user clicked hamburger to keep open ── */
.sidebar.pinned { width: var(--sidebar-w); }
.sidebar.pinned .sidebar-close { display: block; }
.sidebar-header { padding: 16px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.logo-sm { display: flex; align-items: center; }
.sidebar-title { font-size: 16px; font-weight: 600; color: #fff; flex: 1; }
.sidebar-close { display: none; color: var(--text-sidebar); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-group-label { padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.35); font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--text-sidebar); text-decoration: none; transition: background var(--transition); font-size: 14px; }
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-item.active { background: var(--bg-sidebar-hover); color: #fff; border-left: 3px solid var(--accent); padding-left: 17px; }
.nav-item.nav-sub { padding-left: 36px; font-size: 13px; opacity: 0.85; }
.nav-item.nav-sub:hover { opacity: 1; }
.nav-item.nav-sub .nav-icon { font-size: 12px; }
.nav-item.nav-sub { padding-left: 48px; font-size: 13px; }
.nav-item.nav-sub.active { padding-left: 45px; }
.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.user-info { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-sidebar); }
.user-info .btn-icon { color: var(--text-sidebar); }

/* ═══ TOPBAR & MAIN ═══ */
.main-content { margin-left: 52px; flex: 1; min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.25s ease; }
.sidebar.pinned ~ .main-content { margin-left: var(--sidebar-w); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: var(--topbar-h); border-bottom: 1px solid var(--border); background: var(--bg-card); position: sticky; top: 0; z-index: 50; }
.topbar h2 { font-size: 16px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.hamburger { display: block; font-size: 20px; cursor: pointer; }
.content { padding: 20px; }
.placeholder { text-align: center; padding: 60px 20px; color: var(--text-light); }
.placeholder .placeholder-icon { font-size: 48px; margin-bottom: 12px; }
.placeholder h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }

/* ═══ FILTERS & TOOLBAR ═══ */
.filters-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters-bar input, .filters-bar select { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: #fff; }
.filters-bar input:focus, .filters-bar select:focus { border-color: var(--primary); outline: none; }
.input-sm { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: #fff; }
.input-sm:focus { border-color: var(--primary); outline: none; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search-box { flex: 1; min-width: 200px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.toolbar .search-box:focus { border-color: var(--primary); outline: none; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.section-header h2 { font-size: 18px; margin: 0; }
.hour-select { padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }

/* ═══ CARDS ═══ */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.entity-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); transition: all var(--transition); cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.entity-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--primary-light); }
.entity-card-left { flex: 1; min-width: 0; font-size: 14px; }
.entity-card-details { font-size: 12px; color: var(--text-light); margin-top: 4px; word-break: break-word; overflow-wrap: break-word; }
.entity-card-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.entity-card-meta { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.entity-card-meta p { margin: 2px 0; }
.entity-card-actions { display: flex; gap: 4px; margin-top: 6px; }
.entity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.entity-header h3 { font-size: 14px; margin: 0; }
.entity-body { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.entity-body p { margin: 3px 0; }
.entity-footer { display: flex; gap: 4px; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.card-inactive { opacity: .5; border-style: dashed; }
.client-tab { background: none; border: none; border-bottom: 3px solid transparent; border-radius: 0; padding: 8px 16px; font-size: 13px; color: var(--text-light); cursor: pointer; transition: all .15s; }
.client-tab:hover { color: var(--text); background: var(--bg-hover); }
.client-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.assets-card-grid, .tours-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 4px 0; }
.asset-card, .tour-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow); }
.asset-card:hover, .tour-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-light); transform: translateY(-2px); }
.asset-card-header, .tour-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.asset-card-body, .tour-card-body { font-size: 13px; color: var(--text-light); }
.asset-card-body p, .tour-card-body p { margin: 3px 0; }
.asset-icon { font-size: 28px; }
.asset-name { font-size: 15px; font-weight: 600; }
.asset-group-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.detail-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-panel .full-width { grid-column: 1 / -1; }

/* ═══ BADGES ═══ */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-sm { padding: 1px 6px; font-size: 10px; }
.badge-draft, .badge-pending, .badge-inquiry, .badge-cerere { background: #f0f0f0; color: #666; }
.badge-confirmed, .badge-confirmat, .badge-signed, .badge-signed_by_both, .badge-paid { background: #e8f5ee; color: var(--primary); }
.badge-signed_by_ibis, .badge-sent, .badge-issued, .badge-option { background: #ebf5fb; color: var(--info); }
.badge-cancelled, .badge-anulat, .badge-expired, .badge-overdue { background: #fde8e8; color: var(--danger); }
.badge-completed, .badge-finalizat { background: #f0f0f0; color: #555; }
.badge-in_progress { background: #fff3cd; color: #856404; }
.badge-active, .badge-activ { background: #d4edda; color: #155724; font-weight: 700; }
.badge-inactive, .badge-inactiv { background: #f0f0f0; color: #999; }
.badge-lang { background: #ebf5fb; color: var(--info); font-size: 11px; padding: 2px 8px; }
.badge-skill { background: #f0e6ff; color: #6c3fc5; font-size: 11px; padding: 2px 8px; }
.badge-meal { background: #fff8e1; color: #b8860b; font-size: 11px; padding: 2px 8px; }
.badge-daytype { background: #e3f2fd; color: #1565c0; font-size: 10px; padding: 1px 6px; }
.badge-resource { background: #fce4ec; color: #c62828; font-size: 10px; padding: 1px 6px; }

/* ═══ TABLES ═══ */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; background: var(--bg); border-bottom: 2px solid var(--border); font-weight: 600; font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: .3px; }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:nth-child(even) td { background: #f8faf9; }
.data-table tr:hover td { background: #eef4f0; }
.data-table tr.row-inactive td { opacity: .5; }
.data-table input, .data-table select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }

/* ═══ MODAL ═══ */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; }
.modal { background: var(--bg-card); border-radius: 14px; width: 100%; max-width: 720px; box-shadow: var(--shadow-lg); animation: modalSlide .2s ease-out; }
.modal-xl { max-width: 960px; }
.modal-wide { max-width: 860px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.modal-body { padding: 20px 24px; max-height: 78vh; overflow-y: auto; }
@keyframes modalSlide { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-sticky-save { position: sticky; bottom: -20px; margin: 16px -24px -20px; padding: 12px 24px; background: var(--bg-card); border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ═══ TOAST ═══ */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; padding: 12px 24px; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .3s ease-out; max-width: 400px; text-align: center; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ═══ TABS ═══ */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab-btn { padding: 8px 16px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; white-space: nowrap; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ══════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.stat-icon { font-size: 28px; flex-shrink: 0; }
.stat-info { flex: 1; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-light); text-transform: uppercase; margin-top: 2px; }
.dash-cal-wrap { margin-bottom: 20px; position: relative; }
.dash-cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-height: 400px; scroll-behavior: smooth; }
.dash-cal-table { border-collapse: collapse; width: max-content; }
.dash-cal-hd { padding: 4px 2px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text); border-bottom: 2px solid var(--border); border-right: 1px solid #eee; white-space: nowrap; min-width: 36px; vertical-align: bottom; }
.dash-cal-wd { display: block; font-size: 9px; font-weight: 400; color: var(--text-light); }
.dash-cal-label { padding: 4px 8px; font-size: 12px; font-weight: 500; white-space: nowrap; border-right: 2px solid var(--border); max-width: 150px; overflow: hidden; text-overflow: ellipsis; background: #fff; }
.dash-cal-sticky { position: sticky; left: 0; z-index: 3; background: #fff; }
.dash-cal-month-hd { text-align: center; font-size: 11px; font-weight: 700; color: var(--primary-dark); background: #f8f9fa; border-bottom: 2px solid var(--primary); border-right: 2px solid var(--border); padding: 4px; }
.dash-mo-start { border-left: 2px solid var(--border) !important; }
.dash-cal-cell { padding: 1px; height: 22px; border-right: 1px solid #eee; border-bottom: 1px solid #f0f0f0; min-width: 36px; }
.dash-cal-cell.dash-we { background: #f9f6f1; }
.dash-cal-tile { padding: 1px 2px; text-align: center; font-size: 8px; font-weight: 700; color: #333; letter-spacing: 0.3px; cursor: default; white-space: nowrap; min-width: 36px; height: 22px; line-height: 22px; border-right: 1px solid rgba(255,255,255,.4); }
.dash-arrivals { margin-top: 20px; }
.dash-arrivals h3 { font-size: 16px; font-weight: 700; color: var(--primary-dark); margin-bottom: 12px; }
.dash-arrival-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; transition: var(--transition); }
.dash-arrival-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.dash-arrival-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.dash-arrival-info { font-size: 12px; color: var(--text); margin-top: 2px; }
.dash-arrival-meta { font-size: 12px; color: var(--text-light); }
.dash-arrival-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; margin: 8px 0 4px; color: #fff; }
.quick-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.quick-links .btn { font-size: 13px; }

/* ══════════════════════════════════════
   TOUR CALENDAR (Gantt-style)
   ══════════════════════════════════════ */
.cal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-header-left { display: flex; align-items: center; gap: 8px; }
.cal-header-right { display: flex; align-items: center; gap: 8px; }
.cal-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.cal-subtitle { font-size: 12px; color: var(--text-light); }
.cal-nav-btn { padding: 4px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 600; }
.cal-nav-btn:hover { background: var(--bg); }
.cal-btn { padding: 5px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; }
.cal-btn:hover { background: var(--bg); }
.cal-btn-add { background: var(--primary); color: #fff; border-color: var(--primary); }
.cal-btn-add:hover { opacity: .85; }
.cal-legend { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-light); flex-wrap: wrap; margin-bottom: 8px; }
.cal-legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 3px; }
.cal-legend-hint { font-size: 11px; color: var(--text-light); font-style: italic; }
.cal-legend-sep { width: 1px; height: 14px; background: var(--border); }
.cal-split-wrap { display: flex; flex-direction: column; max-height: calc(100vh - 180px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); overflow: hidden; }
.cal-scroll { -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.cal-scroll-top { overflow-x: scroll; overflow-y: hidden; flex-shrink: 0; border-bottom: 2px solid var(--primary); scrollbar-width: none; }
.cal-scroll-top::-webkit-scrollbar { display: none; }
.cal-scroll-bottom { overflow-x: scroll; overflow-y: auto; flex: 1; min-height: 80px; }
.cal-grid { position: relative; }
.cal-row { display: flex; border-bottom: 1px solid #f0f0f0; min-height: 24px; }
.cal-row-months { border-bottom: 1px solid var(--border); background: var(--primary-dark); position: sticky; top: 0; z-index: 5; }
.cal-row-nums { border-bottom: 2px solid var(--border); background: #fafafa; font-size: 10px; position: sticky; top: 24px; z-index: 5; }
.cal-row-sep { height: 3px; background: var(--border); border-bottom: none; }
.cal-row-add { min-height: 22px; background: #fcfcfc; border-bottom: 1px solid var(--border); }
.cal-row-sec-hdr { background: #f8f8f8; font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border); min-height: 20px; }
.cal-sticky-lbl { position: sticky; left: 0; z-index: 4; width: 120px; margin-right: -120px; flex-shrink: 0; display: flex; align-items: center; padding: 0 4px; font-size: 8px; font-weight: 700; white-space: nowrap; pointer-events: none; background: inherit; box-shadow: 2px 0 4px rgba(0,0,0,0.08); }
.cal-sticky-lbl-hdr { background: #f8f8f8; width: 140px; margin-right: -140px; z-index: 5; font-size: 10px; padding-left: 6px; }
.cal-cell { flex-shrink: 0; border-right: 1px solid #f5f5f5; position: relative; }
.cal-cell.cal-we { background: rgba(0,0,0,.02); }
.cal-cell.cal-mlast { border-right: 1px solid var(--border); }
.cal-cell-add { cursor: pointer; }
.cal-cell-add:hover { background: rgba(45,106,79,.05); }
.cal-cell-add:active { background: rgba(45,106,79,.12); }
.cal-hcell { flex-shrink: 0; text-align: center; font-size: 10px; color: var(--text-light); line-height: 22px; border-right: 1px solid #f0f0f0; }
.cal-hcell.cal-we { color: var(--danger); }
.cal-hcell.cal-mlast { border-right: 1px solid var(--border); }
.cal-month-hdr { flex-shrink: 0; display: flex; align-items: center; border-right: 1px solid rgba(255,255,255,.15); color: #fff; }
.cal-month-label { padding: 3px 8px; font-size: 11px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.cal-tile { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; font-size: 9px; font-weight: 400; color: #000; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 5px; line-height: 20px; cursor: grab; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: opacity .15s; }
.cal-tile:hover { opacity: .9; }
.cal-tile.cal-locked { cursor: default; opacity: .85; }
.cal-badge { font-size: 8px; font-weight: 700; letter-spacing: .3px; }
.cal-ghost-label { position: absolute; top: -18px; left: 0; font-size: 9px; font-weight: 600; color: var(--primary); white-space: nowrap; pointer-events: none; z-index: 10; }
.cal-ghost { background: rgba(45,106,79,.15) !important; outline: 1px dashed var(--primary); }
.cal-drag-src { opacity: .5; }
.cal-acell { flex-shrink: 0; font-size: 7px; text-align: center; line-height: 18px; border-right: 1px solid #f5f5f5; color: #777; }
.cal-acell.cal-mlast { border-right: 1px solid var(--border); }
.cal-acell-conflict { background: #fde8e8 !important; }
.cal-acell-gap { background: #fff3cd; }
.cal-sw-ok { background: #e8f5ee; }
.cal-sw-tight { background: #fff3cd; }
.cal-sep-v { width: 1px; background: var(--border); flex-shrink: 0; }
.cal-panel { position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: 360px; background: var(--bg-card); border-left: 1px solid var(--border); box-shadow: -4px 0 12px rgba(0,0,0,.06); z-index: 80; overflow-y: auto; padding: 16px; transition: transform .2s; display: none; }
.cal-panel.open { display: block; }
.cal-panel-close { position: absolute; top: 8px; right: 8px; }
.cal-panel-btns { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.cal-action-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 11px; background: var(--bg-card); }
.cal-action-btn:hover { background: var(--bg); }
.cal-action-edit { border-color: var(--primary); color: var(--primary); }
.cal-action-lock { border-color: var(--accent); color: var(--accent); }
.cal-action-view { border-color: var(--info); color: var(--info); }
.cal-action-color { border-color: var(--text-light); color: var(--text-light); }
.cal-cpicker { position: fixed; z-index: 9999; background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); width: 200px; }
.cal-cpicker-grid { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-copt { width: 18px; height: 18px; border-radius: 3px; cursor: pointer; border: 2px solid transparent; transition: transform .1s; }
.cal-copt:hover { transform: scale(1.25); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.cal-copt-act { border-color: #333; box-shadow: 0 0 0 1px #fff, 0 0 0 3px #333; }

/* ═══ PARTICIPANTS ═══ */
.pax-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pax-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; background: var(--bg-card); position: relative; }
.pax-leader { border-left: 3px solid var(--accent); }

/* ═══ TOUR DAY EDITOR ═══ */
.day-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.day-card .day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.day-card .day-number { font-weight: 700; color: var(--primary); }
.bear-hide-row { background: #f9f5ee; border: 1px solid #e8dcc8; border-radius: var(--radius); padding: 10px; margin-top: 8px; }
.bank-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; margin-bottom: 6px; background: #fafafa; }

/* ═══ IMPORT ZONE ═══ */
.import-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 24px; text-align: center; transition: all .2s; cursor: pointer; }
.import-zone.dragover { border-color: var(--primary); background: #e8f5ee; }

/* ══════════════════════════════════════
   DASHBOARD SECTIONS
   ══════════════════════════════════════ */
.dashboard-section { margin-bottom: 24px; }
.dashboard-section > h3 { font-size: 16px; font-weight: 700; color: var(--primary-dark); margin-bottom: 12px; }
.dash-today { background: rgba(45,106,79,.12) !important; font-weight: 700 !important; }

/* ══════════════════════════════════════
   DETAIL VIEWS
   ══════════════════════════════════════ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.detail-section { background: var(--bg); border-radius: var(--radius); padding: 14px 16px; }
.detail-section h4 { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .3px; }
.detail-section p { margin: 4px 0; font-size: 13px; }
.detail-section p strong { color: var(--text); }

/* ══════════════════════════════════════
   TOUR CARDS & DETAILS
   ══════════════════════════════════════ */
.tour-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tour-code { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .3px; }
.tour-card-title { font-size: 15px; font-weight: 600; color: var(--primary-dark); margin-bottom: 8px; }

/* Tour list view */
.tours-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.tour-list-tile { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow); padding: 0; }
.tour-list-tile:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.tour-list-tile.tour-cancelled { opacity: .65; background: #fafafa; }
.tour-list-tile.tour-cancelled:hover { opacity: 1; }
.tour-card-colorbar { width: 12px; min-height: 72px; flex-shrink: 0; align-self: stretch; }
.tour-list-tile .tour-list-left, .tour-list-tile .tour-list-main, .tour-list-tile .tour-list-checks, .tour-list-tile .tour-list-weblinks, .tour-list-tile .tour-list-actions, .tour-list-tile .tour-list-extended { padding: 10px 0; }
.tour-list-tile .tour-list-left { padding-left: 10px; }
.tour-list-tile .tour-list-actions { padding-right: 10px; }
.tour-list-left { flex-shrink: 0; }
.tour-list-main { flex: 1; min-width: 0; }
.tour-list-name { font-size: 14px; font-weight: 600; color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-list-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-light); margin-top: 3px; }
.tour-list-actions { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.tour-list-docs { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.doc-indicator { font-size: 11px; white-space: nowrap; padding: 2px 6px; border-radius: 4px; background: #f5f5f0; }
.doc-indicator.doc-ok { background: #e8f5e9; color: #2e7d32; }
.doc-indicator.doc-none { background: #f5f5f5; color: #999; }

/* Tour card extended info */
.tour-list-extended { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--text-light); margin-top: 4px; }
.tour-list-extended .ext-info { display: inline; }
.tour-list-extended .ext-info small { color: #999; }

/* Tour card status checks row */
.tour-list-checks { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; flex-shrink: 0; padding-left: 8px; }
.tour-list-weblinks { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; width: 100%; padding: 6px 0 2px 0; border-top: 1px dashed var(--border); margin-top: 4px; }
.wl-label { font-size: 10px; color: #888; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-right: 2px; }
.wl-btn { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; text-decoration: none; transition: all .15s; white-space: nowrap; }
.wl-portal { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.wl-portal:hover { background: #dbeafe; color: #1e40af; }
.wl-cf { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.wl-cf:hover { background: #ffedd5; color: #9a3412; }
.ck-pill { display: inline-flex; align-items: center; gap: 2px; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; cursor: default; line-height: 1.3; }

/* Tour tile layout update for checks */
.tour-list-tile { flex-wrap: wrap; }
.tour-list-tile .tour-list-checks { width: 100%; padding-top: 6px; margin-top: 6px; border-top: 1px dashed var(--border); padding-left: 114px !important; padding-right: 10px; box-sizing: border-box; }
.tour-list-tile .tour-list-weblinks { padding-left: 114px !important; padding-right: 10px; box-sizing: border-box; }
.tour-list-tile .tour-list-actions { padding-left: 114px !important; padding-right: 10px; box-sizing: border-box; }
.status-clickable { transition: transform .15s, box-shadow .15s; }
.status-clickable:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* Revenue box in tour detail */
.tour-revenue-box { background: linear-gradient(135deg, #f5f5f0 0%, #e8f5e9 100%); border: 2px solid var(--primary-light); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0 16px; text-align: center; }
.revenue-label { font-size: 13px; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.revenue-amount { font-size: 28px; font-weight: 800; color: var(--primary-dark); line-height: 1.2; }
.revenue-sub { font-size: 12px; color: #666; margin-top: 4px; }

/* Document actions table in tour detail */
.doc-actions-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin: 12px 0; }
.doc-actions-table td { padding: 8px 10px; background: #fafaf5; vertical-align: middle; }
.doc-actions-table tr td:first-child { border-radius: 8px 0 0 8px; }
.doc-actions-table tr td:last-child { border-radius: 0 8px 8px 0; }
.doc-btn-cell { width: 180px; }
.doc-action-btn { width: 100%; font-size: 12px; font-weight: 600; border-radius: 6px; }
.doc-status-cell { font-size: 12px; }
.doc-amount-cell { font-size: 13px; font-weight: 600; color: var(--primary-dark); white-space: nowrap; }
.doc-tag { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.doc-tag.doc-generated { background: #e8f5e9; color: #2e7d32; }
.doc-tag.doc-pending { background: #f5f5f5; color: #999; }
.doc-tag.doc-link { background: #e3f2fd; color: #1565c0; text-decoration: none; cursor: pointer; }
.doc-tag.doc-link:hover { background: #bbdefb; }

/* Tour action bar */
.tour-action-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Accommodation detail sheet */
.accom-info-card { background: #fafaf5; border: 1px solid #e0ddd5; border-radius: 8px; padding: 10px 14px; }
.accom-info-label { font-size: 11px; text-transform: uppercase; color: #8d6e63; letter-spacing: .3px; margin-bottom: 2px; }
.accom-info-value { font-size: 15px; font-weight: 700; color: #3e2723; }

/* Responsive tour list docs */
@media (max-width: 768px) {
    .tour-list-docs { display: none; }
    .doc-actions-table td { display: block; width: 100%; border-radius: 0 !important; }
    .doc-actions-table tr td:first-child { border-radius: 8px 8px 0 0 !important; }
    .doc-actions-table tr td:last-child { border-radius: 0 0 8px 8px !important; }
    .doc-btn-cell { width: 100%; }
}

.tour-detail-header { margin-bottom: 16px; }
.tour-notes-bar { background: #fff8e1; border: 1px solid #ffe082; border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; font-size: 13px; }

/* ══════════════════════════════════════
   FORM ENHANCEMENTS
   ══════════════════════════════════════ */
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 6px; }
.check-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.check-inline input[type="checkbox"] { margin: 0; }
.inline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.time-input { width: 80px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; text-align: center; }
.time-input:focus { border-color: var(--primary); outline: none; }

/* ══════════════════════════════════════
   TABLE ENHANCEMENTS
   ══════════════════════════════════════ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.participant-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.participant-row:nth-child(even) { background: #f4f8f6; }
.participant-row:nth-child(odd) { background: #fff; }
.service-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.vehicle-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.row-allergy td { background: #fff3f3 !important; }
.row-vegetarian td { background: #f3fff3 !important; }
.row-vegan td { background: #f0fff0 !important; }

/* ══════════════════════════════════════
   SORT TABS
   ══════════════════════════════════════ */
.sort-tabs { display: flex; gap: 0; margin-bottom: 12px; border-bottom: 2px solid var(--border); }
.sort-tab { padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.sort-tab:hover { color: var(--text); }
.sort-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ══════════════════════════════════════
   TEMPLATES
   ══════════════════════════════════════ */
.templates-list { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
.template-item { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all var(--transition); background: var(--bg-card); }
.template-item:nth-child(even) { background: #f4f8f6; border-color: #c8ddd2; }
.template-item:hover { border-color: var(--primary-light); background: #f0f8f0; box-shadow: var(--shadow); }
.template-picker { background: var(--bg-card); border-radius: 12px; padding: 20px; max-width: 480px; width: 90%; box-shadow: var(--shadow-lg); max-height: 80vh; overflow-y: auto; }
.template-picker-overlay { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.tpl-day-badge { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 600; background: #e3f2fd; color: #1565c0; }

/* ══════════════════════════════════════
   DAY EDITOR
   ══════════════════════════════════════ */
.day-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: var(--bg-card); }
.day-editor:nth-child(even) { background: #f4f8f6; border-color: #c8ddd2; border-left: 3px solid var(--primary-light); }
.day-editor:nth-child(odd) { background: #fff; }
.day-editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #eee; }
.day-editor-header strong { color: var(--primary); font-size: 14px; }
.day-resources { margin-top: 10px; padding-top: 8px; border-top: 1px solid #eee; }
.guide-day-wrap { padding: 6px; border: 1px solid #e0e0e0; border-radius: var(--radius-sm); margin-bottom: 4px; background: #fafafa; }

/* ══════════════════════════════════════
   SUPPLIER SECTIONS & WARNINGS
   ══════════════════════════════════════ */
.supp-type-section { margin-bottom: 16px; }
.supp-type-section h4 { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.exp-warnings { background: #fff3cd; border: 1px solid #ffe082; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #856404; }
.exp-warnings p { margin: 3px 0; }

/* ══════════════════════════════════════
   ADDITIONAL BADGES
   ══════════════════════════════════════ */
.badge-warn { background: #fff3cd; color: #856404; }
.badge-info { background: #ebf5fb; color: var(--info); }
.badge-ok { background: #e8f5ee; color: var(--primary); }
.badge-done { background: #f0f0f0; color: #555; }
.badge-cancel { background: #fde8e8; color: var(--danger); }
.badge-tentative { background: #fff8e1; color: #e65100; border: 1px solid #ffcc80; }
.badge-food-vegetarian { background: #e8f5e9; color: #2e7d32; }
.badge-food-vegan { background: #e0f2f1; color: #00695c; }
.badge-food-allergies { background: #fce4ec; color: #c62828; }
.badge-food-gluten_free { background: #fff3e0; color: #e65100; }
.badge-food-lactose_free { background: #f3e5f5; color: #6a1b9a; }
.badge-food-halal { background: #e8eaf6; color: #283593; }
.badge-food-kosher { background: #fce4ec; color: #880e4f; }

/* ══════════════════════════════════════
   CALENDAR ADDITIONS
   ══════════════════════════════════════ */
.cal-today { background: rgba(45,106,79,.15) !important; font-weight: 700; color: var(--primary) !important; }
.cal-tile-locked { cursor: default !important; opacity: .7; }
.cal-month-hdr .cal-month-label { padding: 0; }
.cal-gap-tight { background: #fff3cd; }
.cal-gap-ok { background: #e8f5ee; }
.cal-sec-cazare, .cal-sec-barci, .cal-sec-ghizi { /* section header variants */ }
.cal-color-picker-overlay { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; }
.cal-color-picker-popup { background: var(--bg-card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-lg); }

/* ═══ UTILITIES ═══ */
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.text-sm { font-size: 12px; }
.hidden { display: none !important; }
.error { color: var(--danger); }

/* ═══ RESPONSIVE ═══ */
/* ══════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
   ══════════════════════════════════════ */
@media (max-width: 1024px) {
    .entity-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .assets-card-grid, .tours-card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .detail-grid { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
    .cal-panel { width: 320px; }
    .cal-panel.open { width: 320px; }
    .checkbox-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ══════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }
    body { font-size: 15px; }

    /* Sidebar: off-canvas, shown with .open */
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; z-index: 200; }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
    .sidebar.collapsed { transform: translateX(-100%); width: var(--sidebar-w) !important; }
    .sidebar.collapsed.open { transform: translateX(0); }
    /* Disable hover-expand on mobile — it causes touch glitches */
    .sidebar.collapsed:hover { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: none; }
    .sidebar.collapsed.open:hover { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
    .sidebar-close { display: block; }
    /* Show all labels when sidebar is open on mobile */
    .sidebar.open .nav-label, .sidebar.open .sidebar-title, .sidebar.open .sidebar-close,
    .sidebar.open .nav-group-label, .sidebar.open .user-info span, .sidebar.open .nav-external span:last-child { display: inline; }
    .sidebar.open .sidebar-header { padding: 16px 20px; justify-content: flex-start; }
    .sidebar.open .nav-item { padding: 12px 20px; justify-content: flex-start; gap: 12px; font-size: 15px; min-height: 44px; }
    .sidebar.open .nav-item.active { padding-left: 17px; }
    .sidebar.open .nav-item.nav-sub { padding-left: 48px; font-size: 14px; }
    .sidebar.open .sidebar-footer { padding: 12px 20px; }
    .sidebar.open .user-info { justify-content: space-between; font-size: 14px; }
    .sidebar.open .nav-group-label { font-size: 11px; padding: 16px 20px 6px; }

    /* Main content: full width on mobile */
    .main-content, .sidebar.pinned ~ .main-content { margin-left: 0 !important; }
    .content { padding: 12px; overflow-x: hidden; }

    /* Topbar */
    .topbar { padding: 0 12px; height: 52px; }
    .topbar h2 { font-size: 15px; }
    .topbar-actions { gap: 4px; }
    .topbar-actions .btn { padding: 7px 10px; font-size: 12px; min-height: 40px; }
    .hamburger { font-size: 24px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-icon { font-size: 24px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 11px; }

    /* Dashboard calendar */
    .dashboard-section > h3 { font-size: 15px; }
    .dash-cal-wrap { max-width: 100%; overflow: hidden; }
    .dash-cal-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
    .dash-cal-table { width: max-content; min-width: auto; }
    .dash-cal-hd { min-width: 30px; font-size: 10px; padding: 3px 1px; }
    .dash-cal-tile { min-width: 30px; font-size: 7px; }
    .dash-cal-cell { min-width: 30px; }
    .dash-cal-label { max-width: 100px; font-size: 11px; padding: 3px 6px; }
    .dash-cal-sticky { position: sticky; left: 0; z-index: 3; }

    /* Arrivals */
    .dash-arrival-card { padding: 10px 14px; }
    .dash-arrival-name { font-size: 14px; }
    .dash-arrival-info { font-size: 13px; }

    /* Quick links */
    .quick-links { gap: 6px; }
    .quick-links .btn { font-size: 13px; padding: 8px 12px; min-height: 40px; }

    /* Forms — 16px prevents iOS zoom */
    .form-row, .form-row-3, .form-grid { grid-template-columns: 1fr; }
    .detail-panel, .detail-grid { grid-template-columns: 1fr; }
    .form-group label { font-size: 12px; }
    .form-group input, .form-group select, .form-group textarea { font-size: 16px; padding: 10px 12px; }
    .inline-row { flex-direction: column; align-items: stretch; }

    /* Entities */
    .entity-grid { grid-template-columns: 1fr; gap: 8px; }
    .assets-card-grid, .tours-card-grid { grid-template-columns: 1fr; gap: 10px; }
    .entity-card { padding: 12px 14px; }
    .entity-card-name { font-size: 15px; }
    .entity-card-details { font-size: 13px; }
    .entity-card-meta { font-size: 13px; }

    /* Tour list */
    .tour-list-name { font-size: 15px; }
    .tour-list-meta { font-size: 13px; }
    .tour-list-tile { padding: 12px 14px; }
    .tour-list-extended { font-size: 12px; }

    /* Tables */
    .table-scroll { margin: 0 -12px; padding: 0 12px; }
    .data-table th, .data-table td { padding: 8px 10px; font-size: 13px; }

    /* Buttons — touch-friendly */
    .btn { padding: 9px 14px; font-size: 13px; min-height: 40px; }
    .btn-sm { padding: 7px 10px; font-size: 12px; min-height: 36px; }
    .btn-icon { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }

    /* Badges */
    .badge { font-size: 11px; }

    /* Section header */
    .section-header { gap: 8px; }
    .section-header h2 { font-size: 17px; }

    /* Tabs — horizontal scroll */
    .tab-bar { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tab-bar::-webkit-scrollbar { display: none; }
    .tab-btn { padding: 10px 14px; font-size: 13px; white-space: nowrap; min-height: 44px; }

    /* Day editor */
    .day-editor { padding: 10px; }
    .day-editor .form-grid { grid-template-columns: 1fr; }
    .day-editor-header strong { font-size: 15px; }

    /* Modal */
    .modal { width: 95vw; max-width: none; border-radius: 12px; }
    .modal-xl { max-width: none; }
    .modal-header { padding: 14px 16px; }
    .modal-header h3 { font-size: 15px; }
    .modal-header .btn-icon { min-width: 44px; min-height: 44px; font-size: 20px; }
    .modal-body { padding: 14px 16px; max-height: 85vh; }
    .modal-overlay { padding: 16px 8px; }
    .modal-sticky-save { margin: 16px -16px -14px; padding: 12px 16px; }
    .modal-sticky-save .btn { min-height: 44px; font-size: 14px; }

    /* Toast */
    .toast { font-size: 14px; max-width: 90vw; padding: 14px 20px; }

    /* Templates */
    .template-picker { width: 95%; max-width: none; padding: 16px; }
    .templates-list { max-height: 60vh; }

    /* Filters */
    .filters-bar { gap: 6px; }
    .filters-bar input, .filters-bar select { padding: 8px 10px; font-size: 14px; }
    .toolbar .search-box { min-width: 0; width: 100%; font-size: 15px; padding: 10px 14px; }

    /* Detail sections */
    .detail-section h4 { font-size: 14px; }
    .detail-section p { font-size: 14px; }

    /* Cards */
    .card { padding: 14px 16px; }

    /* Revenue */
    .revenue-amount { font-size: 24px; }
    .revenue-label { font-size: 13px; }

    /* Asset tiles */
    .asset-tile { padding: 12px 14px; }
    .asset-tile-name { font-size: 15px; }
    .asset-tile-meta { font-size: 13px; }

    /* Calendar full (Gantt) */
    .cal-header { flex-direction: column; gap: 6px; align-items: flex-start; }
    .cal-header-right { flex-wrap: wrap; }
    .cal-legend { font-size: 11px; }
    .cal-legend-hint { display: none; }
    .cal-panel { width: 100%; top: auto; bottom: 0; height: 50vh; border-left: none; border-top: 1px solid var(--border); border-radius: 12px 12px 0 0; }
    .cal-title { font-size: 15px; }

    /* Inline font-size overrides for JS-generated content (cannot override inline styles without !important) */
    .content [style*="font-size:10px"],
    .content [style*="font-size: 10px"] { font-size: 12px !important; }
    .content [style*="font-size:11px"],
    .content [style*="font-size: 11px"] { font-size: 13px !important; }
    .content [style*="font-size:12px"],
    .content [style*="font-size: 12px"] { font-size: 13px !important; }
    .modal-body [style*="font-size:10px"],
    .modal-body [style*="font-size: 10px"] { font-size: 12px !important; }
    .modal-body [style*="font-size:11px"],
    .modal-body [style*="font-size: 11px"] { font-size: 13px !important; }
    .modal-body [style*="font-size:12px"],
    .modal-body [style*="font-size: 12px"] { font-size: 13px !important; }
}

/* ══════════════════════════════════════
   RESPONSIVE — SMALL PHONE (≤480px)
   ══════════════════════════════════════ */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; gap: 6px; }
    .stat-card { padding: 10px 12px; }
    .toolbar { flex-direction: column; gap: 6px; }
    .toolbar .search-box { width: 100%; }
    .filters-bar { flex-direction: column; }
    .filters-bar input, .filters-bar select { width: 100%; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .section-header h2 { font-size: 16px; }
    .topbar h2 { font-size: 14px; }
    .topbar-actions .btn span:not(.nav-icon) { display: none; }

    /* Content padding */
    .content { padding: 10px; }
    .card { padding: 12px; }

    /* Dashboard calendar even tighter */
    .dash-cal-hd { min-width: 26px; font-size: 9px; }
    .dash-cal-tile { min-width: 26px; font-size: 6px; padding: 1px; }
    .dash-cal-cell { min-width: 26px; }
    .dash-cal-label { max-width: 70px; font-size: 10px; }

    /* Calendar full */
    .cal-panel { height: 60vh; }
    .cal-header-left { width: 100%; }
    .cal-header-right { width: 100%; justify-content: space-between; }

    /* Modal bottom sheet style */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
    .modal-body { max-height: 82vh; }

    .quick-links { flex-direction: column; }
    .quick-links .btn { width: 100%; justify-content: center; }

    /* Touch-friendly inputs */
    .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 16px; }
    .checkbox-label { padding: 6px 10px; font-size: 14px; }
    .check-inline { padding: 4px 6px; font-size: 14px; }

    /* Tour tiles */
    .tour-list-tile { padding: 10px 12px; }
    .tour-list-name { font-size: 14px; }

    /* Tab buttons */
    .tab-btn { padding: 8px 12px; font-size: 12px; }
}

/* ══════════════════════════════════════
   RESPONSIVE — LARGE DESKTOP (≥1400px)
   ══════════════════════════════════════ */
@media (min-width: 1400px) {
    .entity-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .assets-card-grid, .tours-card-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* ══════════════════════════════════════
   CALENDAR TOUCH-FRIENDLY
   ══════════════════════════════════════ */
/* Prevent long-press context menu on tiles */
.cal-tile { touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* Drag visual feedback */
.cal-tile.cal-drag-src { opacity: .5; }

/* Touch devices: larger tap targets */
@media (pointer: coarse) {
    .cal-row { min-height: 32px; }
    .cal-row-add { min-height: 30px; }
    .cal-tile { top: 1px; bottom: 1px; line-height: 28px; font-size: 10px; padding: 0 6px; min-height: 28px; }
    .cal-cell { min-height: 30px; }
    .cal-row-months { top: 0; }
    .cal-row-nums { top: 28px; font-size: 11px; min-height: 28px; }
    .cal-row-nums .cal-cell { line-height: 28px; }
    .cal-row-months .cal-cell { line-height: 28px; }
    .cal-panel { width: 92vw; max-width: 340px; }
    .cal-panel-btns { gap: 6px; }
    .cal-action-btn { padding: 8px 10px; font-size: 12px; min-height: 36px; }
    .cal-btn, .cal-nav-btn { min-height: 36px; min-width: 36px; font-size: 14px; }
    .cal-btn-add { min-height: 36px; padding: 0 14px; }
    .cal-legend-hint { display: none; } /* hide mouse hints on touch */
}

/* ══════════════════════════════════════
   PRINT
   ══════════════════════════════════════ */
@media print {
    .sidebar, .topbar, .modal-overlay, .toast, .hamburger, .btn, .quick-links, .topbar-actions, .filters-bar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content { padding: 0; }
    body { background: #fff; font-size: 12px; }
    .card, .entity-card, .asset-card, .tour-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .data-table { font-size: 10px; }
    .data-table th, .data-table td { padding: 4px 6px; }
}

/* ══════════════════════════════════════════
   AI CHAT WIDGET
   ══════════════════════════════════════════ */
#ai-chat-widget { position:fixed; bottom:20px; right:20px; z-index:10000; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
#ai-chat-toggle { width:56px; height:56px; border-radius:50%; border:none; background:linear-gradient(135deg,#1a5276,#2e86c1); color:#fff; font-size:24px; cursor:pointer; box-shadow:0 4px 16px rgba(0,0,0,.25); transition:transform .2s,box-shadow .2s; display:flex; align-items:center; justify-content:center; position:relative; }
#ai-chat-toggle:hover { transform:scale(1.1); box-shadow:0 6px 24px rgba(0,0,0,.35); }
.ai-chat-badge { position:absolute; top:-4px; right:-4px; background:#e53935; color:#fff; width:20px; height:20px; border-radius:50%; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.ai-chat-panel { display:flex; flex-direction:column; position:absolute; bottom:70px; right:0; width:400px; max-height:600px; background:#fff; border-radius:16px; box-shadow:0 8px 40px rgba(0,0,0,.2); overflow:hidden; border:1px solid #e0e0e0; }
.ai-chat-header { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:linear-gradient(135deg,#1a5276,#2e86c1); color:#fff; flex-shrink:0; }
.ai-chat-header-info { display:flex; align-items:center; gap:10px; }
.ai-chat-header-info small { opacity:.8; font-size:11px; }
.ai-chat-avatar { font-size:28px; }
.ai-chat-header-actions { display:flex; gap:4px; }
.ai-hdr-btn { background:rgba(255,255,255,.15); border:none; color:#fff; width:30px; height:30px; border-radius:6px; cursor:pointer; font-size:14px; transition:background .2s; }
.ai-hdr-btn:hover { background:rgba(255,255,255,.3); }
.ai-chat-messages { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; min-height:200px; max-height:380px; background:#f8f9fa; }
.ai-msg { display:flex; flex-direction:column; max-width:88%; animation:aiMsgIn .25s ease; }
.ai-msg-user { align-self:flex-end; }
.ai-msg-bot { align-self:flex-start; }
.ai-msg-system { align-self:center; }
.ai-msg-user .ai-msg-content { background:linear-gradient(135deg,#1a5276,#2e86c1); color:#fff; border-radius:16px 16px 4px 16px; padding:10px 14px; font-size:13px; line-height:1.5; }
.ai-msg-bot .ai-msg-content { background:#fff; color:#333; border-radius:16px 16px 16px 4px; padding:10px 14px; font-size:13px; line-height:1.5; box-shadow:0 1px 3px rgba(0,0,0,.08); border:1px solid #e8e8e8; }
.ai-msg-system .ai-msg-content { background:#e3f2fd; color:#1565c0; border-radius:10px; padding:6px 12px; font-size:11px; }
.ai-msg-time { font-size:10px; color:#999; margin-top:3px; padding:0 4px; }
.ai-msg-user .ai-msg-time { text-align:right; }
.ai-typing { display:inline-flex; gap:3px; }
.ai-typing::after { content:''; display:inline-block; animation:aiDots 1.2s infinite; }
@keyframes aiDots { 0%,60%{content:'●'} 20%{content:'●●'} 40%{content:'●●●'} }
@keyframes aiMsgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.ai-chat-quick { display:flex; flex-wrap:wrap; gap:6px; padding:8px 12px; background:#f0f4f8; border-top:1px solid #e0e0e0; flex-shrink:0; }
.ai-chat-quick button { font-size:11px; padding:5px 10px; border:1px solid #d0d8e0; border-radius:20px; background:#fff; color:#1a5276; cursor:pointer; white-space:nowrap; transition:all .2s; }
.ai-chat-quick button:hover { background:#e3f2fd; border-color:#2e86c1; }
.ai-chat-input { display:flex; align-items:flex-end; padding:10px 12px; background:#fff; border-top:1px solid #e0e0e0; gap:8px; flex-shrink:0; }
.ai-chat-input textarea { flex:1; border:1px solid #ddd; border-radius:12px; padding:8px 12px; font-size:13px; resize:none; outline:none; min-height:36px; max-height:120px; font-family:inherit; line-height:1.4; }
.ai-chat-input textarea:focus { border-color:#2e86c1; }
.ai-chat-input button { width:36px; height:36px; border:none; background:linear-gradient(135deg,#1a5276,#2e86c1); color:#fff; border-radius:50%; cursor:pointer; font-size:16px; flex-shrink:0; transition:transform .2s; }
.ai-chat-input button:hover { transform:scale(1.1); }
/* Full page mode */
.ai-chat-page { max-width:800px; margin:0 auto; height:calc(100vh - 120px); display:flex; flex-direction:column; border-radius:16px; overflow:hidden; box-shadow:0 4px 20px rgba(0,0,0,.1); border:1px solid #e0e0e0; }
.ai-chat-page .ai-chat-messages { max-height:none; flex:1; }
/* Responsive */
@media(max-width:480px) { .ai-chat-panel { width:calc(100vw - 20px); right:-10px; bottom:65px; max-height:75vh; } }
/* Code blocks in responses */
.ai-msg-content code { background:rgba(0,0,0,.06); padding:1px 5px; border-radius:3px; font-size:12px; font-family:'SF Mono',Monaco,Consolas,monospace; }
/* Tour template description clamp — max 4 lines */
.tpl-desc-clamp { display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; text-overflow:ellipsis; margin:0 0 6px; font-size:13px; line-height:1.5; color:#555; }

/* ═══ Asset Tiles — Full Row Layout ═══ */
.asset-tile { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:14px 18px; cursor:pointer; transition:var(--transition); box-shadow:var(--shadow); margin-bottom:8px; border-left:4px solid var(--primary); }
.asset-tile:hover { box-shadow:var(--shadow-lg); border-color:var(--primary-light); }
.asset-tile-warning { border-left:4px solid #f9a825; background:#fffde7; }
.asset-tile-expired { border-left:4px solid #e53935; background:#fff5f5; }
.asset-tile-expired:hover { border-color:#e53935; }
.asset-tile-warning:hover { border-color:#f9a825; }
.asset-tile-main { display:flex; align-items:center; gap:12px; }
.asset-tile-info { flex:1; min-width:0; }
.asset-tile-name { font-size:15px; font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.asset-tile-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; font-size:12px; color:var(--text-light); }
.asset-tile-meta span { white-space:nowrap; }
.asset-tile-expiry { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
.asset-exp-tag { font-size:11px; padding:3px 8px; border-radius:4px; white-space:nowrap; }
.asset-exp-ok { background:#e8f5e9; color:#2e7d32; }
.asset-exp-warning { background:#fff8e1; color:#e65100; font-weight:600; }
.asset-exp-expired { background:#ffebee; color:#c62828; font-weight:700; }
.asset-exp-tag em { font-style:normal; margin-left:2px; }
.asset-tile-alert { font-size:12px; font-weight:600; padding:6px 12px; border-radius:4px; margin-top:8px; }
.asset-alert-expired { background:#ffcdd2; color:#b71c1c; }
.asset-alert-warning { background:#fff3e0; color:#e65100; }
@media (max-width:600px) { .asset-tile-main { flex-wrap:wrap; } .asset-tile-expiry { flex-direction:column; } }
