/* ============================================================
   MENURAMA ADMIN — Admin UI Stylesheet
   Clean, professional white design with Inter font
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;

  /* Admin colors */
  --color-primary:       #ea580c; /* Corporate Orange */
  --color-primary-hover: #c2410c; /* Darker Corporate Orange */
  --color-primary-light: #fff7ed;
  --color-success:       #16a34a;
  --color-success-light: #f0fdf4;
  --color-error:         #dc2626;
  --color-error-light:   #fef2f2;
  --color-warning:       #d97706;
  --color-warning-light: #fffbeb;
  --color-info:          #0891b2;
  --color-info-light:    #f0f9ff;

  /* Neutrals */
  --color-bg:            #ffffff;
  --color-surface:       #f9fafb;
  --color-surface-hover: #f3f4f6;
  --color-border:        #e5e7eb;
  --color-border-focus:  #ea580c; /* Corporate Orange */
  --color-text:          #374151; /* Dark Gray from logo */
  --color-text-secondary:#4b5563;
  --color-text-muted:    #9ca3af;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 250ms ease;

  /* Layout */
  --nav-height:  64px;
  --max-width:   1200px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-full: 9999px;
}

/* ------------------------------------------------------------------ */
/*  Reset & Base                                                         */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* ------------------------------------------------------------------ */
/*  Admin Navbar                                                         */
/* ------------------------------------------------------------------ */
.admin-nav {
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  width: 100%;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: opacity var(--t-fast);
  margin-right: 2rem;
}
.nav-brand:hover { opacity: 0.8; }

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--color-primary-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: 0.25rem;
}

/* Desktop nav layout */
.nav-menu-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
}

.mobile-nav-toggle {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1.5rem;
  margin-right: auto;
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t-fast);
}

.nav-item:hover {
  color: var(--color-primary);
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: capitalize;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 0.25rem;
}

.nav-logout {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.nav-logout:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

@media (max-width: 768px) {
  .nav-container { padding: 0 1rem; }
  
  .nav-menu-wrapper {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 0;
    box-shadow: var(--shadow-sm);
  }
  
  .nav-menu-wrapper.show {
    display: flex;
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0;
    align-items: stretch;
    height: auto;
  }

  .nav-item {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--color-border);
    height: auto;
  }

  .nav-item.active::after {
    display: none; /* Hide bottom line active indicator on mobile */
  }
  
  .nav-item.active {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
  }

  .nav-user {
    width: 100%;
    padding: 1.25rem 1.5rem;
    flex-direction: row;
    justify-content: flex-start;
  }
  
  .nav-divider { display: none; }
  
  /* Hide view toggle on mobile dashboard */
  .view-toggle { display: none !important; }
}

/* ------------------------------------------------------------------ */
/*  Flash Messages                                                       */
/* ------------------------------------------------------------------ */
.flash-container {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
  width: calc(100vw - 2rem);
}

.flash-container--login {
  position: fixed;
  top: 1rem;
  right: 1rem;
}

