/* ============================================================
   BloomBooks — Light & Airy Floral Event Management UI
   ============================================================ */

/* --- CSS Variables / Theme (Light - Default) --- */
:root, [data-theme="light"] {
  --bg-primary: #fafaf9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f3f0;
  --bg-card: #ffffff;
  --bg-hover: #f0eeeb;
  --bg-input: #ffffff;

  --border: #e8e4df;
  --border-light: #f0eeeb;

  --text-primary: #2d2d2d;
  --text-secondary: #6b6b6b;
  --text-muted: #a0a0a0;
  --text-link: #5a7d60;

  --accent: #6b8f71;
  --accent-end: #5a7d60;
  --accent-gradient: linear-gradient(135deg, #6b8f71, #5a7d60);
  --accent-soft: rgba(107,143,113,0.12);

  --secondary: #d4a0a0;
  --secondary-end: #c48b8b;
  --secondary-gradient: linear-gradient(135deg, #d4a0a0, #c48b8b);

  --success: #6b8f71;
  --warning: #d4a574;
  --danger: #c47070;
  --info: #7ca8c6;

  --sidebar-w: 240px;
  --sidebar-collapsed-w: 64px;
  --topbar-h: 56px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --transition: 0.2s ease;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-tertiary: #2e2e2e;
  --bg-card: #242424;
  --bg-hover: #333333;
  --bg-input: #1a1a1a;

  --border: #3a3a3a;
  --border-light: #2e2e2e;

  --text-primary: #e8e4df;
  --text-secondary: #a0a0a0;
  --text-muted: #6b6b6b;
  --text-link: #8fb896;

  --accent: #8fb896;
  --accent-end: #7da886;
  --accent-gradient: linear-gradient(135deg, #8fb896, #7da886);
  --accent-soft: rgba(143,184,150,0.15);

  --secondary: #d4a0a0;
  --secondary-end: #c48b8b;
  --secondary-gradient: linear-gradient(135deg, #d4a0a0, #c48b8b);

  --success: #8fb896;
  --warning: #d4a574;
  --danger: #d48080;
  --info: #8fb8d4;

  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107,143,113,0.12);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6b6b'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
textarea { resize: vertical; min-height: 80px; }

.hidden { display: none !important; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent-gradient); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(107,143,113,0.25); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--secondary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 6px; background: none; border: none; font-size: 1.1rem; color: var(--text-secondary); }
.btn-icon:hover { color: var(--text-primary); }

/* --- Login --- */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: #fafaf9;
  background-image: radial-gradient(circle at 30% 50%, rgba(107,143,113,0.07) 0%, transparent 60%),
                    radial-gradient(circle at 70% 80%, rgba(212,160,160,0.06) 0%, transparent 50%);
}
[data-theme="dark"] .login-screen {
  background: #1a1a1a;
  background-image: radial-gradient(circle at 30% 50%, rgba(143,184,150,0.06) 0%, transparent 60%),
                    radial-gradient(circle at 70% 80%, rgba(212,160,160,0.04) 0%, transparent 50%);
}
.login-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 44px; width: 400px; max-width: 95vw;
  box-shadow: var(--shadow-lg); text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 8px; }
.login-title { font-size: 1.5rem; font-weight: 700; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 0.9rem; }
.login-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: 3px; }
.login-tab { flex: 1; padding: 8px; border: none; background: transparent; color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 0.85rem; transition: all var(--transition); }
.login-tab.active { background: var(--bg-secondary); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input { width: 100%; padding: 11px 16px; }
.login-error { color: var(--danger); font-size: 0.85rem; text-align: left; padding: 8px 12px; background: rgba(196,112,112,0.08); border-radius: var(--radius-sm); }

/* --- App Shell --- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w); background: var(--bg-secondary);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transition: width var(--transition); overflow: hidden; flex-shrink: 0; z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-brand { display: none; }
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px; border-bottom: 1px solid var(--border); min-height: var(--topbar-h);
}
.sidebar-logo { font-size: 1.5rem; flex-shrink: 0; }
.sidebar-brand { font-size: 1.1rem; font-weight: 700; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; white-space: nowrap; }
.sidebar-collapse-btn { margin-left: auto; background: none; border: none; color: var(--text-secondary); font-size: 1.2rem; padding: 4px; }
.sidebar-collapse-btn:hover { color: var(--text-primary); }
.sidebar-nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  transition: all var(--transition); text-decoration: none; border: none; background: none;
  font-size: 0.9rem; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav-icon { font-size: 1.2rem; flex-shrink: 0; width: 24px; text-align: center; }
.nav-label { white-space: nowrap; }
.sidebar-footer { padding: 8px; border-top: 1px solid var(--border); }
.logout-btn { color: var(--text-muted) !important; }
.logout-btn:hover { color: var(--danger) !important; }

/* --- Topbar --- */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center;
  padding: 0 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary); flex-shrink: 0; gap: 16px;
}
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.3rem; }
.page-title { font-size: 1.1rem; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-icon { background: none; border: none; font-size: 1.2rem; color: var(--text-secondary); transition: color var(--transition); }
.topbar-icon:hover { color: var(--text-primary); }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--bg-tertiary); border-radius: 20px; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-gradient); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; color: #fff; flex-shrink: 0; }
.user-name { font-size: 0.85rem; color: var(--text-secondary); }

