/* ============================================================
   MESSHUB — Food Startup Design System
   CSS Variables + Dark Mode + Responsive
   ============================================================ */

/* fonts loaded locally via /fonts/inter.css */

/* ── Light Theme (Default) ── */
:root {
  --brand-primary: #ff6b2c;
  --brand-primary-hover: #e85a1e;
  --brand-primary-light: #fff1eb;
  --brand-primary-glow: rgba(255, 107, 44, 0.25);
  --brand-gradient: linear-gradient(135deg, #ff6b2c 0%, #ff9f43 100%);
  --brand-gradient-hover: linear-gradient(135deg, #e85a1e 0%, #f09030 100%);

  --bg-body: #f8f6f3;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fffaf7;
  --bg-input: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.88);
  --bg-dropdown: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.4);
  --bg-code: #f5f3f0;
  --bg-table-header: #faf8f6;
  --bg-hover: #fff5ef;

  --border-light: #f0ece8;
  --border-medium: #e5e0db;
  --border-input: #ddd7d0;
  --border-input-focus: #ff6b2c;

  --text-primary: #1a1714;
  --text-secondary: #6b6560;
  --text-tertiary: #9c9590;
  --text-inverse: #ffffff;
  --text-link: #ff6b2c;

  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-info: #3b82f6;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-brand: 0 8px 24px rgba(255, 107, 44, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  --z-sidebar: 1001;
  --z-overlay: 999;
  --z-dropdown: 1000;
  --z-topbar: 100;
}

