/* ============================================================
   L'art Dore POS — Base Styles & Design Tokens
   Left Sidebar SaaS Dashboard — 2025/2026
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

/* Remove default search input styling */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* --- Design Tokens --- */
:root {
  /* Background */
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface2: #f4f5f7;
  --surface3: #eef0f3;

  /* Borders */
  --border: #e2e5ea;
  --border-light: #f0f1f3;
  --border-focus: #6366f1;

  /* Text */
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;
  --text-xs: #b0b8c4;

  /* Accent — Indigo */
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-mid: #c7d2fe;
  --accent-subtle: #f5f3ff;

  /* Status */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-light: #a7f3d0;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-light: #fca5a5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-light: #fcd34d;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* Module colors */
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --teal: #14b8a6;
  --teal-bg: #f0fdfa;
  --orange: #f97316;
  --orange-bg: #fff7ed;

  /* Shadows — layered, subtle */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-focus: 0 0 0 3px rgba(99,102,241,0.15);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #64748b;
  --sidebar-text-hover: #0f172a;
  --sidebar-active-bg: #eef2ff;
  --sidebar-active-text: #4f46e5;
  --sidebar-divider: #e2e5ea;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography */
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Fraunces', 'Georgia', serif;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.8125rem;  /* 13px */
  --text-base: 0.875rem; /* 14px */
  --text-md: 1rem;       /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index layers */
  --z-sidebar: 100;
  --z-topbar: 50;
  --z-dropdown: 200;
  --z-sticky: 200;
  --z-mobile-overlay: 99;
  --z-modal-backdrop: 1000;
  --z-modal: 1001;
  --z-toast: 1100;
}

/* --- Base Body --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--text);
  background-color: var(--bg);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl);
  font-optical-sizing: auto;
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

h6 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}

p {
  color: var(--text-sub);
  line-height: 1.65;
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

strong {
  font-weight: var(--weight-semibold);
}

/* --- Links --- */
a.link {
  color: var(--accent);
  font-weight: var(--weight-medium);
  transition: color var(--transition-fast);
}
a.link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* --- Selection --- */
::selection {
  background-color: var(--accent-mid);
  color: var(--accent-hover);
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: var(--radius-full);
  transition: background-color var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* --- Utility Classes --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sub { color: var(--text-sub); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }

.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.hidden { display: none !important; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