.flash {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  box-shadow: var(--shadow-md);
  background: #fff;
  animation: flash-in 0.2s ease;
  transition: opacity 0.4s ease;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.flash-success { background: var(--color-success-light); border-color: #86efac; color: #166534; }
.flash-error   { background: var(--color-error-light);   border-color: #fca5a5; color: #991b1b; }
.flash-warning { background: var(--color-warning-light); border-color: #fde68a; color: #92400e; }
.flash-info    { background: var(--color-info-light);    border-color: #7dd3fc; color: #075985; }

.flash-icon {
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.flash-message { font-size: 0.875rem; font-weight: 500; flex: 1; }

.flash-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: inherit;
  opacity: 0.6;
  transition: opacity var(--t-fast);
  flex-shrink: 0;
  padding: 2px;
}
.flash-close:hover { opacity: 1; }

/* ------------------------------------------------------------------ */
/*  Layout                                                               */
/* ------------------------------------------------------------------ */
.admin-main {
  flex: 1;
  padding: 2rem 0;
}

.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.page-container--narrow {
  max-width: 720px;
}

/* ------------------------------------------------------------------ */
/*  Page Header                                                          */
/* ------------------------------------------------------------------ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-header-left { display: flex; flex-direction: column; gap: 0.25rem; }
.page-header-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.business-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: color var(--t-fast);
  margin-bottom: 0.25rem;
}
.back-link:hover { color: var(--color-primary); }

/* ------------------------------------------------------------------ */
/*  Buttons                                                              */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: #d1d5db;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--color-error);
  border-color: transparent;
}
.btn-danger-ghost:hover:not(:disabled) {
  background: var(--color-error-light);
  border-color: #fca5a5;
}

.btn-sm   { padding: 0.4rem 0.875rem; font-size: 0.8125rem; }
.btn-xs   { padding: 0.3rem 0.625rem; font-size: 0.75rem; }
/* Square icon-only button — keeps consistent size across all action rows */
.btn-icon { padding: 0.4rem; width: 2rem; height: 2rem; flex-shrink: 0; }
.btn-icon svg { display: block; }

/* Publish button special */
.btn-publish {
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Google login button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: var(--shadow-sm);
  border-color: #c7c9cc;
}

.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/*  Status Badges                                                        */
/* ------------------------------------------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge--published {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.status-badge--draft {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--green { background: var(--color-success); }
.status-dot--gray  { background: var(--color-text-muted); }

/* ------------------------------------------------------------------ */
/*  Business Cards (Grid & List View)                                    */
/* ------------------------------------------------------------------ */
.businesses-grid, .businesses-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.business-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  transition: box-shadow var(--t-base), transform var(--t-base);
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.business-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.business-card-title-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.business-card-title-group > div:not(.business-accent-dot, .user-avatar) {
  min-width: 0;
  flex: 1;
}

.business-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.business-card-status-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.business-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: none;
}

/* Mobile overrides if needed */
/* ------------------------------------------------------------------ */
/*  Empty State                                                          */
/* ------------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-state-icon {
  font-size: 4rem;
  line-height: 1;
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.empty-state-description {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  max-width: 400px;
}

/* ------------------------------------------------------------------ */
/*  Form Card                                                            */
/* ------------------------------------------------------------------ */
.form-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin-bottom: 2rem;
}

.form-card-header {
  margin-bottom: 1.25rem;
}

.form-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.form-group--narrow { max-width: 160px; }

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-label--sm { font-size: 0.8125rem; }

.form-required {
  color: var(--color-error);
  margin-left: 2px;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input::placeholder { color: var(--color-text-muted); }
.form-input--sm { padding: 0.45rem 0.75rem; font-size: 0.875rem; }

.form-color {
  width: 44px;
  height: 36px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--color-bg);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-preview {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  transition: background var(--t-fast);
}

.color-preview-label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-family: monospace;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.form-actions--inline {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: none;
  justify-content: flex-start;
}

/* ------------------------------------------------------------------ */
/*  Login Page                                                           */
/* ------------------------------------------------------------------ */
.login-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

.login-description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.login-footer-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: -0.5rem;
}

/* ------------------------------------------------------------------ */
/*  Sections & Items (business_edit)                                     */
/* ------------------------------------------------------------------ */
.sections-container {
  margin-top: 2rem;
}

.sections-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.sections-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.sections-count {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sections-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.section-drag-handle {
  color: var(--color-text-muted);
  cursor: grab;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.section-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.section-item-count {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.section-card-body {
  padding: 1rem 1.25rem;
}

.section-empty-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 1.5rem;
  font-style: italic;
}

.sections-empty {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Items Table */
.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.items-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

.items-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.item-row:last-child td { border-bottom: none; }
.item-row:hover { background: var(--color-surface); }

.item-name-text { font-weight: 500; color: var(--color-text); }

.item-desc-text {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.item-price-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.8125rem;
}

.item-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.item-img-link { display: inline-block; }
.no-image { color: var(--color-text-muted); font-size: 0.75rem; }

.item-actions-cell {
  text-align: right;
  width: 72px;
  white-space: nowrap;
}

.item-actions-cell .btn-ghost,
.item-actions-cell .btn-danger-ghost {
  display: inline-flex;
}

/* Edit item row */
.item-edit-row > td {
  padding: 0;
  border-bottom: 2px solid var(--color-primary-light);
}

.item-edit-cell {
  padding: 0 !important;
}

.edit-item-form-wrap {
  background: var(--color-primary-light);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1.25rem;
  animation: slide-down 0.15s ease;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Add item form */
.add-item-toggle-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
}

.add-item-form-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 0.75rem;
}

.add-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 768px) {
  .add-item-grid { grid-template-columns: 1fr; }
}

/* Image upload */
.image-upload-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.image-file-input { display: none; }

.image-preview {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.upload-status {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

/* Add section card */
.add-section-card {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.add-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.add-section-row {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .add-section-row { flex-direction: column; }
}

/* ------------------------------------------------------------------ */
/*  Business Edit Layout                                                 */
/* ------------------------------------------------------------------ */
.edit-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

.edit-layout > div {
  min-width: 0;
}

/* ------------------------------------------------------------------ */
/*  Side Panel (collapsible on mobile)                                  */
/* ------------------------------------------------------------------ */
.side-panel {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

/* Using <details>/<summary> for native collapse */
.side-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background var(--t-fast);
}
.side-panel summary::-webkit-details-marker { display: none; }
.side-panel summary:hover { background: var(--color-surface); }

.side-panel[open] summary {
  border-bottom-color: var(--color-border);
}

.side-panel-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.side-panel[open] .side-panel-chevron {
  transform: rotate(180deg);
}

.side-panel-body {
  padding: 1.25rem;
}

/* Publication status compact preview (shown when collapsed) */
.pub-status-preview {
  display: none; /* shown only on mobile summary line */
}

/* ------------------------------------------------------------------ */
/*  Inline Edit System (IE)                                             */
/* ------------------------------------------------------------------ */
.ie-field {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}
.ie-field:last-child { border-bottom: none; }

.ie-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.ie-view {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.ie-value {
  flex: 1;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.4;
  min-width: 0;
  word-break: break-word;
}

.ie-edit-btn, .ie-upload-btn, .ie-remove-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: color var(--t-fast);
}
.ie-edit-btn:hover { color: var(--color-primary); }
.ie-remove-btn:hover { color: var(--color-error); }
.ie-upload-btn:hover { color: var(--color-primary); }

.ie-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ie-input {
  flex: 1;
  padding: 0.45rem 0.65rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  font-family: inherit;
  transition: border-color var(--t-fast);
  min-width: 0;
}
.ie-input:focus { border-color: var(--color-border-focus); }


.ie-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

/* ------------------------------------------------------------------ */
/*  Items mobile card view                                              */
/* ------------------------------------------------------------------ */
.item-wrapper {
  display: flex;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  gap: 1rem;
  align-items: flex-start;
  background: var(--color-bg);
  transition: background var(--t-fast);
}
.item-wrapper:last-child { border-bottom: none; }
.item-wrapper:hover { background: var(--color-surface); }

.item-content-wrapper, .section-content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.item-content-wrapper {
  align-items: flex-start;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                           */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .edit-layout {
    grid-template-columns: 1fr;
  }
}

/* Mobile reordering for business edit page */
@media (max-width: 768px) {
  .business-edit-container {
    display: flex;
    flex-direction: column;
  }
  .business-edit-container .page-header,
  .business-edit-container .edit-layout {
    display: contents;
  }
  
  .business-edit-container .page-header-left {
    order: 1;
    margin-bottom: 0.5rem;
  }
  
  .business-edit-container .edit-layout > :first-child {
    order: 2;
    margin-bottom: 1rem;
  }
  
  .business-edit-container .page-header-right {
    order: 3;
    margin-bottom: 1rem;
  }
  
  .business-edit-container .edit-layout > :last-child {
    order: 4;
  }
}

@media (max-width: 768px) {
  .page-container { padding: 0 1rem; }
  .admin-main { padding: 1rem 0; }
  .form-card { padding: 1.25rem; }
  .page-title { font-size: 1.25rem; }

  /* Page header stacks vertically */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .page-header-right {
    display: flex;
    gap: 0.5rem;
  }
  .page-header-right .btn {
    flex: 1;
    justify-content: center;
  }

  /* Items table → card view */
  .items-table {
    display: block;
    width: 100%;
  }
  .items-table thead { display: none; }
  .items-table tbody { display: block; }
  .items-table tr.item-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    gap: 0.5rem;
    align-items: center;
    position: relative;
  }
  .items-table td {
    display: block;
    padding: 0.1rem 0;
    border: none;
    font-size: 0.875rem;
  }
  .items-table td.item-actions-cell {
    position: static;
    margin-left: auto;
  }
  /* Show item desc inline on mobile */
  .item-desc-text { max-width: 180px; }
}

@media (max-width: 640px) {
  .form-card { padding: 1rem; }
  .page-title { font-size: 1.1rem; }
  
  /* Make sure paddings match */
  .nav-container, .page-container { padding: 0 1rem; }
  
  .nav-links { gap: 1rem; }
  .nav-item { font-size: 0.875rem; }
  .user-info { display: none; }
  .nav-divider { display: none; }

  /* Side panels: enable collapse behavior via <details> */
  .side-panel {
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
  }
  .side-panel summary {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }
  .side-panel-body {
    padding: 1rem;
  }

  /* Show inline pub status in summary when collapsed */
  .pub-status-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: auto;
    margin-right: 0.5rem;
  }
  .pub-status-preview.is-published {
    color: var(--color-success);
  }
  .pub-status-preview.is-draft {
    color: var(--color-text-muted);
  }

  /* Item rows on mobile */
  .item-wrapper {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  /* Schedule grid on mobile */
  .schedule-grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* Menu settings form */
  .menu-settings-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .login-card { padding: 2rem 1.25rem; }
  .business-card-footer { flex-wrap: wrap; }
  /* Reduce action buttons spacing */
  .item-content-wrapper, .section-content-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .item-actions-group, .section-actions-group {
    width: 100%;
    justify-content: space-between;
  }

  .page-header-right .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Section header wraps on very small screens */
  .section-card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ------------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: slide-up 0.2s ease;
}

@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.modal-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--color-surface-hover); color: var(--color-text); }

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.qr-display {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-xs);
}

.qr-image {
  width: 200px;
  height: 200px;
  display: block;
}

.qr-info {
  text-align: center;
  width: 100%;
}

.qr-info-label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.qr-url-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
  word-break: break-all;
}
.qr-url-link:hover { text-decoration: underline; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* ------------------------------------------------------------------ */
/*  Loading Overlay                                                      */
/* ------------------------------------------------------------------ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ------------------------------------------------------------------ */
/*  Admin Footer                                                         */
/* ------------------------------------------------------------------ */
.admin-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/*  Card Payment Forms & CVV / Expiry Grid Alignment                   */
/* ------------------------------------------------------------------ */
.card-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.card-form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.card-expiry-cvv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
  align-items: start;
}

.card-input-box {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  background: #fff;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-input-box:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.14);
}

.card-input-box--centered {
  text-align: center;
  padding: 0.65rem 0.4rem;
  font-variant-numeric: tabular-nums;
}

/* Numeric and Amount Inputs */
.amount-input,
input[type="number"].amount-input,
input[inputmode="decimal"].amount-input {
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.amount-input::-webkit-inner-spin-button,
.amount-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .card-expiry-cvv-grid {
    gap: 0.5rem;
  }
  .card-form-label {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
  }
  .card-input-box--centered {
    padding: 0.65rem 0.25rem;
    font-size: 0.95rem;
  }
}

/* Items Container & Empty Section Message */
.items-container {
  min-height: 48px;
}
.items-container:has(.item-wrapper) .empty-section-msg {
  display: none !important;
}
.items-container:not(:has(.item-wrapper)) .empty-section-msg {
  display: block !important;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  line-height: 1.2;
}

.role-select-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 1.45rem 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 9px;
  line-height: 1.2;
  transition: all var(--t-fast, 0.15s ease);
  outline: none;
  font-family: inherit;
}

