/* MedSkin Portal — Design tokens + base styles */
:root {
  /* Brand */
  --primary: #27AAE1;
  --primary-hover: #1A8FBF;
  --primary-pressed: #0D7AA8;
  --primary-soft: #E8F5FB;
  --primary-text: #FFFFFF;

  /* Text */
  --text-heading: #1A1A1A;
  --text-body: #4A4A4A;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-disabled: #D1D5DB;

  /* Borders */
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --border-subtle: #F3F4F6;

  /* Backgrounds */
  --bg-page: #FFFFFF;
  --bg-app: #F9FAFB;
  --bg-section: #F3F4F6;
  --bg-hover: #F9FAFB;
  --bg-pro: #FEF3C7;
  --bg-pro-text: #92400E;

  /* Semantic */
  --success: #10B981;
  --success-soft: #D1FAE5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --error: #EF4444;
  --error-soft: #FEE2E2;
  --info: #3B82F6;
  --info-soft: #DBEAFE;
  --purple: #8B5CF6;
  --purple-soft: #EDE9FE;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.10);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Type */
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: all 0.15s ease;

  /* Layout */
  --topbar-h: 56px;
  --sidebar-w: 240px;
  --row-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-body);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* Typography */
h1 { font-size: 24px; line-height: 32px; font-weight: 600; color: var(--text-heading); margin: 0; }
h2 { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--text-heading); margin: 0; }
h3 { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text-heading); margin: 0; }
h4 { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-heading); margin: 0; }
.caption { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.micro { font-size: 11px; line-height: 14px; color: var(--text-muted); }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.upper { text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; font-weight: 500; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500; line-height: 1;
  border: 1px solid transparent; background: transparent; color: var(--text-body);
  transition: var(--transition); white-space: nowrap; text-decoration: none;
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.btn-primary:active { background: var(--primary-pressed); }
.btn-primary:disabled { background: var(--bg-section); color: var(--text-disabled); cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--text-heading); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-heading); text-decoration: none; }
.btn-ghost { color: var(--text-body); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-heading); text-decoration: none; }
.btn-link { color: var(--primary); padding: 0; height: auto; }
.btn-link:hover { color: var(--primary-hover); text-decoration: underline; background: none; }
.btn-danger { background: #fff; border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; }
.btn-icon:hover { background: var(--bg-hover); }
.btn-block { width: 100%; }

/* Form fields */
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: #fff; color: var(--text-heading);
  transition: var(--transition); outline: none;
}
.textarea { padding: 10px 12px; min-height: 80px; height: auto; resize: vertical; line-height: 20px; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); border-width: 1.5px;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input.error { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-soft); }
.input-sm { height: 32px; padding: 0 10px; font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-heading); margin-bottom: 6px; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.qty button { width: 28px; height: 28px; border: none; background: #fff; color: var(--text-body); font-size: 16px; }
.qty button:hover { background: var(--bg-hover); }
.qty input { width: 36px; height: 28px; border: none; text-align: center; font-size: 13px; color: var(--text-heading); padding: 0; outline: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 16px; }
.badge-primary { background: var(--primary-soft); color: var(--primary-pressed); }
.badge-success { background: var(--success-soft); color: #047857; }
.badge-warning { background: var(--warning-soft); color: #92400E; }
.badge-error { background: var(--error-soft); color: #B91C1C; }
.badge-info { background: var(--info-soft); color: #1D4ED8; }
.badge-purple { background: var(--purple-soft); color: #6D28D9; }
.badge-muted { background: var(--bg-section); color: var(--text-secondary); }
.badge-pro { background: var(--bg-pro); color: var(--bg-pro-text); font-weight: 600; letter-spacing: 0.04em; }

/* Stock indicator */
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.stock-dot { width: 8px; height: 8px; border-radius: 50%; }
.stock-in .stock-dot { background: var(--success); }
.stock-low .stock-dot { background: var(--warning); }
.stock-out .stock-dot { background: var(--text-muted); }
.stock-out { color: var(--text-muted); }

/* Cards */
.card { background: var(--bg-page); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.card-pad-sm { padding: 16px; }
.card-pad-lg { padding: 24px; }
.card-flat { background: var(--bg-page); border: 1px solid var(--border); border-radius: 8px; }
.card-section-title { font-size: 16px; font-weight: 600; color: var(--text-heading); margin: 0; }

/* Tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.table th {
  background: var(--bg-section); border-bottom: 1px solid var(--border);
  padding: 12px 16px; text-align: left; font-weight: 500; font-size: 13px;
  color: var(--text-heading); position: sticky; top: 0; z-index: 1;
}
.table th .sort { color: var(--text-muted); margin-left: 4px; font-size: 11px; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--primary); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; font-size: 14px; color: var(--text-body); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr.selected { background: var(--primary-soft); }
.table.compact td, .table.compact th { padding: 8px 12px; }
.table.compact td { font-size: 13px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border-strong); background: #fff; font-size: 12px; color: var(--text-body); cursor: pointer; transition: var(--transition); }
.chip:hover { background: var(--bg-section); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-pressed); }
.chip .x { color: var(--text-muted); margin-left: 2px; cursor: pointer; }
.chip .x:hover { color: var(--error); }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.tabs .tab { padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.tabs .tab:hover { color: var(--text-heading); }
.tabs .tab.active { color: var(--text-heading); font-weight: 600; border-bottom-color: var(--primary); }
.tabs .tab .count { background: var(--bg-section); color: var(--text-secondary); padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }

/* Pill tabs (rectangular) */
.pill-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-section); border-radius: 8px; }
.pill-tabs .pill { padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--text-body); cursor: pointer; transition: var(--transition); border: none; background: none; }
.pill-tabs .pill:hover { color: var(--text-heading); }
.pill-tabs .pill.active { background: #fff; color: var(--text-heading); font-weight: 500; box-shadow: var(--shadow-xs); }

/* Empty states */
.empty { text-align: center; padding: 48px 24px; }
.empty .empty-icon { width: 80px; height: 80px; background: var(--bg-section); border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--text-muted); }
.empty h3 { margin-bottom: 8px; }
.empty p { color: var(--text-secondary); margin: 0 0 16px; }

/* Toasts */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast { min-width: 280px; max-width: 360px; padding: 12px 16px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 8px; box-shadow: var(--shadow-md); font-size: 13px; color: var(--text-heading); pointer-events: auto; animation: toastIn 0.2s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn 0.15s ease; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 48px); max-height: 90vh; display: flex; flex-direction: column; animation: scaleIn 0.15s ease; overflow: hidden; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-shrink: 0; }
.modal-header h2 { font-size: 18px; font-weight: 600; color: var(--text-heading); margin: 0; line-height: 1.3; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; background: var(--bg-section); }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg-hover); color: var(--text-heading); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 100; height: var(--topbar-h); background: var(--bg-page); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; }
.topbar .logo { font-weight: 700; font-size: 16px; color: var(--text-heading); letter-spacing: 0.02em; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.topbar .logo-mark { width: 28px; height: 28px; background: var(--primary); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; }
.topbar .search { flex: 1; max-width: 480px; position: relative; }
.topbar .search input { width: 100%; height: 36px; padding: 0 12px 0 36px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-app); font-size: 13px; outline: none; transition: var(--transition); }
.topbar .search input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.topbar .search .icon { position: absolute; left: 12px; top: 10px; color: var(--text-muted); }
.topbar .actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar .icon-btn { position: relative; width: 36px; height: 36px; border-radius: 6px; border: none; background: none; color: var(--text-body); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.topbar .icon-btn:hover { background: var(--bg-hover); color: var(--text-heading); }
.topbar .icon-btn .badge-count { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.topbar .user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.topbar .user-btn:hover { background: var(--bg-hover); }
.topbar .avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #FCA5A5, #F472B6); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; position: relative; }
.topbar .pro-dot { position: absolute; bottom: -2px; right: -2px; background: var(--primary); color: #fff; font-size: 8px; font-weight: 700; padding: 1px 4px; border-radius: 3px; border: 2px solid #fff; }

/* Account dropdown */
.dropdown { position: absolute; top: calc(100% + 4px); right: 0; min-width: 260px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 200; }
.dropdown-section { padding: 8px 0; }
.dropdown-section + .dropdown-section { border-top: 1px solid var(--border); }
.dropdown-item { display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-size: 13px; color: var(--text-body); cursor: pointer; transition: var(--transition); }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-heading); text-decoration: none; }
.dropdown-item .ico { width: 18px; color: var(--text-secondary); display: inline-flex; }
.dropdown-item .count { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.dropdown-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.dropdown-header .avatar-lg { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #FCA5A5, #F472B6); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--bg-page); border-right: 1px solid var(--border); position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 16px 12px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.sidebar .profile-card { padding: 12px; border-radius: 8px; background: var(--bg-section); display: flex; align-items: center; gap: 12px; }
.sidebar .profile-card .avatar-lg { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #FCA5A5, #F472B6); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex-shrink: 0; }
.sidebar .profile-card .name { font-size: 13px; font-weight: 600; color: var(--text-heading); line-height: 1.2; }
.sidebar .profile-card .role { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; margin-top: 2px; display: inline-block; padding: 1px 6px; border-radius: 3px; }
.sidebar .profile-card .role.pro { background: var(--bg-pro); color: var(--bg-pro-text); }
.sidebar .profile-card .role.member { background: var(--primary-soft); color: var(--primary-pressed); }
.sidebar .nav-group { display: flex; flex-direction: column; gap: 2px; }
.sidebar .nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; padding: 8px 12px 4px; }
.sidebar .nav-item { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; font-size: 13px; color: var(--text-body); border-radius: 6px; cursor: pointer; transition: var(--transition); position: relative; border: none; background: none; text-align: left; width: 100%; }
.sidebar .nav-item:hover { background: var(--bg-hover); color: var(--text-heading); text-decoration: none; }
.sidebar .nav-item.active { background: var(--primary-soft); color: var(--primary-pressed); font-weight: 500; }
.sidebar .nav-item.active::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--primary); border-radius: 0 2px 2px 0; }
.sidebar .nav-item .ico { width: 18px; color: var(--text-secondary); flex-shrink: 0; }
.sidebar .nav-item.active .ico { color: var(--primary); }
.sidebar .nav-item .count { margin-left: auto; background: var(--bg-section); color: var(--text-secondary); padding: 0 8px; height: 18px; border-radius: 9px; font-size: 11px; display: flex; align-items: center; }
.sidebar .nav-item.active .count { background: #fff; color: var(--primary); }
.sidebar .manager-card { margin-top: auto; padding: 12px; border-radius: 8px; background: var(--bg-section); }
.sidebar .manager-card .label { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.sidebar .manager-card .row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sidebar .manager-card .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #93C5FD, #6366F1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.sidebar .manager-card .name { font-size: 13px; font-weight: 600; color: var(--text-heading); }
.sidebar .manager-card .meta { font-size: 11px; color: var(--text-secondary); }

/* Layout */
.app { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.main { flex: 1; min-width: 0; padding: 32px; max-width: 1280px; }
.page-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--text-secondary); margin-top: 4px; font-size: 14px; }

/* Breadcrumbs */
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--text-heading); }
.breadcrumbs .sep { color: var(--text-muted); }

/* Mini-cart slide-out */
.slideout-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 900; animation: fadeIn 0.2s ease; }
.slideout { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; background: #fff; box-shadow: var(--shadow-lg); z-index: 901; display: flex; flex-direction: column; animation: slideInRight 0.2s ease; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.slideout-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.slideout-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.slideout-footer { padding: 16px 20px; border-top: 1px solid var(--border); }

/* AI Floating Widget — see styles-app.css for the actual rules */

/* Demo switcher */
.demo-switcher { position: fixed; bottom: 24px; left: 24px; width: 280px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 850; overflow: hidden; }
.demo-switcher-collapsed { width: auto; }
.demo-switcher-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-section); cursor: pointer; }
.demo-switcher-header h4 { font-size: 13px; }
.demo-switcher-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; }
.demo-switcher-section .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.demo-switcher-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.demo-switcher-option:hover { background: var(--bg-hover); }
.demo-switcher-option input { margin: 0; }

