/* ============================================
   WashCRM — Design Tokens & Theme Variables
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ---- Typography ---- */
  --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 2vw, 1rem);
  --font-size-base: clamp(1rem, 2.5vw, 1.125rem);
  --font-size-lg: clamp(1.125rem, 3vw, 1.25rem);
  --font-size-xl: clamp(1.25rem, 3.5vw, 1.5rem);
  --font-size-2xl: clamp(1.5rem, 4vw, 1.75rem);
  --font-size-3xl: clamp(1.75rem, 5vw, 2.25rem);
  --public-price-font-size: 0.95rem;

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

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ---- Spacing ---- */
  --spacing-2xs: 0.25rem;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.25rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
  --spacing-3xl: 2.5rem;
  --spacing-4xl: 3rem;

  /* ---- Border Radius ---- */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* ---- Transitions ---- */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-theme: 300ms ease;
  --transition-panel: 250ms ease-in-out;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --shadow-accent: 0 4px 16px rgba(37, 99, 235, 0.28);

  /* ---- Semantic Colors (shared between themes) ---- */
  --success: #22c55e;
  --success-rgb: 34, 197, 94;
  --warning: #f59e0b;
  --warning-rgb: 245, 158, 11;
  --danger: #ef4444;
  --info: #8b5cf6;
  --public-price-color: #0f766e;
  --report-color-green: #22c55e;
  --report-color-blue: #3b82f6;
  --report-color-purple: #8b5cf6;
  --report-color-cyan: #22d3ee;
  --report-color-amber: #f59e0b;
  --report-color-red: #ef4444;
  --report-chip-bg-green: rgba(34, 197, 94, 0.12);
  --report-chip-bg-blue: rgba(59, 130, 246, 0.12);
  --report-chip-bg-purple: rgba(139, 92, 246, 0.12);
  --report-chip-bg-cyan: rgba(34, 211, 238, 0.12);
  --report-chip-bg-amber: rgba(245, 158, 11, 0.12);
  --report-finance-icon-bg-green: rgba(34, 197, 94, 0.15);
  --report-finance-icon-bg-blue: rgba(59, 130, 246, 0.15);
  --report-finance-icon-bg-amber: rgba(245, 158, 11, 0.15);
  --report-profit-panel-bg: rgba(34, 197, 94, 0.06);
  --report-profit-panel-border: rgba(34, 197, 94, 0.75);

  /* ---- Accent (shared between themes) ---- */
  --accent: #2563eb;
  --accent-hover: #1d4fd8;
  --accent-light: rgba(37, 99, 235, 0.15);
  --accent-text: #ffffff;

  /* ---- Overlay ---- */
  --backdrop-modal: rgba(0, 0, 0, 0.55);
  --modal-backdrop-blur: 4px;

  /* ---- Danger UI ---- */
  --danger-bg: rgba(239, 68, 68, 0.08);
  --danger-border: rgba(239, 68, 68, 0.2);

  /* ---- Sizing ---- */
  --input-height: clamp(2.75rem, 6vw, 3.25rem);
  --input-auto-grow-line-height: 1.35em;
  --btn-height: clamp(2.75rem, 6vw, 3.25rem);
  --btn-height-sm: clamp(2.25rem, 5vw, 2.625rem);
  --card-max-width: 28rem;
  --card-padding: clamp(var(--spacing-lg), 5vw, var(--spacing-2xl));
  --modal-form-height: 46rem;
  --modal-sheet-height: 92vh;
  --modal-sheet-height-dynamic: 92dvh;
  --modal-sheet-handle-width: 2.5rem;
  --modal-sheet-handle-height: 0.25rem;
  --inventory-modal-width: 84rem;
  --inventory-create-modal-width: 68rem;
  --inventory-modal-height: 90vh;
  --inventory-row-columns: minmax(14rem, 1.7fr) repeat(3, minmax(7rem, 1fr)) minmax(10rem, 1.2fr);
  --inventory-identity-min-width: 14rem;
  --inventory-field-min-width: 5.25rem;
  --inventory-verification-min-width: 12rem;
  --inventory-modal-z-index: 680;
  --inventory-input-height: 2.75rem;
  --inventory-photo-size: 3rem;
  --inventory-section-icon-size: 2.75rem;
  --inventory-category-icon-size: 1.25rem;
  --inventory-scope-icon-size: 2.5rem;
  --inventory-selection-height: 4.5rem;
  --inventory-search-width: 24rem;
  --inventory-schedule-columns: 7;
  --storage-photo-size: 7.5rem;
  --storage-photo-size-compact: 6.5rem;
  --rate-name-width: 8rem;
  --rate-column-width: 4.75rem;
  --rate-mobile-columns: 3;
  --rate-compact-columns: 2;
  --rate-mobile-input-height: 2.125rem;
  --help-popover-trigger-size: 1.75rem;
  --help-popover-touch-size: var(--help-popover-trigger-size);
  --help-popover-icon-size: 1.125rem;
  --help-popover-width: 22rem;
  --help-popover-max-height: 24rem;
  --help-popover-gap: var(--spacing-xs);
  --help-popover-z-index: 2000;

  /* ---- Opacity ---- */
  --opacity-disabled: 0.5;
  --opacity-placeholder: 0.5;
  --opacity-divider: 0.6;

  /* ---- Scrollbar ---- */
  --scrollbar-width: 0.375rem;
  --scrollbar-radius: var(--radius-full);
}