/* ── Dark Theme — Windows 11 Captured Motion (cool neutral dark) ── */
[data-theme="dark"] {
  --brand-primary: #ff7a3d;
  --brand-primary-hover: #ff8f57;
  --brand-primary-light: #2e1f12;
  --brand-primary-glow: rgba(255, 122, 61, 0.18);
  --brand-gradient: linear-gradient(135deg, #ff7a3d 0%, #ffad5c 100%);
  --brand-gradient-hover: linear-gradient(135deg, #ff8f57 0%, #ffc078 100%);

  --bg-body: #1c1c1c;
  --bg-sidebar: #202020;
  --bg-card: #2c2c2c;
  --bg-card-hover: #333333;
  --bg-input: #2a2a2a;
  --bg-topbar: rgba(28, 28, 28, 0.95);
  --bg-dropdown: #2c2c2c;
  --bg-overlay: rgba(0, 0, 0, 0.65);
  --bg-code: #252525;
  --bg-table-header: #313131;
  --bg-hover: #333333;

  --border-light: #3a3a3a;
  --border-medium: #404040;
  --border-input: #4a4a4a;
  --border-input-focus: #ff7a3d;

  --text-primary: #ffffff;
  --text-secondary: #adadad;
  --text-tertiary: #717171;
  --text-inverse: #1c1c1c;
  --text-link: #ff8f57;

  --color-success: #4ade80;
  --color-success-bg: #0f2419;
  --color-success-border: #15803d;
  --color-danger: #f87171;
  --color-danger-bg: #2d1515;
  --color-danger-border: #7f1d1d;
  --color-warning: #fbbf24;
  --color-warning-bg: #2d2310;
  --color-warning-border: #92400e;
  --color-info: #60a5fa;
  --color-info-bg: #15202d;
  --color-info-border: #1e40af;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.65);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 8px 24px rgba(255, 122, 61, 0.12);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-primary-hover); }
img { max-width: 100%; height: auto; }

/* ============================================================
   LAYOUT — App Shell
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: var(--z-sidebar);
  transition: background var(--transition-normal), border-color var(--transition-normal), left var(--transition-normal);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 20px; color: var(--text-primary);
  margin-bottom: 28px; padding: 4px 8px;
  letter-spacing: -0.3px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
.brand-icon {
  background: var(--brand-gradient);
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  font-size: 22px;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
}

.menu-group { margin-bottom: 4px; }
.menu-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--brand-primary); font-weight: 700;
  margin: 16px 0 6px; padding: 8px 12px;
  cursor: pointer; border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  user-select: none;
}
.menu-title:hover { background: var(--bg-hover); }

.menu-items { display: none; }
.menu-items.open { display: block; }

nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 24px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
nav a:hover { background: var(--bg-hover); color: var(--brand-primary); }

.dashboard-link { font-weight: 600; color: var(--brand-primary); margin-bottom: 16px; }

/* ── Main ── */
main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* ── Topbar ── */
.topbar {
  height: 64px;
  display: flex; justify-content: flex-end; align-items: center;
  padding: 0 24px;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0;
  z-index: var(--z-topbar);
  transition: background var(--transition-normal), border-color var(--transition-normal);
  gap: 8px;
}

.menu-toggle {
  display: none; background: transparent; border: none;
  font-size: 22px; cursor: pointer; color: var(--brand-primary);
  padding: 8px; border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.menu-toggle:hover { background: var(--bg-hover); }

/* ── User Area & Avatar ── */
.user-area { position: relative; cursor: pointer; display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px;
  transition: box-shadow var(--transition-fast);
}
.avatar:hover { box-shadow: var(--shadow-brand); }

/* ── Theme Toggle ── */
.theme-toggle { display: flex; align-items: center; gap: 8px; margin-right: 4px; }

.theme-switch { position: relative; width: 48px; height: 26px; cursor: pointer; }
.theme-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.theme-slider {
  position: absolute; inset: 0;
  background: #d4cfc9;
  border-radius: var(--radius-full);
  transition: background var(--transition-normal);
}
.theme-slider::before {
  content: '';
  position: absolute; width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: transform var(--transition-normal);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.theme-switch input:checked + .theme-slider { background: var(--brand-primary); }
.theme-switch input:checked + .theme-slider::before { transform: translateX(22px); }

.theme-icon { font-size: 18px; line-height: 1; transition: opacity var(--transition-fast); }

/* ── Dropdown Menu ── */
.dropdown {
  position: absolute; right: 0; top: 52px;
  background: var(--bg-dropdown); width: 200px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  display: none; z-index: var(--z-dropdown);
  overflow: hidden;
  transition: background var(--transition-normal), border-color var(--transition-normal);
}
.dropdown.show { display: block; }
.dropdown .name { padding: 14px 16px; font-weight: 700; border-bottom: 1px solid var(--border-light); color: var(--text-primary); font-size: 15px; }
.dropdown .item { padding: 12px 16px; font-size: 14px; cursor: pointer; color: var(--text-secondary); transition: all var(--transition-fast); }
.dropdown .item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown .logout { color: var(--color-danger); }
.dropdown .logout:hover { background: var(--color-danger-bg); }

.sidebar-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100vh;
  background: var(--bg-overlay); z-index: var(--z-overlay);
  backdrop-filter: blur(4px);
}
.sidebar-overlay.show { display: block; }

/* ============================================================
   CONTENT & SECTIONS
   ============================================================ */
.content { padding: 28px; transition: padding var(--transition-fast); }
.subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 4px; }

.section-content { display: none; }
.section-content.active { display: block; }

.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap; gap: 12px;
}

h1 {
  font-size: 26px; font-weight: 800; color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.4px; margin: 0;
}
h2 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 12px 0 8px; }
h3 { font-size: 14px; color: var(--text-secondary); font-weight: 600; margin: 0 0 8px; }

.btn-back {
  background: transparent; border: 2px solid var(--brand-primary);
  color: var(--brand-primary); padding: 8px 18px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 600;
  transition: all var(--transition-fast); white-space: nowrap;
}
.btn-back:hover { background: var(--brand-primary); color: var(--text-inverse); }

/* ============================================================
   CARDS — Dashboard Stats
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-top: 24px;
}
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card h3 { font-size: 13px; color: var(--text-tertiary); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.number { font-size: 28px; font-weight: 800; color: var(--brand-primary); font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; }

/* ============================================================
   FORM STYLES
   ============================================================ */
.form-container {
  max-width: 540px; margin: 24px 0;
  background: var(--bg-card); padding: 28px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

.form-group { margin-bottom: 20px; position: relative; }

.form-group label {
  display: block; margin-bottom: 8px;
  font-weight: 600; color: var(--text-primary); font-size: 14px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-input); color: var(--text-primary);
  transition: all var(--transition-fast);
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

#suggestionsList {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  max-height: 300px; overflow-y: auto;
  z-index: 1000 !important;
  box-shadow: var(--shadow-lg);
}

.message { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; display: none; }
.message.error { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid var(--color-danger-border); display: block; }
.message.success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid var(--color-success-border); display: block; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  width: 100%; padding: 13px 20px;
  border-radius: var(--radius-md); border: none;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all var(--transition-fast);
  position: relative; font-family: inherit;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }

.btn.primary { background: var(--brand-gradient); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-gradient-hover); box-shadow: var(--shadow-brand); }

.btn.outline { border: 2px solid var(--brand-primary); background: transparent; color: var(--brand-primary); }
.btn.outline:hover:not(:disabled) { background: var(--brand-primary-light); }

.btn.secondary { background: var(--bg-hover); color: var(--text-primary); margin-bottom: 16px; }
.btn.secondary:hover:not(:disabled) { background: var(--border-light); }

/* ============================================================
   LOGIN / REGISTER — Auth Pages
   ============================================================ */
.container {
  width: 100%; padding: 20px; min-height: 100vh;
  display: flex; justify-content: center; align-items: center;
  background: var(--bg-body);
  transition: background var(--transition-normal);
}

.container .card {
  width: 100%; max-width: 460px; margin: auto;
  background: var(--bg-card); border-radius: var(--radius-xl);
  padding: 32px; box-shadow: var(--shadow-lg);
  text-align: center;
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

.logo {
  background: var(--brand-gradient);
  width: 56px; height: 56px; margin: 0 auto 8px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px;
  box-shadow: var(--shadow-brand);
}

.tabs {
  display: flex; margin: 20px 0;
  background: var(--bg-hover);
  border-radius: var(--radius-md); overflow: hidden;
  padding: 3px; border: 1px solid var(--border-light);
}
.tab {
  flex: 1; padding: 11px 8px; border: none;
  background: transparent; cursor: pointer;
  font-weight: 600; font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.tab.active { background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-sm); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-full); margin: 16px auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.icon.google { background: var(--color-info-bg); color: var(--color-info); }
.icon.shield { background: var(--brand-primary-light); }

input {
  width: 100%; padding: 13px 16px; margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-input);
  font-size: 14px; background: var(--bg-input);
  color: var(--text-primary);
  transition: all var(--transition-fast); font-family: inherit;
}
input:focus { outline: none; border-color: var(--border-input-focus); box-shadow: 0 0 0 3px var(--brand-primary-glow); }
input::placeholder { color: var(--text-tertiary); }

select {
  width: 100%; padding: 13px 16px; margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-input);
  font-size: 14px; background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast); font-family: inherit;
}
select:focus { outline: none; border-color: var(--border-input-focus); box-shadow: 0 0 0 3px var(--brand-primary-glow); }

.gender { display: flex; gap: 10px; margin-bottom: 16px; }
.gender button {
  flex: 1; padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-input);
  background: var(--bg-input); color: var(--text-primary);
  cursor: pointer; font-weight: 500;
  transition: all var(--transition-fast);
}
.gender button.active { background: var(--brand-gradient); color: #fff; border-color: transparent; }

.footer-text { margin-top: 18px; font-size: 13px; color: var(--text-secondary); }
.footer-text a, .footer-text span { color: var(--brand-primary); cursor: pointer; font-weight: 600; }
.footer-text a:hover, .footer-text span:hover { color: var(--brand-primary-hover); }

.forgot { margin-bottom: 16px; text-align: right; }
.forgot a { font-size: 13px; color: var(--brand-primary); }
.forgot a:hover { color: var(--brand-primary-hover); }

.info-box {
  background: var(--bg-hover); padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6; margin-top: 16px;
  border: 1px solid var(--border-light);
}

.hint { font-size: 12px; color: var(--text-tertiary); margin-bottom: 14px; }

.error-message, #error-message, #otp-error-message, #password-error-message {
  color: var(--color-danger); font-size: 13px;
  padding: 10px 14px; background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm); margin-bottom: 16px; display: none;
}
.success-message, #success-message {
  color: var(--color-success); font-size: 13px;
  padding: 10px 14px; background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-sm); margin-bottom: 16px; display: none;
}

.otp { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.otp input {
  width: 46px; height: 52px; text-align: center;
  font-size: 20px; font-weight: 700;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-primary);
  padding: 0; margin: 0;
  transition: all var(--transition-fast);
}
.otp input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-glow); }

/* ============================================================
   MAP
   ============================================================ */
#map, #map-add-mess, #map-edit-mess, #browse-map {
  height: 320px; border-radius: var(--radius-md);
  margin: 12px 0 16px; position: relative; z-index: 1;
  border: 1px solid var(--border-light);
}
.location-row { display: flex; gap: 12px; }