.role-select-badge:hover {
  background-color: #e5e7eb;
  border-color: #d1d5db;
  color: #111827;
}

.role-select-badge:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15);
}

/* Avatar Dropdown Desktop (Default) */
.user-avatar-dropdown {
  position: relative;
}

.avatar-trigger {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.user-info-mobile {
  display: none;
}

.avatar-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 120%;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  z-index: 1000;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0;
}

.avatar-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.25rem;
}

.avatar-dropdown-name-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-chevron {
  transition: transform 0.2s ease;
  color: #6b7280;
}

.avatar-trigger.expanded .dropdown-chevron {
  transform: rotate(180deg);
}

.avatar-dropdown-name {
  font-weight: 500;
  color: #111827;
  font-size: 0.95rem;
}

.avatar-dropdown-email {
  color: #6b7280;
  font-size: 0.85rem;
}

.avatar-dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.95rem;
}

.avatar-dropdown-item:hover {
  background-color: #f9fafb;
}

.avatar-dropdown-item.text-danger {
  color: #dc2626;
}

.avatar-dropdown-divider {
  border-top: 1px solid #e5e7eb;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* Avatar Dropdown Mobile (Accordion style) */
@media (max-width: 768px) {
  .nav-user {
    flex-wrap: wrap;
    padding: 1rem 1.5rem !important;
  }
  
  .user-avatar-dropdown {
    width: 100%;
  }
  
  .avatar-trigger {
    padding: 0.5rem 0;
  }
  
  .user-info-mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .desktop-only {
    display: none !important;
  }

  .avatar-dropdown-content {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin-top: 0.5rem;
    padding: 0;
    width: 100%;
    background-color: transparent;
  }
  
  .avatar-dropdown-item {
    padding: 0.75rem 0;
  }
}


.publish-default-radio:checked + .default-menu-star {
  fill: #f59e0b;
  stroke: #f59e0b;
}
.publish-default-radio:not(:checked) + .default-menu-star:hover {
  stroke: #9ca3af;
  fill: #f3f4f6;
}

/* Modal Publish Menu Items Layout */
.publish-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.publish-menu-item:hover {
  border-color: #d1d5db;
}

.publish-menu-item-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.publish-menu-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.publish-menu-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
  line-height: 1.3;
  word-break: break-word;
}