/* --- Content --- */
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* --- Cards --- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: #d8d4cf; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 1rem; font-weight: 600; }

/* --- Stat Cards --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 700; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-light); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap; }
th:hover { color: var(--text-secondary); }
th .sort-arrow { margin-left: 4px; font-size: 0.7rem; }
tr:nth-child(even) td { background: rgba(245,243,240,0.5); }
[data-theme="dark"] tr:nth-child(even) td { background: rgba(46,46,46,0.5); }
tr:hover td { background: var(--bg-hover); }
td { font-size: 0.9rem; }

/* --- Status Badges --- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 600; text-transform: capitalize;
}
.badge-inquiry { background: rgba(124,168,198,0.12); color: var(--info); }
.badge-proposal { background: rgba(212,165,116,0.15); color: var(--warning); }
.badge-confirmed { background: rgba(107,143,113,0.12); color: var(--success); }
.badge-in_progress, .badge-in-progress { background: rgba(212,165,116,0.12); color: #b8935a; }
.badge-completed { background: rgba(107,143,113,0.18); color: var(--success); }
.badge-cancelled { background: rgba(196,112,112,0.12); color: var(--danger); }
.badge-archived { background: rgba(160,160,160,0.12); color: var(--text-muted); }
.badge-draft { background: rgba(107,107,107,0.1); color: var(--text-secondary); }
.badge-sent { background: rgba(212,165,116,0.15); color: var(--warning); }
.badge-signed { background: rgba(107,143,113,0.12); color: var(--success); }
.badge-paid { background: rgba(107,143,113,0.18); color: var(--success); }
.badge-overdue { background: rgba(196,112,112,0.12); color: var(--danger); }
.badge-void { background: rgba(160,160,160,0.12); color: var(--text-muted); }

/* --- Tabs --- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 18px; border: none; background: none; color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Search / Filter Bar --- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .search-input { flex: 1; min-width: 200px; padding: 9px 14px 9px 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0a0'%3E%3Ccircle cx='7' cy='7' r='5.5' stroke='%23a0a0a0' stroke-width='1.5' fill='none'/%3E%3Cline x1='11' y1='11' x2='15' y2='15' stroke='%23a0a0a0' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }

/* --- Grid Layout for Catalog --- */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.catalog-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all var(--transition); cursor: pointer;
}
.catalog-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.catalog-item-img { height: 140px; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--text-muted); }
.catalog-item-img img { width: 100%; height: 100%; object-fit: cover; }
.catalog-item-body { padding: 14px; }
.catalog-item-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.catalog-item-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; justify-content: space-between; align-items: center; }
.catalog-item-price { font-weight: 600; color: var(--accent); }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn 0.15s ease;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); width: 560px; max-width: 95vw; max-height: 85vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.2rem; padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-body .form-group { margin-bottom: 16px; }
.modal-body label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; }
.modal-body .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal.modal-lg { width: 800px; }

/* --- Toast --- */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; color: #fff; animation: slideUp 0.2s ease;
  box-shadow: var(--shadow-lg); max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast-warning { background: var(--warning); }

/* --- Event Detail --- */
.event-header {
  display: flex; align-items: flex-start; gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.event-header-info { flex: 1; min-width: 250px; }
.event-header-info h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.event-header-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-secondary); font-size: 0.9rem; }
.event-header-meta span { display: flex; align-items: center; gap: 4px; }
.event-header-actions { display: flex; gap: 8px; align-items: flex-start; }

/* --- Arrangements / Sections --- */
.section-group { margin-bottom: 24px; }
.section-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--bg-tertiary); border-radius: var(--radius-sm);
  margin-bottom: 12px; cursor: pointer;
}
.section-group-title { font-weight: 600; font-size: 0.95rem; }
.section-group-total { font-weight: 600; color: var(--accent); }
.arrangement-card { margin-bottom: 12px; padding: 16px; }
.arrangement-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.arrangement-name { font-weight: 600; }
.arrangement-qty-price { font-size: 0.85rem; color: var(--text-secondary); }
.arrangement-components { margin-top: 8px; }
.component-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 0.85rem; border-bottom: 1px solid var(--border-light); }
.component-row:last-child { border-bottom: none; }
.component-name { flex: 1; }
.component-qty { width: 60px; text-align: right; color: var(--text-secondary); }
.component-cost { width: 80px; text-align: right; font-weight: 500; }