/* ============================================================
   TABLE STYLES
   ============================================================ */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table thead tr { background: var(--bg-table-header); border-bottom: 2px solid var(--border-medium); }
table th {
  padding: 12px 14px; text-align: left;
  font-weight: 600; color: var(--text-secondary);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px;
}
table td { padding: 12px 14px; color: var(--text-primary); border-bottom: 1px solid var(--border-light); }
table tbody tr { transition: background var(--transition-fast); }
table tbody tr:hover { background: var(--bg-hover); }

/* ============================================================
   VIEW MESS CARDS
   ============================================================ */
.view-mess-wrapper { margin-top: 24px; }

.view-mess-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.mess-card, .view-mess-card {
  background: var(--bg-card); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card); overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
  display: flex; flex-direction: column;
}
.mess-card:hover, .view-mess-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }

.mess-card-header, .view-mess-card-header {
  padding: 18px 22px; background: var(--brand-gradient);
  color: #fff; display: flex;
  justify-content: space-between; align-items: flex-start;
}
.mess-card-header h3, .view-mess-card-header h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; flex: 1; color: #fff; }

.mess-card-header.header-danger, .view-mess-card-header.header-danger {
  background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%) !important;
}

.status-badge, .view-mess-status {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25); white-space: nowrap;
}

.mess-card-body, .view-mess-card-body { padding: 18px 22px 20px; flex: 1; }
.mess-card-body p, .view-mess-address { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }

.mess-card-footer, .view-mess-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; border-top: 1px solid var(--border-light);
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  gap: 16px; flex-wrap: wrap;
}
.mess-card-footer p { margin: 0; font-size: 13px; }

.mess-card-actions, .view-mess-card-actions {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 22px 18px; border-top: 1px solid var(--border-light);
}

.action-btn, .btn-edit {
  flex: 1; background: var(--brand-primary-light);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-sm); padding: 10px 0;
  font-weight: 600; cursor: pointer; font-size: 14px;
  transition: all var(--transition-fast);
}
.action-btn:hover, .btn-edit:hover { background: var(--brand-primary); color: #fff; }

.action-btn.delete-btn, .btn-delete {
  background: var(--color-danger-bg); color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}
.action-btn.delete-btn:hover, .btn-delete:hover { background: var(--color-danger); color: #fff; }

.search-button { height: 44px !important; padding: 0px 32px !important; }

/* ============================================================
   USER INFO CARD
   ============================================================ */
#user-details {
  margin-top: 28px; padding: 22px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}
#user-details h3 { color: var(--brand-primary); font-size: 16px; }
#user-details code {
  background: var(--bg-code); color: var(--text-secondary);
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 12px; display: block; margin-top: 5px;
  word-break: break-all; border: 1px solid var(--border-light);
}

/* ============================================================
   INLINE STYLE OVERRIDES FOR DARK MODE
   ============================================================ */
[data-theme="dark"] .mess-card-body p,
[data-theme="dark"] .mess-card-body strong { color: var(--text-secondary); }

[data-theme="dark"] .mess-card-footer { color: var(--text-primary); }

/* Fix inline-styled elements in dark mode */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"] {
  background: var(--bg-card) !important;
}