.publish-menu-item-status {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.35;
}

.publish-menu-item-default {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  margin-top: 0.15rem;
  width: fit-content;
  user-select: none;
}

.publish-menu-item-default-text {
  font-size: 0.75rem;
  color: #9ca3af;
  transition: color 0.15s;
}

.publish-default-radio:checked ~ .publish-menu-item-default-text {
  color: #d97706;
  font-weight: 500;
}

@media (max-width: 640px) {
  #modal-publish {
    padding: 0.5rem;
  }
  #publish-menu-list {
    padding: 1rem !important;
  }
  .publish-menu-item {
    padding: 0.75rem 0.85rem;
  }
}


/* ═══════════════════════════════════════════════════════════════
   Allergen Picker — Admin item modals
   ════════════════════════════════════════════════════════════════ */

/* The picker comes from allergens.css (published-content/default/common/)
   but admin needs to inline the icons as CSS background-image.
   We use the same data-allergen attribute on .allergen-icon-admin.
   The actual icon backgrounds are defined in allergens.css which is
   loaded as an inline style block at the top of business_edit.html. */

.allergen-picker {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
}

.allergen-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.4rem;
}

.allergen-chip-admin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0.3rem;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}

.allergen-chip-admin:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.allergen-chip-admin.is-selected {
  border-color: #b8621b;
  background: rgba(184, 98, 27, 0.06);
  box-shadow: 0 0 0 3px rgba(184, 98, 27, 0.12);
}

