/* FitChef User Dashboard – Premium health-focused */
:root {
  --primary: #0d2818;
  --primary-mid: #1a472a;
  --primary-light: #2d5a3d;
  --btn-color: #1f4e3c;
  --btn-hover: #286652;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --bg: #f8faf8;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5f6b7a;
  --border: #e5ebe5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

.dash-wrap { display: flex; min-height: 100vh; overflow-x: hidden; max-width: 100vw; width: 100%; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; }
.sidebar-overlay.open { display: block; }
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 101;
}
.sidebar-brand { padding: 24px; font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; }
.sidebar-logo { height: 52px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.sidebar-nav { padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background .2s, color .2s;
  border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: var(--accent); color: var(--primary); border-left-color: var(--primary); }
.nav-link .nav-icon { font-size: 1.2rem; flex-shrink: 0; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; max-width: 100%; overflow-x: hidden; }
.navbar {
  min-height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  min-width: 0;
}
.navbar-toggle { display: none; background: none; border: none; padding: 10px; cursor: pointer; color: var(--text); border-radius: var(--radius-sm); }
.navbar h2 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.navbar-right { display: flex; align-items: center; gap: 12px; }
.nav-notif-wrap { position: relative; }
.nav-notif-toggle { position: relative; width: 44px; height: 44px; border: none; background: transparent; color: #c9a227; cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.nav-notif-toggle:hover { background: var(--accent-soft); color: #d4af37; }
.nav-refresh-btn { width: 44px; height: 44px; border: none; background: transparent; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.nav-refresh-btn:hover { background: var(--accent-soft); color: var(--primary-mid); }
.nav-notif-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; border-radius: 10px; display: none; align-items: center; justify-content: center; }
.nav-notif-dropdown { position: absolute; top: 100%; right: 0; margin-top: 8px; width: 320px; max-width: 90vw; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 150; display: none; max-height: 360px; overflow: hidden; flex-direction: column; }
.nav-notif-dropdown.open { display: flex; }
.nav-notif-header { padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-notif-clear-btn { font-size: 0.8rem; color: var(--text-muted); background: none; border: none; cursor: pointer; text-decoration: underline; padding: 0; }
.nav-notif-clear-btn:hover { color: var(--accent); }
.nav-notif-list { overflow-y: auto; max-height: 280px; }
.nav-notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.nav-notif-item p { margin: 0 0 6px; font-size: 0.9rem; }
.nav-notif-item.read p { color: var(--text-muted); }
.nav-notif-date { font-size: 0.75rem; color: var(--text-muted); }
.nav-notif-dismiss { margin-top: 6px; font-size: 0.8rem; padding: 4px 10px; cursor: pointer; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.nav-notif-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.9rem; display: none; }
.navbar-right .user { font-size: 0.875rem; color: var(--text-muted); background: var(--bg); padding: 6px 12px; border-radius: 20px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.875rem; font-weight: 500; }
.btn-outline:hover { background: var(--bg); }
.btn-primary { background: var(--btn-color); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; font-size: 0.9rem; }
.btn-primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.content { flex: 1; padding: 20px 24px; overflow-x: hidden; overflow-y: auto; min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.view { display: none; }
.view.active { display: block; }

/* Overview */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 600; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: var(--primary-mid); }
.section-title { font-size: 1rem; font-weight: 600; margin: 24px 0 12px; color: var(--text); }
/* 3 per row on desktop to avoid vertical scroll and use space */
.meal-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .meal-cards { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (min-width: 960px) {
  .meal-cards { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
.meal-cards .dish-card-image { height: 140px; }
.meal-cards .dish-card-body { padding: 12px 14px; }
.meal-cards .dish-card-title { font-size: 0.98rem; margin-bottom: 6px; }
.meal-cards .dish-card-meta { font-size: 0.75rem; margin-bottom: 6px; }
.meal-cards .dish-card-benefits { font-size: 0.8rem; max-height: 2.4em; margin-bottom: 8px; }
.meal-cards .dish-card-footer { gap: 8px; }
.meal-cards .dish-card-actions .btn-outline,
.meal-cards .dish-card-actions .btn-primary { padding: 8px 12px; font-size: 0.85rem; }

/* Profile form */
.profile-form { max-width: 560px; }
.form-section { margin-bottom: 28px; }
.form-section h4 { margin: 0 0 12px; font-size: 0.9rem; font-weight: 600; color: var(--primary-mid); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  max-width: 100%;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--primary-mid); }
.form-row input[readonly] { background: var(--bg); color: var(--text-muted); }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-actions { margin-top: 24px; display: flex; gap: 12px; }

/* FitChef Kitchen (menu) */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; max-width: 100%; }
.filters input, .filters select { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; min-width: 0; }
/* 3 per row on desktop, 2 on tablet, 1 on mobile – less vertical scroll, use horizontal space */
.dish-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) {
  .dish-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (min-width: 960px) {
  .dish-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
.dish-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.dish-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.dish-card-image { width: 100%; height: 160px; object-fit: cover; background: var(--bg); }
.dish-card-body { padding: 14px 16px; }
.dish-card-title { margin: 0 0 6px; font-size: 1rem; font-weight: 600; color: var(--text); }
.dish-card-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.dish-card-benefits { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.35; max-height: 2.6em; overflow: hidden; text-overflow: ellipsis; }
.dish-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dish-card-price { font-size: 1.1rem; font-weight: 700; color: var(--primary-mid); }
.dish-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dish-card-actions .btn-outline, .dish-card-actions .btn-primary { padding: 8px 12px; font-size: 0.85rem; }
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%); background-size: 200% 100%; animation: skeleton 1.2s ease-in-out infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { to { background-position: 200% 0; } }

/* Orders */
.order-list { display: flex; flex-direction: column; gap: 16px; }
.order-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}
.order-card-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.order-card-id { font-weight: 600; color: var(--text); word-break: break-all; }
.order-card-date { font-size: 0.875rem; color: var(--text-muted); }
.order-card, .order-card-items, .stat-card { word-wrap: break-word; overflow-wrap: break-word; }
.order-card-status { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.order-card-status.preparing { background: #fef3c7; color: #92400e; }
.order-card-status.delivered { background: #d1fae5; color: #065f46; }
.order-card-status.cancelled { background: #fee2e2; color: #991b1b; }
.order-card-status.open { background: #dbeafe; color: #1e40af; }
.order-card-status.confirmed { background: #d1fae5; color: #065f46; }
.order-card-payment { font-size: 0.8rem; color: var(--text-muted); }
.order-card-items { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }

/* Notifications on My Orders */
.notifications-box { margin-bottom: 20px; }
.notifications-list { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px; }
.notification-item { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notification-item:last-child { border-bottom: none; }
.notification-item.read .notification-message { color: var(--text-muted); }
.notification-message { margin: 0; flex: 1 1 100%; }
.notification-date { font-size: 0.8rem; color: var(--text-muted); }
.order-history-title { margin: 0 0 12px; font-size: 1.1rem; }
.table-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; margin-bottom: 24px; }
.table-card h3 { margin: 0; padding: 20px 24px 8px; font-size: 1.15rem; }
.table-hint { margin: 0; padding: 0 24px 16px; font-size: 0.9rem; color: var(--text-muted); }
.table-wrap { overflow-x: hidden; width: 100%; }
.table-wrap table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table-wrap th, .table-wrap td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); word-break: break-word; }
.table-wrap th { background: var(--bg); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.table-wrap .empty, .table-wrap .loading { color: var(--text-muted); text-align: center; padding: 24px; }
.table-wrap .btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; cursor: pointer; border: none; background: var(--btn-color); color: #fff; font-weight: 500; }
.table-wrap .btn-sm:hover { background: var(--btn-hover); }
.order-card-total { font-weight: 700; color: var(--primary-mid); }

/* Feedback form */
.rating-stars { display: flex; gap: 8px; margin: 8px 0 16px; }
.rating-stars button { background: none; border: none; font-size: 1.75rem; cursor: pointer; padding: 0; line-height: 1; color: var(--border); transition: color .2s; }
.rating-stars button.active { color: #f59e0b; }
.rating-stars button:hover { color: #f59e0b; }
.feedback-form .form-row { margin-bottom: 20px; }
.feedback-form textarea { min-height: 100px; resize: vertical; }

/* Support form */
.support-form .form-row { margin-bottom: 18px; }

/* Cart (floating) */
.cart-badge {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  background: var(--primary-mid);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 50;
}
.cart-badge span { font-size: 1.25rem; }

/* Dish detail modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.open { display: flex; }
.modal-dialog {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: min(560px, calc(100vw - 24px));
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  margin: auto 0;
  box-sizing: border-box;
}
.modal-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; background: var(--bg); border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text-muted); z-index: 1; }
.modal-close:hover { color: var(--text); background: var(--border); }
.modal-dish .dish-detail-image { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.modal-dish .dish-detail-body { padding: 20px; }
.modal-dish .dish-detail-title { margin: 0 0 8px; font-size: 1.35rem; }
.modal-dish .dish-detail-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.modal-dish .dish-detail-macros { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.modal-dish .dish-detail-macros span { background: var(--accent-soft); color: var(--primary-mid); padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.85rem; }
.modal-dish .dish-detail-description { margin-bottom: 12px; font-size: 0.95rem; line-height: 1.5; }
.modal-dish .dish-detail-section { margin-bottom: 12px; font-size: 0.9rem; }
.modal-dish .dish-detail-section strong { display: block; margin-bottom: 4px; color: var(--text); }
.modal-dish .dish-detail-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-dish .dish-detail-price { font-weight: 700; font-size: 1.2rem; color: var(--primary-mid); }
.modal-dish .dish-detail-footer { display: flex; gap: 12px; flex-wrap: wrap; }

/* Place order modal */
.modal-place-order { max-width: 400px; }
.place-order-title { margin: 0 0 12px; font-size: 1.2rem; }
.place-order-dish { font-weight: 600; margin-bottom: 8px; }
.place-order-unit { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.place-order-qty { margin-bottom: 12px; }
.place-order-qty label { display: block; margin-bottom: 4px; }
.place-order-qty input { width: 80px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.place-order-date { margin-bottom: 12px; }
.place-order-date label { display: block; margin-bottom: 4px; }
.place-order-date input { width: 100%; max-width: 200px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.place-order-date .required { color: var(--text-muted); }
.place-order-total { font-weight: 700; font-size: 1.1rem; margin-bottom: 16px; }
#placeOrderContent { padding: 20px; }

/* Order created popup */
.modal-alert { max-width: 360px; text-align: center; padding: 24px; }
.order-created-message { margin: 0 0 20px; font-size: 1.1rem; }

/* Invoice modal */
.modal-invoice .invoice-print-body { padding: 20px; }
.modal-invoice .invoice-print-body h3 { margin: 0 0 16px; font-size: 1.25rem; }
.modal-invoice .invoice-print-body p { margin: 8px 0; font-size: 0.95rem; }
.invoice-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9rem; }
.invoice-table th, .invoice-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.invoice-table th { background: var(--bg); font-weight: 600; }
.invoice-total { margin-top: 12px; font-size: 1.1rem; }
.modal-invoice-actions { padding: 12px 20px; border-top: 1px solid var(--border); }

@media print {
  .dash-wrap, .sidebar, .navbar, .cart-badge, .modal-close, .modal-invoice-actions, .modal-overlay:not(.open) { display: none !important; }
  .modal-overlay.open { display: block !important; background: #fff; }
  .modal-dialog { box-shadow: none; max-height: none; }
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
    box-sizing: border-box;
  }
  .sidebar {
    display: none;
  }
  .sidebar-overlay {
    display: none !important;
  }
  .navbar {
    padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
    min-height: 56px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .navbar h2 {
    font-size: 1.05rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .content {
    padding: 16px max(12px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  }
  .overview-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .dish-grid { grid-template-columns: 1fr; gap: 14px; }
  .filters { gap: 10px; }
  .filters input, .filters select { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  .order-card { padding: 16px; }
  .order-card-header { gap: 8px; }
  .modal-dialog { padding-bottom: env(safe-area-inset-bottom); }
  .nav-notif-dropdown {
    position: fixed !important;
    top: 56px !important;
    right: 12px !important;
    left: auto !important;
    width: min(320px, calc(100vw - 24px)) !important;
    margin-top: 0 !important;
  }

  /* Bottom navigation – mirror Admin mobile for alignment */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(72px + env(safe-area-inset-bottom, 0));
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: #fafafa;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 999;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.04);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: #6b7280;
    transition: color 0.2s ease;
    padding: 10px 4px;
    border-top: 2px solid transparent;
  }
  .bottom-nav a:hover { color: #374151; }
  .bottom-nav a.active {
    color: #0d2818;
    font-weight: 600;
    border-top-color: #0d2818;
  }
  .bottom-nav .bn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
  }
  .bottom-nav .bn-icon svg { width: 22px; height: 22px; }
  .bottom-nav a.active .bn-icon { color: #0d2818; }
}

@media (max-width: 480px) {
  .sidebar { width: 100%; max-width: 100%; }
  .sidebar-brand { padding: 20px 16px; }
  .navbar-right .user { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding: 12px; }
  .dish-card-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dish-card-body { padding: 12px; }
  .stat-card { padding: 18px; }
  .profile-form .form-section { margin-bottom: 22px; }
  .modal-dialog { max-width: calc(100vw - 16px); }
  .place-order-date input { max-width: 100%; }
  .cart-badge { bottom: max(16px, env(safe-area-inset-bottom)); right: max(16px, env(safe-area-inset-right)); width: 52px; height: 52px; }
}

/* Prevent horizontal scroll - all data visible within viewport */
.dish-card-body, .modal-dialog { max-width: 100%; }
.invoice-table { max-width: 100%; table-layout: fixed; }
.invoice-table td, .invoice-table th { word-break: break-word; }

/* WhatsApp FAB – contact admin from inside app */
.whatsapp-fab {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  right: max(1.5rem, env(safe-area-inset-right));
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-fab:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5); }
.whatsapp-fab-icon { display: flex; align-items: center; justify-content: center; }
.whatsapp-fab-icon svg { width: 28px; height: 28px; }
@media (max-width: 768px) {
  .whatsapp-fab { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: max(1rem, env(safe-area-inset-right)); width: 52px; height: 52px; }
}