[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color:#333"],
[data-theme="dark"] [style*="color: #374151"],
[data-theme="dark"] [style*="color:#374151"],
[data-theme="dark"] [style*="color: #1f2937"],
[data-theme="dark"] [style*="color:#1f2937"],
[data-theme="dark"] [style*="color: #111"] {
  color: var(--text-primary) !important;
}

[data-theme="dark"] [style*="color: #666"],
[data-theme="dark"] [style*="color:#666"],
[data-theme="dark"] [style*="color: #555"],
[data-theme="dark"] [style*="color: #6b7280"],
[data-theme="dark"] [style*="color:#6b7280"],
[data-theme="dark"] [style*="color: #9ca3af"],
[data-theme="dark"] [style*="color:#9ca3af"] {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background:#f3f4f6"],
[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background: #fff3eb"] {
  background: var(--bg-hover) !important;
}

[data-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border: 1px solid #ddd"],
[data-theme="dark"] [style*="border: 1px solid #f0f0f0"],
[data-theme="dark"] [style*="border-bottom: 1px solid #f0f0f0"],
[data-theme="dark"] [style*="border-bottom: 2px solid #e5e7eb"] {
  border-color: var(--border-light) !important;
}

[data-theme="dark"] [style*="border: 1.5px solid #e5e7eb"] {
  border-color: var(--border-input) !important;
}

[data-theme="dark"] [style*="box-shadow: 0 1px 3px rgba(0,0,0,0.1)"],
[data-theme="dark"] [style*="box-shadow: 0 2px 8px rgba(0,0,0,0.06)"] {
  box-shadow: var(--shadow-card) !important;
}

/* Dark mode for dynamically generated cards with inline styles */
[data-theme="dark"] [style*="background: white; border-radius: 14px"],
[data-theme="dark"] [style*="background: white; border-radius: 16px"] {
  background: var(--bg-card) !important;
  border-color: var(--border-light) !important;
}

/* Dark mode for select/input inline styles */
[data-theme="dark"] select[style*="background: white"] {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-input) !important;
}

[data-theme="dark"] input[style*="background: white"],
[data-theme="dark"] input[style*="background:#fff"] {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
}

/* Dark mode autocomplete dropdowns */
[data-theme="dark"] [style*="background: white; border: 1px solid #ddd"] {
  background: var(--bg-dropdown) !important;
  border-color: var(--border-medium) !important;
}

/* Dark mode tables */
[data-theme="dark"] table[style*="background: white"] {
  background: var(--bg-card) !important;
}

[data-theme="dark"] th[style*="color: #374151"] {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] td[style*="color: #374151"],
[data-theme="dark"] td[style*="color: #6b7280"] {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] tr[style*="background: #f9fafb"] {
  background: var(--bg-table-header) !important;
}

/* ============================================================
   DARK MODE — Dynamically Generated Coupon Cards
   These cards are built in JS with hardcoded inline styles.
   We use container-targeted selectors for reliability,
   plus general attribute selectors as fallback.
   ============================================================ */

/* === Container-targeted card overrides (most reliable) === */
[data-theme="dark"] #cpn-view-cards > div,
[data-theme="dark"] #cpn-mc-cards > div,
[data-theme="dark"] #cpn-exp-cards > div {
  background: var(--bg-card) !important;
  border-color: var(--border-medium) !important;
}
[data-theme="dark"] #cpn-view-cards > div:hover,
[data-theme="dark"] #cpn-mc-cards > div:hover,
[data-theme="dark"] #cpn-exp-cards > div:hover {
  background: var(--bg-card-hover) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Text inside coupon cards */
[data-theme="dark"] #cpn-view-cards div[style*="color: #1f2937"],
[data-theme="dark"] #cpn-mc-cards div[style*="color: #1f2937"],
[data-theme="dark"] #cpn-exp-cards div[style*="color: #1f2937"] {
  color: var(--text-primary) !important;
}
[data-theme="dark"] #cpn-view-cards div[style*="color: #6b7280"],
[data-theme="dark"] #cpn-mc-cards div[style*="color: #6b7280"],
[data-theme="dark"] #cpn-exp-cards div[style*="color: #6b7280"] {
  color: var(--text-secondary) !important;
}
[data-theme="dark"] #cpn-view-cards div[style*="color: #9ca3af"],
[data-theme="dark"] #cpn-mc-cards div[style*="color: #9ca3af"],
[data-theme="dark"] #cpn-exp-cards div[style*="color: #9ca3af"],
[data-theme="dark"] #cpn-view-cards span[style*="color: #9ca3af"],
[data-theme="dark"] #cpn-mc-cards span[style*="color: #9ca3af"],
[data-theme="dark"] #cpn-exp-cards span[style*="color: #9ca3af"] {
  color: var(--text-tertiary) !important;
}
[data-theme="dark"] #cpn-view-cards span[style*="color: #6b7280"],
[data-theme="dark"] #cpn-mc-cards span[style*="color: #6b7280"],
[data-theme="dark"] #cpn-exp-cards span[style*="color: #6b7280"] {
  color: var(--text-secondary) !important;
}
[data-theme="dark"] #cpn-mc-cards strong[style*="color: #1f2937"],
[data-theme="dark"] #cpn-exp-cards strong[style*="color: #1f2937"] {
  color: var(--text-primary) !important;
}

/* Progress bar tracks */
[data-theme="dark"] #cpn-mc-cards div[style*="background: #f3f4f6"],
[data-theme="dark"] #cpn-exp-cards div[style*="background: #f3f4f6"] {
  background: rgba(255,255,255,0.08) !important;
}