/* Image placeholder */
.img-ph { background: linear-gradient(135deg, #F3F4F6, #E5E7EB); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-family: "SF Mono", Menlo, monospace; font-size: 9px; text-align: center; flex-shrink: 0; overflow: hidden; position: relative; }
.img-ph.product { background: radial-gradient(circle at 30% 30%, #fff, #E5E7EB 70%, #D1D5DB); }
.img-ph.product::before { content: ''; position: absolute; inset: 25%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), transparent 60%); }
.img-ph-initials { font-weight: 600; color: rgba(0,0,0,0.45); position: relative; z-index: 1; font-family: var(--font, 'Inter', sans-serif); font-size: 11px; letter-spacing: 0.04em; }
.img-ph-lg {
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  position: relative;
}
.img-ph-lg .prod-silhouette {
  position: absolute; inset: 8%;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.12));
}
.img-ph-lg .img-ph-brand {
  position: absolute; top: 10px; left: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: rgba(0,0,0,0.55); text-transform: uppercase;
  font-family: var(--font, 'Inter', sans-serif);
  background: rgba(255,255,255,0.7); padding: 3px 7px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.img-ph-lg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.4), transparent 50%);
  pointer-events: none;
}
.img-ph.brand-prx { background: radial-gradient(circle at 30% 30%, #fff, #DBEAFE 70%, #93C5FD); }
.img-ph.brand-derm { background: radial-gradient(circle at 30% 30%, #fff, #FCE7F3 70%, #F9A8D4); }
.img-ph.brand-cell { background: radial-gradient(circle at 30% 30%, #fff, #DCFCE7 70%, #86EFAC); }
.img-ph.brand-dsd { background: radial-gradient(circle at 30% 30%, #fff, #FEF3C7 70%, #FCD34D); }
.img-ph.brand-hl { background: radial-gradient(circle at 30% 30%, #fff, #EDE9FE 70%, #C4B5FD); }
.img-ph.brand-pen { background: radial-gradient(circle at 30% 30%, #fff, #E0E7FF 70%, #A5B4FC); }
.img-ph.brand-rrs { background: radial-gradient(circle at 30% 30%, #fff, #FFE4E6 70%, #FDA4AF); }
.img-ph.brand-skin { background: radial-gradient(circle at 30% 30%, #fff, #CFFAFE 70%, #67E8F9); }

/* Banner */
.banner { padding: 16px 20px; border-radius: 8px; border: 1px solid; border-left-width: 4px; display: flex; gap: 12px; align-items: flex-start; }
.banner-warning { background: var(--warning-soft); border-color: #FCD34D; border-left-color: var(--warning); }
.banner-info { background: var(--info-soft); border-color: #93C5FD; border-left-color: var(--info); }
.banner-error { background: var(--error-soft); border-color: #FCA5A5; border-left-color: var(--error); }
.banner h4 { color: var(--text-heading); margin-bottom: 4px; }
.banner p { margin: 0 0 12px; color: var(--text-body); font-size: 13px; }
.banner .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Stat card */
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat-card .number { font-size: 28px; font-weight: 600; color: var(--text-heading); line-height: 1; margin-bottom: 8px; }
.stat-card .link { font-size: 13px; color: var(--primary); }

/* Grids */
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 16px; }
  .topbar { padding: 0 12px; }
  .topbar .search { display: none; }
  .ai-window { width: 100vw; height: 100vh; bottom: 0; right: 0; border-radius: 0; }
  .demo-switcher { left: 8px; right: 8px; width: auto; bottom: 70px; }
  .slideout { width: 100vw; }
}

/* Bottom mobile nav */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: #fff; border-top: 1px solid var(--border); z-index: 100; }
  .bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: var(--text-secondary); border: none; background: none; }
  .bottom-nav-item.active { color: var(--primary); }
  body.has-bottom-nav .main { padding-bottom: 80px; }
}

/* Helpers */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-heading { color: var(--text-heading); }
.text-primary { color: var(--primary); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-strike { text-decoration: line-through; color: var(--text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.cursor-pointer { cursor: pointer; }
.w-full { width: 100%; }

/* Timeline */
.timeline { display: flex; align-items: flex-start; gap: 0; padding: 16px 0; overflow-x: auto; }
.timeline-step { flex: 1; min-width: 100px; text-align: center; position: relative; }
.timeline-dot { width: 24px; height: 24px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: #fff; border: 2px solid var(--border-strong); color: var(--text-muted); }
.timeline-step.done .timeline-dot { background: var(--success); border-color: var(--success); color: #fff; }
.timeline-step.current .timeline-dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-step .label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.timeline-step.done .label, .timeline-step.current .label { color: var(--text-heading); }
.timeline-step .date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.timeline-step::after { content: ''; position: absolute; top: 11px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--border-strong); }
.timeline-step.done::after, .timeline-step.current::after { background: var(--success); }
.timeline-step:last-child::after { display: none; }

/* Shipment block */
.shipment { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.shipment-header { padding: 12px 16px; background: var(--bg-section); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.shipment-header .left { display: flex; align-items: center; gap: 10px; }
.shipment-body { padding: 4px 0; }
.shipment-item { padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--border-subtle); }
.shipment-item:last-child { border-bottom: none; }
.shipment-item .info { flex: 1; }
.shipment-item .actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Suggestion cards (AI) */
.suggest-card { padding: 16px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: var(--transition); background: #fff; text-align: left; }
.suggest-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.suggest-card .ico { font-size: 18px; margin-bottom: 8px; }
.suggest-card .title { font-weight: 600; font-size: 13px; color: var(--text-heading); margin-bottom: 4px; }
.suggest-card .desc { font-size: 12px; color: var(--text-secondary); }

/* Chat messages */
.msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.msg.user { background: var(--primary-soft); align-self: flex-end; color: var(--text-heading); border-bottom-right-radius: 4px; }
.msg.ai { background: var(--bg-section); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 6px 0; padding-left: 20px; }
.inline-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 8px 0; display: flex; align-items: center; gap: 10px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-strong); border-radius: 10px; transition: var(--transition); }
.switch-slider::before { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: var(--transition); box-shadow: var(--shadow-sm); }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }

/* Login pages */
.auth-page { min-height: 100vh; background: var(--bg-app); display: flex; flex-direction: column; }
.auth-topbar { height: var(--topbar-h); display: flex; align-items: center; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--border); }
.auth-content { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.auth-card.wide { max-width: 540px; }
@media (max-width: 600px) {
  .auth-content { padding: 16px; }
  .auth-card { padding: 24px 20px; border-radius: 10px; }
}
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
