/* LashPro POS design-token contract
   SINGLE SOURCE OF TRUTH: this file is the only POS stylesheet that may
   declare CSS custom properties. Define theme primitives and framework
   adapters here; components and feature stylesheets must only consume tokens.
   Deprecated aliases remain temporarily for legacy templates/integrations.
   Do not add new uses of deprecated names; migrate consumers to semantic roles.
*/

:root,
html[data-theme="light"] {
  color-scheme: light;

  /* Premium brand palette */
  --premium-blush: #A33B62;
  --premium-blush-hover: #84304F;
  --premium-blush-soft: #F7E8ED;
  --premium-petal: #F2B3C6;
  --premium-petal-soft: #FBEFF3;
  --premium-ivory: #F8F3EE;
  --premium-ivory-light: #FFFCF9;
  --premium-wine: #24171D;

  /* Semantic colour roles */
  --brand: var(--premium-blush);
  --brand-hover: var(--premium-blush-hover);
  --brand-soft: var(--premium-blush-soft);
  --brand-rgb: 163, 59, 98;

  --ui-canvas: var(--premium-ivory);
  --ui-surface: var(--premium-ivory-light);
  --ui-surface-muted: #F2EAE4;
  --ui-surface-raised: #FFFFFF;
  --ui-border: #E8DCE0;
  --ui-border-strong: #D7C2C8;
  --ui-text: var(--premium-wine);
  --ui-text-rgb: 36, 23, 29;
  --ui-muted: #796970;
  --ui-subtle: #A3959B;
  --ui-surface-rgb: 255, 252, 249;
  --contrast-rgb: 255, 255, 255;
  --shadow-rgb: 36, 23, 29;
  --overlay-rgb: 18, 10, 14;

  --success: #287A5B;
  --success-rgb: 40, 122, 91;
  --success-soft: #EAF4ED;
  --warning: #A96B2D;
  --warning-rgb: 169, 107, 45;
  --warning-soft: #F8F0E4;
  --danger: #B7475A;
  --danger-rgb: 183, 71, 90;
  --danger-soft: #F9EAED;
  --info: #486F9D;
  --info-rgb: 72, 111, 157;
  --info-soft: #EAF0F7;

  /* Theme-aware focus, elevation and component primitives */
  --lp-focus: rgba(var(--brand-rgb), .28);
  --shadow-sm: 0 4px 12px rgba(var(--shadow-rgb), .055);
  --shadow-md: 0 12px 28px rgba(var(--shadow-rgb), .085);
  --shadow-lg: 0 24px 56px rgba(var(--shadow-rgb), .13);
  --shadow-card: var(--shadow-sm);
  --bg-gradient: linear-gradient(180deg, var(--ui-surface), var(--ui-canvas));
  --ui-surface-gradient: linear-gradient(145deg, var(--ui-surface), var(--ui-surface-muted));
  --ui-canvas-gradient: linear-gradient(180deg, var(--ui-surface), var(--ui-canvas));
  --hero-gradient: linear-gradient(135deg, var(--premium-petal-soft), var(--ui-surface), var(--ui-surface-muted));
  --payment-mpesa-gradient: linear-gradient(135deg, #11B780, #0B8C61);

  --lp-radius-xs: 6px;
  --lp-radius-sm: 10px;
  --lp-radius-md: 14px;
  --lp-radius-lg: 18px;
  --lp-radius-xl: 24px;
  --lp-radius-receipt: 20px;
  --lp-radius-receipt-mobile: 15px;
  --lp-radius-pill: 999px;
  --lp-radius-card: 15px;
  --lp-radius-icon: 13px;
  --lp-radius-panel: 16px;
  --radius: var(--lp-radius-lg);
  --radius-sm: 13px;

  --lp-font-ui: "Inter", "Segoe UI", sans-serif;
  --lp-font-display: "Playfair Display", Georgia, serif;
  --lp-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-ui: var(--lp-font-ui);
  --font-display: var(--lp-font-display);

  /* Compatibility aliases: keep old component names mapped to semantic roles. */
  --lp-pink-50: var(--brand-soft);
  --lp-pink-100: var(--premium-petal-soft);
  --lp-pink-200: var(--premium-petal);
  --lp-pink-300: var(--premium-petal);
  --lp-pink-400: var(--premium-blush);
  --lp-pink-500: var(--brand);
  --lp-pink-600: var(--brand);
  --lp-pink-700: var(--brand-hover);
  --lp-pink-800: var(--brand-hover);
  --lp-pink-900: var(--premium-wine);

  --lp-neutral-0: var(--ui-surface);
  --lp-neutral-50: var(--ui-canvas);
  --lp-neutral-100: var(--ui-surface-muted);
  --lp-neutral-200: var(--ui-border);
  --lp-neutral-300: var(--ui-border-strong);
  --lp-neutral-400: var(--ui-subtle);
  --lp-neutral-500: var(--ui-muted);
  --lp-neutral-600: var(--ui-muted);
  --lp-neutral-700: var(--ui-text);
  --lp-neutral-800: var(--ui-text);
  --lp-neutral-900: var(--ui-text);

  --lp-success: var(--success);
  --lp-success-soft: var(--success-soft);
  --lp-warning: var(--warning);
  --lp-warning-soft: var(--warning-soft);
  --lp-danger: var(--danger);
  --lp-danger-soft: var(--danger-soft);
  --lp-info: var(--info);

  --lp-shadow-sm: var(--shadow-sm);
  --lp-shadow-md: var(--shadow-md);
  --lp-shadow-lg: var(--shadow-lg);
  --lp-surface: var(--ui-surface);
  --lp-surface-alt: var(--ui-surface-muted);
  --lp-surface-strong: var(--ui-surface-muted);
  --lp-surface-ink: var(--ui-text);
  --lp-border: var(--ui-border);
  --lp-border-strong: var(--ui-border-strong);
  --lp-text: var(--ui-text);
  --lp-text-muted: var(--ui-muted);
  --lp-btn-primary-bg: var(--brand);
  --lp-btn-primary-text: var(--on-accent);
  --lp-btn-primary-hover: var(--brand-hover);

  /* Legacy naming bridge */
  --pink-50: var(--lp-pink-50);
  --pink-100: var(--lp-pink-100);
  --pink-200: var(--lp-pink-200);
  --pink-600: var(--lp-pink-600);
  --pink-700: var(--lp-pink-700);
  --ink-500: var(--ui-muted);
  --ink-700: var(--ui-text);
  --ink-900: var(--ui-text);
  --ink: var(--ui-text);
  --surface: var(--ui-surface);
  --surface-raised: var(--ui-surface-raised);
  --surface-soft: var(--brand-soft);
  --text: var(--ui-text);
  --muted: var(--ui-muted);
  --muted-bright: var(--ui-muted);
  --subtle: var(--ui-subtle);
  --border: var(--ui-border);
  --border-strong: var(--ui-border-strong);
  --line: var(--ui-border);
  --line-strong: var(--ui-border-strong);
  --rose: var(--brand);
  --rose-light: var(--premium-petal);
  --rose-deep: var(--brand-hover);
  --rose-wash: var(--brand-soft);
  --gold: var(--warning);
  --success-bg: var(--success-soft);
  --danger-bg: var(--danger-soft);
  --warning-bg: var(--warning-soft);
  --bg: var(--ui-canvas);
  --bg-2: var(--ui-surface-muted);
  --surface-2: var(--ui-surface-muted);
  --surface-3: var(--ui-surface-raised);
  --green: var(--success);
  --green-bg: var(--success-soft);
  --green-100: var(--success-soft);
  --green-600: var(--success);
  --amber: var(--warning);
  --amber-100: var(--warning-soft);
  --amber-600: var(--warning);
  --red: var(--danger);
  --red-100: var(--danger-soft);
  --red-600: var(--danger);
  --blue: var(--info);

  /* Admin-suite compatibility names; values still originate from this file. */
  --rose-rgb: var(--brand-rgb);
  --rose-25: var(--ui-surface);
  --rose-50: var(--ui-surface-muted);
  --rose-100: var(--brand-soft);
  --rose-150: var(--ui-border);
  --rose-200: var(--ui-border-strong);
  --rose-300: var(--brand);
  --rose-400: var(--brand);
  --rose-500: var(--brand);
  --rose-600: var(--brand);
  --rose-700: var(--brand-hover);
  --rose-800: var(--brand-hover);
  --muted2: var(--ui-subtle);
  --paper: var(--ui-surface);
  --canvas: var(--ui-canvas);
  --line2: var(--ui-border-strong);
  --gold-bg: var(--warning-soft);
  --shadow: var(--shadow-md);
  --surface-1: var(--ui-surface);
  --hero-start: var(--premium-petal-soft);
  --hero-mid: var(--ui-surface);
  --hero-end: var(--ui-surface-muted);
  --field-bg: var(--ui-surface);
  --field-border: var(--ui-border-strong);
  --focus-ring: var(--lp-focus);
  --r: var(--lp-radius-lg);
  --receipt-paper: #FFFFFF;
  --receipt-ink: #24171D;
  --receipt-border: var(--ui-border);
  --receipt-muted: var(--ui-muted);
  --pink: var(--brand);
  --pink-strong: var(--brand-hover);
  --pink-deep: var(--brand-hover);
  --pink-soft: var(--brand-soft);
  --pink-wash: var(--brand-soft);
  --on-accent: #FFFFFF;

  /* Django admin framework variables are adapters, not a separate palette. */
  --primary: var(--brand);
  --secondary: var(--ui-surface-muted);
  --accent: var(--brand);
  --primary-fg: var(--on-accent);
  --header-bg: var(--ui-surface);
  --header-color: var(--ui-text);
  --body-bg: var(--ui-canvas);
  --body-fg: var(--ui-text);
  --link-fg: var(--brand);
  --link-hover-color: var(--brand-hover);
  --hairline-color: var(--ui-border);
  --darkened-bg: var(--ui-surface-muted);
  --selected-bg: var(--brand-soft);
  --selected-row: var(--brand-soft);
  --breadcrumbs-bg: var(--ui-surface-muted);
  --breadcrumbs-fg: var(--ui-muted);
  --breadcrumbs-link-fg: var(--brand);

  /* Compatibility values centralised during the stylesheet migration. */
  --lp-compat-color-c4ae0b53: var(--on-accent);
  --lp-compat-radius-9d70d420: 14px;
  --lp-compat-radius-c8900c27: 11px;
  --lp-compat-radius-61f9253f: 19px;
  --lp-compat-radius-37275922: 12px;
  --lp-compat-radius-c945281f: 9px!important;
  --lp-compat-radius-555f3b2f: 10px!important;
  --lp-compat-radius-a5bea61d: 13px;
  --lp-compat-radius-50284a3e: 7px;
  --lp-compat-radius-d1bd337b: 14px!important;
  --lp-compat-shadow-bb8ad084: none!important;
  --lp-compat-color-fdc06201: rgba(var(--success-rgb), .1);
  --lp-compat-radius-89905e7f: 20px;
  --lp-compat-radius-7d19d716: 16px;
  --lp-compat-radius-7e291c02: 999px;
  --lp-compat-radius-2098915f: 50%;
  --lp-compat-color-3e627bcc: rgba(var(--brand-rgb), .18);
  --lp-compat-radius-59f8bf2c: 10px;
  --lp-compat-shadow-e704f960: 0 5px 16px var(--lp-compat-color-3e627bcc);
  --lp-compat-radius-0e828a1b: 15px;
  --lp-compat-radius-3e5e555b: 14px !important;
  --lp-compat-radius-bd7fef27: 10px !important;
  --lp-compat-radius-a43c7e37: 9px !important;
  --lp-compat-radius-05011417: 8px;
  --lp-compat-color-00472a63: rgba(var(--brand-rgb), .12);
  --lp-compat-radius-eb617231: 17px;
  --lp-compat-radius-9669c71c: 9px;
  --lp-compat-color-5ea69147: rgba(var(--shadow-rgb), .18);
  --lp-compat-color-ec38005d: rgba(var(--brand-rgb), .18);
  --lp-compat-radius-1af91184: 21px;
  --lp-compat-radius-f361d844: 18px;
  --lp-compat-shadow-15a73667: 0 8px 28px var(--lp-compat-color-5ea69147);
  --lp-compat-shadow-37a436bb: 0 0 0 4px var(--pink-wash);

  /* Compatibility values centralised during the stylesheet migration. */
  --lp-compat-radius-c13a0039: 6px;
  --lp-compat-radius-fa52629a: 23px;
  --lp-compat-radius-609a4a98: 25px;
  --lp-compat-radius-68e9af95: 22px;
  --lp-compat-radius-2cddb8f7: 9px 9px 0 0;

  /* Compatibility values centralised during the stylesheet migration. */
  --lp-compat-radius-ac61c489: 26px;

  /* Compatibility values centralised during the stylesheet migration. */
  --lp-compat-radius-72f9b048: 5px;
  --lp-compat-radius-663973be: 30px;

  /* Compatibility values centralised during the stylesheet migration. */
  --lp-compat-shadow-cca471f0: 0 0 0 3px color-mix(in srgb,currentColor 16%,transparent);
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* Luxury charcoal + editorial rose: dark-mode palette */
  --premium-blush: #E879A9;
  --premium-blush-hover: #F394BA;
  --premium-blush-soft: rgba(232, 121, 169, .13);
  --premium-petal: #F0A3C1;
  --premium-petal-soft: rgba(232, 121, 169, .08);
  --premium-ivory: #121114;
  --premium-ivory-light: #1B191F;
  --premium-wine: #F4F0F3;

  --brand: var(--premium-blush);
  --brand-hover: var(--premium-blush-hover);
  --brand-soft: var(--premium-blush-soft);
  --brand-rgb: 232, 121, 169;

  --ui-canvas: #121114;
  --ui-surface: #1B191F;
  --ui-surface-muted: #222027;
  --ui-surface-raised: #29262F;
  --ui-border: #393640;
  --ui-border-strong: #514B56;
  --ui-text: #F4F0F3;
  --ui-text-rgb: 244, 240, 243;
  --ui-muted: #BDB6C0;
  --ui-subtle: #918995;
  --ui-surface-rgb: 27, 25, 31;
  --contrast-rgb: 244, 240, 243;
  --shadow-rgb: 0, 0, 0;
  --overlay-rgb: 0, 0, 0;

  --success: #78D6A5;
  --success-rgb: 120, 214, 165;
  --success-soft: rgba(120, 214, 165, .14);
  --warning: #F0C078;
  --warning-rgb: 240, 192, 120;
  --warning-soft: rgba(240, 192, 120, .14);
  --danger: #F08FA4;
  --danger-rgb: 240, 143, 164;
  --danger-soft: rgba(240, 143, 164, .14);
  --info: #96BEE9;
  --info-rgb: 150, 190, 233;
  --info-soft: rgba(150, 190, 233, .14);

  --lp-focus: rgba(var(--brand-rgb), .38);
  --shadow-sm: 0 4px 12px rgba(var(--shadow-rgb), .24);
  --shadow-md: 0 12px 28px rgba(var(--shadow-rgb), .34);
  --shadow-lg: 0 24px 56px rgba(var(--shadow-rgb), .48);
  --bg-gradient: linear-gradient(180deg, var(--ui-canvas), var(--ui-surface));
  --ui-canvas-gradient: linear-gradient(180deg, var(--ui-canvas), var(--ui-surface));
  --hero-gradient: linear-gradient(135deg, var(--ui-surface-muted), var(--ui-surface), var(--ui-canvas));
  --payment-mpesa-gradient: linear-gradient(135deg, #11B780, #0B8C61);

  --on-accent: #24131C;
  --lp-btn-primary-text: var(--on-accent);
  --receipt-paper: #FFFFFF;
  --receipt-ink: #24171D;
  --receipt-border: #D7C2C8;
  --receipt-muted: #796970;
}
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--ui-canvas);
  color: var(--ui-text);
  font-family: var(--lp-font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--lp-focus); outline-offset: 2px; }