/* Status/badge pill overrides */
[data-theme="dark"] span[style*="background: #f0fdf4"] {
  background: rgba(22, 163, 74, 0.15) !important;
}
[data-theme="dark"] span[style*="background: #fef2f2"] {
  background: rgba(220, 38, 38, 0.15) !important;
}

/* Action button overrides — edit (amber)
   Using onclick selectors: immune to JS inline style normalization */
[data-theme="dark"] button[onclick*="loadEditCouponPack"] {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #fbbf24 !important;
}
[data-theme="dark"] button[onclick*="loadEditCouponPack"]:hover {
  background: rgba(245, 158, 11, 0.25) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
}

/* Action button overrides — delete (red) */
[data-theme="dark"] button[onclick*="deleteCouponPack"] {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}
[data-theme="dark"] button[onclick*="deleteCouponPack"]:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

/* Action button overrides — revoke (red) */
[data-theme="dark"] button[onclick*="revokeCoupon"] {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}
[data-theme="dark"] button[onclick*="revokeCoupon"]:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

/* Action button overrides — restore (green) */
[data-theme="dark"] button[onclick*="cancelRevokeCoupon"] {
  background: rgba(34, 197, 94, 0.12) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
  color: #4ade80 !important;
}
[data-theme="dark"] button[onclick*="cancelRevokeCoupon"]:hover {
  background: rgba(34, 197, 94, 0.25) !important;
  border-color: rgba(34, 197, 94, 0.6) !important;
}

/* Action button overrides — extend (blue) */
[data-theme="dark"] button[onclick*="openExtendExpiry"] {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  color: #60a5fa !important;
}
[data-theme="dark"] button[onclick*="openExtendExpiry"]:hover {
  background: rgba(59, 130, 246, 0.3) !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
  color: #ffffff !important;
}

/* Urgency badge backgrounds */
[data-theme="dark"] #cpn-exp-cards div[style*="background:"][style*="border-radius: 10px"] {
  background: rgba(59, 130, 246, 0.15) !important;
}
[data-theme="dark"] #cpn-exp-cards div[style*="background: #fef2f2"] {
  background: rgba(220, 38, 38, 0.15) !important;
}
[data-theme="dark"] #cpn-exp-cards div[style*="background: #fffbeb"] {
  background: rgba(245, 158, 11, 0.15) !important;
}
[data-theme="dark"] #cpn-exp-cards div[style*="background: #eff6ff"] {
  background: rgba(59, 130, 246, 0.15) !important;
}

/* Autocomplete dropdown items (Assign Coupons & Member History) */
[data-theme="dark"] #cpn-assign-member-list > div,
[data-theme="dark"] #cpn-hist-member-list > div {
  background: var(--bg-dropdown) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
}
[data-theme="dark"] #cpn-assign-member-list > div:hover,
[data-theme="dark"] #cpn-hist-member-list > div:hover {
  background: var(--bg-hover) !important;
}
[data-theme="dark"] #cpn-assign-member-list small,
[data-theme="dark"] #cpn-hist-member-list small {
  color: var(--text-tertiary) !important;
}

/* Member History table rows */
[data-theme="dark"] #cpn-hist-tbody tr {
  border-color: var(--border-light) !important;
}
[data-theme="dark"] #cpn-hist-tbody td {
  color: var(--text-primary) !important;
}
[data-theme="dark"] #cpn-hist-tbody td[style*="color: #6b7280"] {
  color: var(--text-secondary) !important;
}

/* General fallback overrides for any div[style*="background: #fff"] or white */
[data-theme="dark"] div[style*="background: #fff"][style*="border-radius: 14px"] {
  background: var(--bg-card) !important;
  border-color: var(--border-medium) !important;
}
[data-theme="dark"] div[style*="background: white"][style*="border-radius: 14px"] {
  background: var(--bg-card) !important;
  border-color: var(--border-medium) !important;
}
[data-theme="dark"] div[style*="background: rgba(254,226,226,0.15)"] {
  background: rgba(127, 29, 29, 0.2) !important;
  border-color: var(--border-medium) !important;
}

/* Autocomplete dropdown containers (have inline background: white; border: 1px solid #ddd) */
[data-theme="dark"] #cpn-assign-member-list,
[data-theme="dark"] #cpn-hist-member-list {
  background: var(--bg-dropdown) !important;
  border-color: var(--border-medium) !important;
}