.allergen-icon-admin {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #d1d5db; /* fallback */
  flex-shrink: 0;
}

.allergen-chip-admin-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: #6b7280;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.allergen-chip-admin.is-selected .allergen-chip-admin-label {
  color: #92400e;
}

/* ── Admin Responsive Modal (Sheet on mobile, Centered on desktop) ──────── */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.admin-modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: adminModalFadeIn 0.22s ease-out;
}

@keyframes adminModalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.admin-modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  flex-shrink: 0;
}

.admin-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.admin-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #4b5563;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}
.admin-modal-close:hover {
  background: #e5e7eb;
  color: #111827;
  transform: scale(1.05);
}

.admin-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
  flex-shrink: 0;
}

/* Mobile Bottom-Sheet Behavior */
@media (max-width: 640px) {
  .admin-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .admin-modal-card {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    max-height: 90dvh;
    animation: adminModalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes adminModalSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .admin-modal-header {
    padding: 1rem 1.25rem;
  }
  .admin-modal-body {
    padding: 1rem 1.25rem;
  }
  .admin-modal-footer {
    padding: 0.85rem 1.25rem;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  }
}

/* ── Account Businesses & Billing Cards ── */
.account-biz-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  gap: 0.85rem;
  transition: border-color var(--t-fast);
}

.account-biz-card:hover {
  border-color: #d1d5db;
}

.account-biz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.account-biz-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.account-biz-name {
  font-weight: 600;
  color: #111827;
  font-size: 1.05rem;
  word-break: break-word;
}

.account-biz-id {
  font-size: 0.75rem;
  font-family: monospace;
  background: #f3f4f6;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: #4b5563;
}

.account-biz-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: center;
  font-size: 0.85rem;
}

.account-biz-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .account-biz-card {
    padding: 1rem;
    gap: 0.75rem;
  }
  .account-biz-actions {
    justify-content: stretch;
  }
  .account-biz-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