@media (max-width: 27rem) {
  :root {
    --storage-photo-size: var(--storage-photo-size-compact);
  }
}

/* ============================================
   Dark Theme (default)
   ============================================ */
[data-theme="dark"] {
  --bg-primary: #060a14;
  --bg-gradient: linear-gradient(160deg, #060a14 0%, #0c1a3a 40%, #0a1628 60%, #06101e 100%);
  --bg-secondary: #0c1222;
  --bg-card: #0f172a;
  --bg-surface: #101c2c;
  --bg-surface-hover: #334155;
  --bg-input: #151f36;
  --bg-input-focus: #1a2744;
  --bg-hover: rgba(255, 255, 255, 0.04);

  --text-primary: #f1f5f9;
  --text-secondary: #8899b4;
  --text-tertiary: #94a3b8;
  --text-placeholder: #4a5e7d;
  --text-link: #3b82f6;

  --border-color: #1c2e4a;
  --border-focus: var(--accent);
  --border-input: #1c2e4a;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);

  --success-light: rgba(16, 185, 129, 0.12);
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger-light: rgba(239, 68, 68, 0.12);
  --info-light: rgba(139, 92, 246, 0.12);

  --social-btn-bg: #151f36;
  --social-btn-border: #1c2e4a;
  --social-btn-hover: #1a2744;

  --tab-bg: #151f36;
  --tab-active-bg: var(--accent);
  --tab-active-text: #ffffff;
  --tab-inactive-text: #8899b4;

  --divider-color: #1c2e4a;
  --checkbox-border: #3b5278;

  --theme-icon-filter: brightness(0.85);
  --icon-filter: none;

  --scrollbar-track: #0a1225;
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.25);
}

/* ============================================
   Light Theme
   ============================================ */
[data-theme="light"] {
  --bg-primary: #eef2f9;
  --bg-gradient: linear-gradient(160deg, #e8f0fe 0%, #f0f4ff 30%, #eef2f9 60%, #dce6f5 100%);
  --bg-secondary: #f5f7fb;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-input-focus: #e8eef6;
  --bg-hover: rgba(0, 0, 0, 0.03);

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-placeholder: #94a3b8;
  --text-link: #2563eb;

  --border-color: #d6e0ef;
  --border-focus: var(--accent);
  --border-input: #d6e0ef;

  --shadow-card: 0 4px 24px rgba(100, 116, 139, 0.12);

  --success-light: rgba(16, 185, 129, 0.12);
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger-light: rgba(239, 68, 68, 0.12);
  --info-light: rgba(139, 92, 246, 0.12);

  --social-btn-bg: #f8fafc;
  --social-btn-border: #d6e0ef;
  --social-btn-hover: #eef2f9;

  --tab-bg: #eef2f9;
  --tab-active-bg: var(--accent);
  --tab-active-text: #ffffff;
  --tab-inactive-text: #64748b;

  --divider-color: #d6e0ef;
  --checkbox-border: #94a3b8;

  --theme-icon-filter: brightness(0.3);
  --icon-filter: brightness(0.3);

  --scrollbar-track: #e8eef6;
  --scrollbar-thumb: rgba(0, 0, 0, 0.15);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.3);
}