/* Select dropdowns inside coupon sections (have inline background: white) */
[data-theme="dark"] [id^="cpn-"] select[style*="background: white"],
[data-theme="dark"] [id^="cpn-"] select[style*="background:white"],
[data-theme="dark"] select[id^="cpn-"][style*="background: white"] {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-input) !important;
}

/* All selects within coupon section containers (broader catch) */
[data-theme="dark"] #cpn-add-coupon select,
[data-theme="dark"] #cpn-view-coupons select,
[data-theme="dark"] #cpn-assign-coupons select,
[data-theme="dark"] #cpn-member-coupons select,
[data-theme="dark"] #cpn-expiring-coupons select,
[data-theme="dark"] #cpn-member-history select {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-input) !important;
}

/* Inputs within coupon sections */
[data-theme="dark"] #cpn-add-coupon input,
[data-theme="dark"] #cpn-edit-coupon input,
[data-theme="dark"] #cpn-assign-coupons input,
[data-theme="dark"] #cpn-extend-expiry input,
[data-theme="dark"] #cpn-extend-expiry textarea,
[data-theme="dark"] #cpn-member-history input {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-input) !important;
}

/* Empty state messages */
[data-theme="dark"] #cpn-view-empty,
[data-theme="dark"] #cpn-mc-empty,
[data-theme="dark"] #cpn-exp-empty,
[data-theme="dark"] #cpn-hist-empty {
  color: var(--text-tertiary) !important;
}

/* History table header row */
[data-theme="dark"] #cpn-hist-table-wrapper tr[style*="background: #f8f9fa"] {
  background: var(--bg-table-header) !important;
}
[data-theme="dark"] #cpn-hist-table-wrapper th {
  color: var(--text-primary) !important;
  border-color: var(--border-medium) !important;
}

/* History table (the table element itself) */
[data-theme="dark"] #cpn-hist-table-wrapper table {
  color: var(--text-primary) !important;
}

/* Form labels with inline color: #374151 in coupon sections */
[data-theme="dark"] #cpn-view-coupons label[style*="color: #374151"],
[data-theme="dark"] #cpn-member-coupons label[style*="color: #374151"],
[data-theme="dark"] #cpn-expiring-coupons label[style*="color: #374151"],
[data-theme="dark"] #cpn-assign-coupons label[style*="color: #374151"],
[data-theme="dark"] #cpn-add-coupon label[style*="color: #374151"],
[data-theme="dark"] #cpn-member-history label[style*="color: #374151"] {
  color: var(--text-primary) !important;
}

/* Empty state SVG icon strokes (make visible on dark bg) */
[data-theme="dark"] #cpn-view-empty svg,
[data-theme="dark"] #cpn-mc-empty svg,
[data-theme="dark"] #cpn-exp-empty svg {
  stroke: var(--text-tertiary) !important;
}

