/* ============================================
   STOCKSATHI DESIGN SYSTEM
   Professional SaaS Inventory Management UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */

:root {
  /* Color Palette - Updated Blue Theme */
  /* Primary: Blue */
  --color-primary: #4f82d5;
  /* Primary Dark: Hover states */
  --color-primary-dark: #3a63a5;
  /* Primary Light: Accents */
  --color-primary-light: #93c5fd;
  /* Primary Lighter: Very light backgrounds */
  --color-primary-lighter: #eff6ff;
  /* Primary Hover - Mapped to Dark for consistency or explicit hover color if needed. Using Dark for now as per conventional mapping unless specified otherwise. Request used specific hex for hover. */
  --color-primary-hover: #3a63a5;

  /* Secondary & Status Colors */
  --color-secondary: #3b82f6;
  --color-secondary-dark: #2563eb;
  --color-secondary-light: #60a5fa;
  /* Auto-generated fallback if needed, or keep existing structure */

  --color-success: #10b981;
  --color-success-light: #d1fae5;
  /* Adjusted for green family */
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  /* Adjusted for amber family */
  --color-danger: #ef4444;
  --color-danger-light: #fee2e2;
  /* Adjusted for red family */
  --color-info: #06b6d4;
  --color-info-light: #cffafe;
  /* Adjusted for cyan family */

  /* Neutral Scale (Grayscale) */
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Background Colors */
  --bg-body: #f9fafb;
  /* Sidebar uses white now */
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-hover: #f3f4f6;
  /* mapped to gray-100 */
  --bg-surface: #ffffff;
  --bg-tertiary: #e5e7eb;
  /* mapped to gray-200 */

  /* Border Colors */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-focus: var(--color-primary);

  /* Text Colors */
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;

  /* Shadows - Premium Soft Shadows (Tailwind-inspired) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-header: 0 1px 0 0 rgba(0, 0, 0, 0.05);
  /* Subtle separator */

  /* Typography */
  --font-family: 'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  --font-size-xs: 0.75rem;
  /* 12px */
  --font-size-sm: 0.875rem;
  /* 14px */
  --font-size-base: 1rem;
  /* 16px */
  --font-size-lg: 1.125rem;
  /* 18px */
  --font-size-xl: 1.25rem;
  /* 20px */
  --font-size-2xl: 1.5rem;
  /* 24px */
  --font-size-3xl: 1.875rem;
  /* 30px */

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing Scale */
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */

  /* Border Radius - Reduced for sharper, modern look */
  --radius-sm: 0.25rem;
  /* 4px */
  --radius-md: 0.375rem;
  /* 6px */
  --radius-lg: 0.5rem;
  /* 8px */
  --radius-xl: 0.625rem;
  /* 10px - reduced from 16px */
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 250px;
  /* Slightly narrower */
  --header-height: 64px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

body.dark-mode {
  --bg-body: #0F172A;
  --bg-sidebar: #1E293B;
  --bg-card: #1E293B;
  --bg-header: #1E293B;
  --bg-hover: #334155;
  --bg-surface: #0F172A;
  --bg-tertiary: #334155;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-tertiary: #94A3B8;

  --border-light: #334155;
  --border-medium: #475569;

  background-color: var(--bg-body);
  color: var(--text-primary);
}

body.dark-mode .card {
  background-color: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-primary);
}

body.dark-mode .sidebar {
  background-color: var(--bg-sidebar);
  border-right-color: var(--border-light);
}

body.dark-mode .header {
  background-color: var(--bg-header);
  border-bottom-color: var(--border-light);
}

body.dark-mode .table {
  background-color: var(--bg-card);
}

body.dark-mode .table thead {
  background-color: var(--bg-surface);
}

body.dark-mode .table tbody tr:hover {
  background-color: var(--bg-hover);
}

body.dark-mode .form-control {
  background-color: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-primary);
}

body.dark-mode .form-control:focus {
  border-color: var(--color-primary);
  background-color: var(--bg-card);
}

body.dark-mode .btn-ghost {
  color: var(--text-secondary);
}

body.dark-mode .btn-ghost:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-body);
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-sm);
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Utilities */
.text-xs {
  font-size: var(--font-size-xs);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-base {
  font-size: var(--font-size-base);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-xl {
  font-size: var(--font-size-xl);
}

.text-2xl {
  font-size: var(--font-size-2xl);
}

.font-light {
  font-weight: var(--font-weight-light);
}

.font-normal {
  font-weight: var(--font-weight-normal);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-inverse {
  color: var(--text-inverse);
}

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Spacing Utilities */
.m-0 {
  margin: 0;
}

.mt-1 {
  margin-top: var(--space-1);
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mb-1 {
  margin-bottom: var(--space-1);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-3 {
  margin-bottom: var(--space-3);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.p-0 {
  padding: 0;
}

.p-2 {
  padding: var(--space-2);
}

.p-3 {
  padding: var(--space-3);
}

.p-4 {
  padding: var(--space-4);
}

.p-6 {
  padding: var(--space-6);
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

/* Grid Utilities */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Display Utilities */
.hidden {
  display: none;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

/* Width & Height */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

/* Border Utilities */
.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: var(--radius-full);
}

/* Shadow Utilities */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}