/* ============================================================
   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-logo,
.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; min-width: 0; }

/* --- 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; width: 100%; overflow-x: auto; flex-wrap: nowrap; position: sticky; top: 0; z-index: 1000; background: var(--bg-primary, #ffffff); padding-top: 8px; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: #999 #f5f5f5; }
.tabs::-webkit-scrollbar { height: 10px; }
.tabs::-webkit-scrollbar-track { background: var(--bg-secondary, #f5f5f5); border-radius: 4px; }
.tabs::-webkit-scrollbar-thumb { background: #999; border-radius: 4px; }
.tabs::-webkit-scrollbar-thumb:hover { background: #666; }
.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 { background: var(--bg-secondary); }
.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, .tabs, .event-header, .btn, .tab:not(.active) { display: none !important; }
  .main-wrapper { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0 !important; overflow: visible !important; max-width: 100% !important; }
  body { background: #fff !important; color: #000 !important; overflow: visible !important; height: auto !important; font-size: 12px !important; }
  .card { border: none !important; box-shadow: none !important; background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .card-header { padding: 8px 0 !important; border-bottom: 2px solid #333 !important; margin-bottom: 8px !important; background: transparent !important; }
  .card-title { color: #000 !important; font-size: 16px !important; }
  table { width: 100% !important; border-collapse: collapse !important; font-size: 11px !important; }
  table th, table td { padding: 4px 6px !important; border-bottom: 1px solid #ddd !important; color: #000 !important; }
  table th { font-weight: 700 !important; border-bottom: 2px solid #666 !important; }
  .order-section-header td { font-size: 13px !important; font-weight: 700 !important; background: #f0f0f0 !important; }
  .order-grandtotal td { font-size: 14px !important; font-weight: 700 !important; border-top: 2px solid #333 !important; }
  .table-wrap { overflow: visible !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  @page { size: portrait; margin: 0.5in; }
}

/* --- 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; }

/* ---- File Manager ---- */
.files-layout { display:flex; gap:0; height:calc(100vh - 120px); }
.files-sidebar { width:260px; min-width:260px; background:#f8f6f0; border-right:1px solid #e0dcd4; padding:16px; overflow-y:auto; border-radius:12px 0 0 12px; }
.files-sidebar-header { font-weight:700; font-size:14px; color:#5a7a5a; margin-bottom:12px; text-transform:uppercase; letter-spacing:.5px; }
.files-folder-item { display:flex; align-items:center; gap:6px; padding:6px 10px; border-radius:8px; cursor:pointer; font-size:13px; position:relative; transition:background .15s; white-space:nowrap; min-height:32px; }
.files-folder-item:hover { background:#eae6dc; }
.files-folder-item.active { background:#5a7a5a22; font-weight:600; }
.files-folder-item .folder-icon { flex-shrink:0; font-size:14px; }
.files-folder-item .folder-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0; }
.files-folder-item .folder-actions { display:none; margin-left:auto; gap:2px; flex-shrink:0; }
.files-folder-item:hover .folder-actions { display:flex; }
.folder-event-badge { font-size:10px; background:#5a7a5a33; color:#5a7a5a; padding:1px 6px; border-radius:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:70px; flex-shrink:0; }
.folder-toggle { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; font-size:10px; color:#888; flex-shrink:0; cursor:pointer; border-radius:3px; }
.folder-toggle:hover { background:#ddd; color:#333; }
.folder-toggle-spacer { display:inline-block; width:16px; flex-shrink:0; }
.files-breadcrumb { display:flex; align-items:center; gap:4px; font-size:12px; color:#888; flex-wrap:wrap; }
.breadcrumb-link { cursor:pointer; color:#5a7a5a; }
.breadcrumb-link:hover { text-decoration:underline; }
.breadcrumb-current { font-weight:600; color:#333; cursor:default; }
.breadcrumb-current:hover { text-decoration:none; }
.breadcrumb-sep { color:#bbb; }
.files-main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.files-toolbar { display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid #e0dcd4; flex-wrap:wrap; }
.files-view-toggle { display:flex; gap:4px; }
.files-drop-zone { flex:1; overflow-y:auto; padding:16px; position:relative; }

/* File grid thumbnail cropping */
.file-thumb { width:100%; aspect-ratio:1; overflow:hidden; cursor:pointer; background:#f5f3ef; display:flex; align-items:center; justify-content:center; }
.file-thumb img { width:100%; height:100%; object-fit:cover; transition:transform .2s; }
.file-thumb:hover img { transform:scale(1.05); }
.file-thumb .file-icon-placeholder { font-size:3rem; }

/* Small grid mode */
.files-grid-sm { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:10px; }
.files-grid-sm .files-grid-item { border-radius:8px; }
.files-grid-sm .file-thumb { aspect-ratio:1; }
.files-grid-sm .file-info { padding:6px 8px; }
.files-grid-sm .file-name { font-size:0.7rem; }
.files-grid-sm .file-size { font-size:0.65rem; }
.files-grid-sm .file-item-actions { display:none; }
.files-grid-sm .file-checkbox { width:14px; height:14px; }

/* Large grid mode (default) */
.files-grid-lg { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; }
.files-grid-lg .file-thumb { aspect-ratio:1; }

.files-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:16px; }
.files-grid-item { background:#fff; border:1px solid #e0dcd4; border-radius:10px; overflow:hidden; position:relative; transition:box-shadow .15s; }
.files-grid-item:hover { box-shadow:0 4px 16px rgba(0,0,0,.1); }
.files-grid-item .file-checkbox { position:absolute; top:8px; left:8px; z-index:2; width:16px; height:16px; accent-color:#5a7a5a; }
.files-grid-item .file-delete-btn { position:absolute; top:6px; right:6px; z-index:2; opacity:0; transition:opacity .15s; }
.files-grid-item:hover .file-delete-btn { opacity:1; }

.file-size { font-size:11px; color:#999; margin-top:2px; }
/* List view */
.files-list { display:flex; flex-direction:column; gap:2px; }
.files-list-item { display:flex; align-items:center; gap:12px; padding:8px 12px; background:#fff; border-radius:8px; border:1px solid #e0dcd4; }
.files-list-item:hover { background:#f8f6f0; }
.file-list-thumb { width:40px; height:40px; border-radius:6px; overflow:hidden; flex-shrink:0; }
.file-list-thumb img { width:100%; height:100%; object-fit:cover; }
.file-list-name { flex:1; font-size:13px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-list-size, .file-list-date { font-size:12px; color:#888; white-space:nowrap; }
/* Drop overlay */
.drop-overlay { position:absolute; inset:0; background:rgba(90,122,90,.15); border:3px dashed #5a7a5a; border-radius:12px; display:flex; align-items:center; justify-content:center; z-index:10; }
.drop-overlay-text { font-size:1.2rem; font-weight:600; color:#5a7a5a; }
/* Progress */
.files-upload-progress { padding:12px 16px; }
.upload-status { font-size:13px; margin-bottom:6px; color:#555; }
.progress-bar-track { height:6px; background:#e0dcd4; border-radius:3px; overflow:hidden; }
.progress-bar-fill { height:100%; background:#5a7a5a; border-radius:3px; transition:width .2s; }
@media(max-width:768px) { .files-sidebar { display:none; } }

/* ============================================================
   Pull Sheets / Print Center
   ============================================================ */
.ps-layout { display: flex; height: calc(100vh - 64px); margin: -24px; }
.ps-controls { width: 320px; min-width: 320px; background: var(--bg-secondary); border-right: 1px solid var(--border); overflow-y: auto; padding: 20px; }
.ps-preview-wrap { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg-tertiary); }
.ps-preview { max-width: 800px; margin: 0 auto; background: white; color: #222; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); padding: 40px; font-size: 14px; line-height: 1.6; min-height: 400px; }

.ps-ctrl-title { font-size: 1.1rem; margin-bottom: 16px; color: var(--accent); }
.ps-ctrl-section { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin: 16px 0 8px; }

.ps-date-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ps-date-row input { flex: 1; padding: 6px 8px; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.ps-date-row span { color: var(--text-secondary); font-size: 0.8rem; }
.ps-quick-dates { display: flex; gap: 6px; margin-bottom: 12px; }
.ps-quick-dates .btn { font-size: 0.75rem; padding: 4px 10px; }

.ps-event-actions { display: flex; gap: 6px; margin-bottom: 8px; }
.ps-event-actions .btn { font-size: 0.75rem; padding: 3px 8px; }
.ps-event-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px; background: var(--bg-input); }
.ps-event-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 0.83rem; cursor: pointer; border-radius: 4px; color: var(--text-primary); }
.ps-event-item:hover { background: var(--bg-hover); }
.ps-event-item input { accent-color: var(--accent); }

.ps-template-row { display: flex; gap: 8px; }
.ps-template-row select { flex: 1; padding: 6px 8px; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; font-size: 0.83rem; }

.ps-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 0.85rem; }
.ps-toggle-row label { cursor: pointer; flex: 1; }
.ps-toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.ps-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ps-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 20px; transition: 0.2s; }
.ps-slider:before { content: ''; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.ps-toggle input:checked + .ps-slider { background: var(--accent); }
.ps-toggle input:checked + .ps-slider:before { transform: translateX(16px); }

.ps-print-btn { margin-top: 20px; }

/* Preview content styles (matching mockup) */
.ps-event-block { margin-bottom: 40px; }
.ps-page-break { border-top: 2px dashed #ccc; margin: 40px 0; }
.ps-header { border-bottom: 2px solid #333; padding-bottom: 16px; margin-bottom: 20px; }
.ps-company { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.ps-subtitle { font-size: 0.85rem; color: #666; }
.ps-event-title { font-size: 1.3rem; font-weight: 700; margin: 16px 0 8px; }
.ps-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: 0.85rem; margin-bottom: 16px; }
.ps-meta dt { font-weight: 600; color: #555; }
.ps-meta dd { margin: 0 0 4px; }
.ps-vendors { margin-top: 20px; }
.ps-vendors h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.ps-vendor-card { display: inline-block; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; margin: 0 8px 8px 0; font-size: 0.8rem; }
.ps-vendor-name { font-weight: 600; }
.ps-section { margin: 24px 0; }
.ps-section-title { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #ddd; padding-bottom: 4px; margin-bottom: 12px; }
.ps-line-item { margin-bottom: 16px; padding-left: 12px; border-left: 3px solid var(--accent); }
.ps-li-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.ps-li-name { font-weight: 600; font-size: 1rem; }
.ps-li-price { font-weight: 600; color: var(--accent); }
.ps-li-desc { font-size: 0.82rem; color: #666; margin-bottom: 6px; font-style: italic; }
.ps-li-images { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.ps-li-images img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }
.ps-recipe { font-size: 0.82rem; }
.ps-recipe table { width: 100%; border-collapse: collapse; }
.ps-recipe th { text-align: left; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; color: #888; border-bottom: 1px solid #eee; padding: 4px 8px; }
.ps-recipe td { padding: 3px 8px; border-bottom: 1px solid #f5f5f5; }
.ps-totals { margin-top: 24px; border-top: 2px solid #333; padding-top: 12px; text-align: right; }
.ps-totals .row { display: flex; justify-content: flex-end; gap: 24px; font-size: 0.9rem; margin-bottom: 4px; }
.ps-totals .total { font-size: 1.1rem; font-weight: 700; }
.ps-notes { margin-top: 16px; padding: 12px; background: #f9f9f9; border-radius: 6px; font-size: 0.85rem; }
.ps-notes strong { display: block; margin-bottom: 4px; }
.ps-section-break { page-break-before: always; }

@media print {
  .ps-controls { display: none !important; }
  .ps-layout { height: auto; margin: 0; }
  .ps-preview-wrap { padding: 0; background: white; }
  .ps-preview { box-shadow: none; border-radius: 0; max-width: 100%; padding: 20px; }
  .ps-page-break { page-break-before: always; border: none; margin: 0; }
  .ps-section-break { page-break-before: always; }
  .sidebar, .topbar, .toast-container { display: none !important; }
  .main-wrapper { margin: 0 !important; }
  .content { padding: 0 !important; }
}

/* Back to Event breadcrumb link */
.ps-back-link {
  display: inline-block;
  padding: 6px 0 10px;
  font-size: 0.85rem;
  color: #6c757d;
  text-decoration: none;
  transition: color 0.15s;
}
.ps-back-link:hover { color: #495057; text-decoration: underline; }
@media print { .ps-back-link { display: none !important; } }


/* ============================================================
   Notification Bell Dropdown
   ============================================================ */
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger, #c47070); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px; padding: 2px 4px;
  border-radius: 10px; text-align: center;
  pointer-events: none;
}
.notif-badge.hidden { display: none; }

.notif-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 380px; max-height: 480px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 1000; display: flex; flex-direction: column;
  overflow: hidden;
}
.notif-dropdown.hidden { display: none; }

.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.notif-title { font-weight: 700; font-size: 0.95rem; }
.notif-mark-all {
  background: none; border: none; color: var(--accent);
  font-size: 0.8rem; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.notif-mark-all:hover { background: var(--accent-soft); }

.notif-list { overflow-y: auto; flex: 1; max-height: 420px; }

.notif-date-sep {
  padding: 6px 16px; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em;
  background: var(--bg-tertiary); position: sticky; top: 0;
}

.notif-item {
  display: flex; gap: 10px; padding: 10px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.read { opacity: 0.55; }
.notif-item:not(.read) { background: var(--accent-soft); }

.notif-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.notif-content { flex: 1; min-width: 0; }
.notif-msg { font-size: 0.85rem; line-height: 1.4; }
.notif-msg strong { font-weight: 600; }
.notif-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.notif-empty {
  padding: 40px 16px; text-align: center;
  color: var(--text-muted); font-size: 0.9rem;
}

@media (max-width: 480px) {
  .notif-dropdown { width: calc(100vw - 24px); right: -8px; }
}

/* ============================================================
   Mobile/Tablet Touch Optimizations
   ============================================================ */

/* Touch-action on interactive elements */
button, a, input, select, textarea, .tab, .nav-item, .catalog-item, .btn, .editable, .files-folder-item, .files-grid-item, .files-list-item, .notif-item, .ps-event-item {
  touch-action: manipulation;
}

/* Minimum touch targets: 44px */
.btn { min-height: 44px; }
.btn-sm { min-height: 38px; }
.btn-icon { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.nav-item { min-height: 44px; }
.tab { min-height: 44px; }
.login-tab { min-height: 44px; }
.topbar-icon { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.modal-close { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-collapse-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.mobile-menu-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* Input font-size 16px prevents iOS zoom */
input, select, textarea { font-size: 16px; }

/* Body min font size */
body { font-size: max(14px, 1rem); }

/* Touch scrolling on scrollable areas */
.content, .modal-body, .sidebar-nav, .table-wrap, .tabs, .notif-list, .ps-controls, .ps-preview-wrap, .files-drop-zone, .ps-event-list {
  -webkit-overflow-scrolling: touch;
}

/* Tables horizontally scrollable */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tabs horizontally scrollable */

/* Cards touch padding */
.card { padding: 16px; }
.arrangement-card { padding: 16px; }
.component-row { padding: 10px 0; min-height: 44px; align-items: center; }
.event-item, .notif-item, .ps-event-item { min-height: 44px; }

/* Hover states → also apply on active for touch */
.btn-primary:active { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(107,143,113,0.25); }
.btn-secondary:active { background: var(--bg-hover); border-color: var(--secondary); }
.btn-ghost:active { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-item:active { background: var(--bg-hover); color: var(--text-primary); }
.catalog-item:active { background: var(--bg-secondary); }
tr:active td { background: var(--bg-hover); }

/* Topbar apps scrollable on small screens */
.topbar-apps { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-shrink: 1; min-width: 0; }
.topbar-apps::-webkit-scrollbar { display: none; }
.topbar-apps a { min-height: 36px; display: inline-flex; align-items: center; white-space: nowrap; }

/* Modal full-width on small screens */
@media (max-width: 768px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .modal.modal-lg { width: 100vw; }
  .modal-body .form-row { grid-template-columns: 1fr; }
  
  /* Print center layout stack */
  .ps-layout { flex-direction: column; height: auto; }
  .ps-controls { width: 100%; min-width: unset; max-height: 50vh; overflow-y: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .ps-preview-wrap { min-height: 50vh; }
  
  /* File manager adjustments */
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  
  /* Topbar apps row */
  .topbar-apps { display: flex !important; gap: 4px !important; }
  
  /* Stats grid */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Sidebar overlay for touch dismiss */
  .sidebar-overlay { cursor: pointer; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal-body .form-row { grid-template-columns: 1fr; }
  .payment-summary { grid-template-columns: 1fr; gap: 12px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .content { padding: 12px; }
  .topbar-apps { display: none !important; }
}

/* File move drag-drop & actions */
.folder-drop-hover { background:#5a7a5a33 !important; outline:2px dashed #5a7a5a; outline-offset:-2px; }
.file-item-actions { position:absolute; top:6px; right:6px; z-index:2; display:flex; gap:2px; opacity:0; transition:opacity .15s; }
.files-grid-item:hover .file-item-actions { opacity:1; }
.files-grid-item[draggable] { cursor:grab; }
.files-list-item[draggable] { cursor:grab; }

/* Inline rename input */
.inline-rename-input { width:100%; border:1px solid #5a7a5a; border-radius:4px; padding:1px 4px; font-size:inherit; font-family:inherit; outline:none; background:#fff; }
.inline-rename-input:focus { box-shadow:0 0 0 2px #5a7a5a44; }
.file-name, .file-list-name { cursor:default; }

/* Settings form alignment fix */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; background: var(--bg); color: var(--text-primary); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(107,143,113,0.2); }
.form-group input:disabled { background: var(--hover-bg); opacity: 0.7; cursor: not-allowed; }

/* Fix: center toggle button when sidebar collapsed */
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px 4px; }
.sidebar.collapsed .sidebar-collapse-btn { margin-left: 0; }

/* Fix: Print preview blank — app-shell clips content */
@media print {
  .app-shell { height: auto !important; overflow: visible !important; display: block !important; }
  .main-wrapper { overflow: visible !important; height: auto !important; }
}

/* Fix: Prevent page breaks splitting items and their recipes */
@media print {
  .ps-line-item { break-inside: avoid; page-break-inside: avoid; }
  .ps-section { break-inside: avoid; page-break-inside: avoid; }
  .ps-section table { break-inside: avoid; page-break-inside: avoid; }
  .ps-section table tr { break-inside: avoid; page-break-inside: avoid; }
}

/* ============================================================
   Print Header — Event Name + Version + Date/Time on every page
   ============================================================ */
#bb-print-header {
  display: none;
}
@media print {
  #bb-print-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 4px 0 6px;
    border-bottom: 1px solid #999;
    background: #fff;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  #bb-print-header .bb-ph-inner {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 10px;
    color: #333;
  }
  #bb-print-header .bb-ph-event {
    font-weight: 700;
    font-size: 12px;
  }
  #bb-print-header .bb-ph-version {
    font-weight: 600;
    margin-left: 8px;
    color: #666;
  }
  #bb-print-header .bb-ph-date {
    color: #666;
    font-size: 10px;
  }
  /* Push content down so it doesnt overlap the fixed header Bloom-Companion/ BloomOrderBook/ Curate-Calendar-Print/ Floral-Inventory-Manager/ Inventory-Scanner-Plus/ __pycache__/ bloom-orderbook-replit/ bloombooks-demo/ bloombooks-email/ builds/ dads-book/ dashboard-build/ davsoft-admin/ extensions/ family-data/ family-tree-build/ files/ flight-tracker/ im-v2-current/ inventory-manager-v2/ licensing-api/ marketing/ memory/ ob-import/ order-book-v2/ order-sheet-images/ proposal-system/ replit-sync/ saas-apps/ saas-hub/ saas/ scanner-current/ scanner-v2/ scripts/ tmp/ website/

/* ============================================================
   Print Header — Event Name + Version + Date/Time on every page
   ============================================================ */
#bb-print-header {
  display: none;
}
@media print {
  #bb-print-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 4px 0 6px;
    border-bottom: 1px solid #999;
    background: #fff;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  #bb-print-header .bb-ph-inner {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 10px;
    color: #333;
  }
  #bb-print-header .bb-ph-event {
    font-weight: 700;
    font-size: 12px;
  }
  #bb-print-header .bb-ph-version {
    font-weight: 600;
    margin-left: 8px;
    color: #666;
  }
  #bb-print-header .bb-ph-date {
    color: #666;
    font-size: 10px;
  }
  body {
    margin-top: 36px !important;
  }
}

/* ============================================================
   Print: Prevent recipes/line items from splitting across pages
   ============================================================ */
@media print {
  .arr-line-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .arr-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .arr-li-recipe {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .arr-li-recipe table {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ============================================================
   Print: Gallery images — match portal layout, hide controls
   ============================================================ */
@media print {
  /* Hide gallery control buttons */
  .arr-gallery-del,
  .arr-gallery-move,
  .arr-gallery-add,
  .arr-gallery-file {
    display: none !important;
  }
  /* Clean gallery layout for print */
  .arr-gallery {
    overflow: visible !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 4px 0 8px !important;
  }
  .arr-gallery-thumb {
    flex-shrink: 0 !important;
  }
  .arr-gallery-thumb img {
    height: 80px !important;
    width: 80px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
  }
  /* Hide interactive elements in line items */
  .arr-comp-search,
  .arr-comp-results,
  .arr-li-handle,
  .arr-sec-handle,
  .arr-del-li,
  .arr-del-sec,
  .arr-gen-desc,
  .arr-li-expand,
  .arr-reset-li-price,
  .arr-reset-sec-price,
  .arr-fee-type,
  .arr-fee-value,
  #arr-add-section,
  #arr-toggle-sections,
  #arr-toggle-items {
    display: none !important;
  }
  /* Make qty and price inputs look like text */
  .arr-li-qty,
  .arr-li-price-input,
  .arr-sec-price {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    color: #000 !important;
  }
}