/* Empty state paragraph text */
[data-theme="dark"] #cpn-view-empty p,
[data-theme="dark"] #cpn-mc-empty p,
[data-theme="dark"] #cpn-exp-empty p,
[data-theme="dark"] #cpn-hist-empty p {
  color: var(--text-tertiary) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  main { margin-left: 220px; }
  .content { padding: 20px; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -280px; width: 260px;
    top: 0; height: 100vh;
    transition: left var(--transition-normal);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.show { left: 0; }
  main { margin-left: 0; width: 100%; }
  .topbar { justify-content: space-between; }
  .menu-toggle { display: flex; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .view-mess-grid { grid-template-columns: 1fr; }
  .container .card { max-width: 90%; padding: 24px; }
  .tabs { flex-direction: column; gap: 2px; }
  .tab { width: 100%; }
  .otp { gap: 8px; }
  .otp input { width: 40px; height: 46px; font-size: 16px; }
  .form-container { padding: 20px; }

  .theme-toggle { margin-right: 0; }

  /* ── Past Menu / Menu History responsive table ── */
  #past-menu-table-wrapper table th,
  #past-menu-table-wrapper table td,
  #member-hist-table-wrapper table th,
  #member-hist-table-wrapper table td,
  #member-att-hist-table-wrapper table th,
  #member-att-hist-table-wrapper table td {
    padding: 8px 6px !important;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .container { padding: 12px; }
  .container .card { padding: 20px; max-width: 100%; border-radius: var(--radius-lg); }
  .content { padding: 16px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .btn-back { width: 100%; text-align: center; }
  h1 { font-size: 22px; }
  h2 { font-size: 16px; }
  .logo { width: 48px; height: 48px; font-size: 22px; }
  .tabs { margin: 16px 0; }
  .tab { padding: 10px; font-size: 13px; }
  .icon { width: 56px; height: 56px; font-size: 24px; margin: 14px auto; }
  input, select { padding: 12px; font-size: 14px; }
  .btn { padding: 12px; font-size: 14px; }
  .footer-text { font-size: 12px; }
  .info-box { padding: 10px 12px; font-size: 12px; }
  .otp { gap: 6px; margin: 20px 0; }
  .otp input { width: 38px; height: 42px; font-size: 14px; }
  .subtitle { font-size: 13px; }
  .hint { font-size: 11px; }
  .gender { gap: 8px; }
  .gender button { padding: 10px; font-size: 13px; }
  .form-container { padding: 16px; margin: 16px 0; border-radius: var(--radius-md); }
  .number { font-size: 24px; }
  .card { padding: 16px; }

  /* ── Past Menu / Menu History compact at small screens ── */
  #past-menu-table-wrapper table th,
  #past-menu-table-wrapper table td,
  #member-hist-table-wrapper table th,
  #member-hist-table-wrapper table td {
    padding: 6px 4px !important;
    font-size: 12px;
  }
  #past-menu-table-wrapper table button,
  #member-hist-table-wrapper table button {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 360px) {
  .cards { grid-template-columns: 1fr; }
  .otp input { width: 34px; height: 38px; font-size: 14px; }
}

/* ============================================================
   THEME TRANSITION HELPER
   ============================================================ */
body.theme-transitioning *,
body.theme-transitioning *::before,
body.theme-transitioning *::after,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ============================================================
   MEMBER DASHBOARD OVERRIDES
   ============================================================ */
.member-info-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-md);
  max-width: 600px; border: 1px solid var(--border-light);
}
.member-info-card h2 { margin-bottom: 20px; color: var(--text-primary); }
.info-row {
  display: flex; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
  font-size: 15px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); font-weight: 500; }
.info-value { color: var(--text-primary); font-weight: 600; word-break: break-all; }

.member-avatar-large {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; margin: 0 auto 20px;
}
.member-avatar-large img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.welcome-text { text-align: center; color: var(--text-secondary); margin-bottom: 30px; }
.member-status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.member-status-active { background: var(--color-success-bg); color: var(--color-success); }

.loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-body); display: flex;
  align-items: center; justify-content: center;
  z-index: 9999; font-size: 18px; color: var(--text-secondary);
}

.browse-controls { display: flex; gap: 12px; }

/* ── Button loading spinner ── */
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}
button:disabled { opacity: 0.75; cursor: not-allowed !important; }

/* ── User dashboard stat popup ── */
.udash-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.udash-popup-overlay.open { display: flex; }
.udash-popup {
  background: var(--bg-card, #fff);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.25);
  width: 100%; max-width: 640px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: udashPopIn .2s ease;
}
@keyframes udashPopIn {
  from { transform: scale(.93); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.udash-popup-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.udash-popup-header h3 {
  margin: 0; font-size: 17px;
  color: #ff7a18; font-weight: 700;
}
.udash-popup-close {
  background: none; border: none;
  font-size: 22px; cursor: pointer; line-height: 1;
  color: var(--text-secondary, #6b7280);
  padding: 2px 7px; border-radius: 6px;
  transition: color .18s, background .18s;
}
.udash-popup-close:hover { color: #ef4444; background: rgba(239,68,68,0.08); }
.udash-popup-body { overflow-y: auto; flex: 1; padding: 6px 22px 18px; }
.udash-popup-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.udash-popup-table thead tr { background: rgba(255,122,24,0.07); }
.udash-popup-table th {
  padding: 10px 12px; text-align: left;
  color: #ff7a18; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid rgba(255,122,24,0.2);
}
.udash-popup-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border, #f0f0f0);
  color: var(--text-primary, #1f2937);
}
.udash-popup-table tbody tr:hover { background: rgba(255,122,24,0.04); }
.udash-popup-footer {
  padding: 10px 22px;
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: 12px; color: var(--text-secondary, #6b7280);
  flex-shrink: 0;
}