/* --- Order Summary --- */
.order-table { width: 100%; }
.order-section-header td { font-weight: 600; background: var(--bg-tertiary); }
.order-subtotal td { font-weight: 600; border-top: 2px solid var(--border); }
.order-grandtotal td { font-weight: 700; font-size: 1.1rem; border-top: 3px double var(--accent); }
.order-grandtotal .amount { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- Rental Pipeline --- */
.rental-status-bar { display: flex; gap: 4px; align-items: center; }
.rental-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); transition: background var(--transition); }
.rental-dot.active { background: var(--success); }
.rental-dot.current { background: var(--accent); box-shadow: 0 0 6px rgba(107,143,113,0.4); }
.rental-connector { width: 16px; height: 2px; background: var(--border); }
.rental-connector.active { background: var(--success); }

/* --- Timeline --- */
.timeline-list { position: relative; padding-left: 24px; }
.timeline-list::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-entry { position: relative; margin-bottom: 16px; padding: 12px 16px; background: var(--bg-tertiary); border-radius: var(--radius-sm); }
.timeline-entry::before { content: ''; position: absolute; left: -20px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-primary); }
.timeline-time { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.timeline-desc { margin-top: 2px; font-size: 0.9rem; }
.timeline-loc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

/* --- Contract --- */
.contract-editor { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 24px; min-height: 400px; line-height: 1.8; }
.contract-editor [contenteditable] { outline: none; }
.merge-field { background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 3px; font-family: monospace; font-size: 0.85rem; }

/* --- Payments --- */
.payment-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.payment-summary .card { text-align: center; }
.payment-amount { font-size: 1.4rem; font-weight: 700; }
.payment-amount.paid { color: var(--success); }
.payment-amount.due { color: var(--danger); }
.payment-amount.total { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- Reports Chart --- */
.chart-bar-container { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 10px 0; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--accent-gradient); min-height: 4px; transition: height 0.4s ease; }
.chart-bar-label { font-size: 0.7rem; color: var(--text-muted); }
.chart-bar-value { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-text { font-size: 1rem; margin-bottom: 16px; }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Inline Edit --- */
.editable { cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); transition: background var(--transition); }
.editable:hover { background: var(--bg-tertiary); }
.editable.editing { background: var(--bg-input); outline: 1px solid var(--accent); }

/* --- Color Palette Dots --- */
.color-dots { display: flex; gap: 6px; }
.color-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); }

/* --- Tag Pills --- */
.tag { display: inline-block; padding: 2px 8px; background: var(--bg-tertiary); border-radius: 10px; font-size: 0.75rem; color: var(--text-secondary); margin: 2px; }

/* --- Drag Handle --- */
.drag-handle { cursor: grab; color: var(--text-muted); font-size: 1rem; user-select: none; }
.drag-handle:active { cursor: grabbing; }

/* --- Print --- */
@media print {
  .sidebar, .topbar, .modal-overlay, .toast-container { display: none !important; }
  .main-wrapper { margin: 0; }
  .content { padding: 0; overflow: visible; }
  body { background: #fff; color: #000; overflow: visible; height: auto; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  .btn { display: none; }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0; z-index: 200;
    width: var(--sidebar-w); transition: left 0.25s ease;
    background: var(--bg-card);
  }
  .sidebar.mobile-open {
    left: 0 !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .sidebar.mobile-open .nav-label,
  .sidebar.mobile-open .sidebar-brand { display: block !important; }
  .sidebar.collapsed { left: -260px; width: var(--sidebar-w); }
  .mobile-menu-btn { display: block; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .payment-summary { grid-template-columns: 1fr; }
  .event-header { flex-direction: column; }
  .modal { width: 95vw; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .search-input { min-width: unset; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

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

/* --- Loading Spinner --- */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 60px; }

/* --- Misc Utilities --- */
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.w-full { width: 100%; }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
}
@media (max-width: 768px) {
  .sidebar.mobile-open ~ .sidebar-overlay { display: block; }
}

/* App Switcher in sidebar */
.sidebar-divider { height: 1px; background: var(--border); margin: 12px 16px; }
.sidebar-apps .nav-item { font-size: 0.85rem; padding: 8px 20px; opacity: 0.75; }
.sidebar-apps .nav-item:hover { opacity: 1; }
