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

/* =============================================
   VavaStone Inventory — White-Label Theme
   Change these variables to rebrand the entire UI.
   ============================================= */

:root {
  --color-primary: #2D5FA0;
  --color-primary-light: #E8EFF8;
  --color-primary-hover: #245089;
  --color-secondary: #1B2A4A;
  --logo-url: url('../shared/logo-placeholder.svg');

  /* Sidebar */
  --sidebar-bg: #4A7FC4;
  --sidebar-width: 208px;
  --sidebar-collapsed-width: 64px;
  --sidebar-border: rgba(255, 255, 255, 0.15);
  --sidebar-text: #FFFFFF;
  --sidebar-text-muted: rgba(255, 255, 255, 0.6);
  --sidebar-active-bg: rgba(255, 255, 255, 0.15);
  --sidebar-active-text: #FFFFFF;

  /* Topbar */
  --topbar-height: 56px;
  --topbar-bg: #EBEBEB;
  --topbar-border: #E5E7EB;

  /* Status colors */
  --status-available: #16A34A;
  --status-available-bg: #DCFCE7;
  --status-reserved: #D97706;
  --status-reserved-bg: #FEF3C7;
  --status-sold: #DC2626;
  --status-sold-bg: #FEE2E2;
  --status-active: #16A34A;
  --status-active-bg: #DCFCE7;
  --status-inactive: #6B7280;
  --status-inactive-bg: #F3F4F6;
  --status-processing: #2563EB;
  --status-processing-bg: #DBEAFE;
  --status-archived: #6B7280;
  --status-archived-bg: #F3F4F6;
  --status-suspended: #DC2626;
  --status-suspended-bg: #FEE2E2;
  --status-invited: #D97706;
  --status-invited-bg: #FEF3C7;

  /* Preset colors */
  --preset-natural-stone: #D97706;
  --preset-engineered-stone: #16A34A;
  --preset-tiles: #2563EB;
  --preset-miscellaneous: #6B7280;
}

/* ─── Global border-radius cap: 7px max ───── */
:root {
  --radius-max: 7px;
}

/* ─── No underlines ever ────────────────────── */
a, a:hover, a:focus, a:active,
button, button:hover {
  text-decoration: none !important;
}

/* Global resets & utilities using theme vars */
body {
  font-family: 'Lato', sans-serif;
  color: #111827;
  background: #FFFFFF;
}

/* Sidebar layout */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: none;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
  overflow-y: auto;
}

/* Sidebar logo area — aligned with topbar */
.sidebar-logo {
  height: var(--topbar-height);
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  padding: 0 20px;
  flex-shrink: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  margin: 1px 0;
  border-left: 3px solid transparent;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: rgba(255, 255, 255, 0.3);
}
.sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left-color: #FF8900;
}
.sidebar-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-text-muted);
  padding: 20px 20px 6px;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 8px 24px 0;
  min-height: calc(100vh - var(--topbar-height));
}

/* Badge / pill styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-max);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}
.badge-green  { background: var(--status-available-bg); color: var(--status-available); }
.badge-amber  { background: var(--status-reserved-bg);  color: var(--status-reserved);  }
.badge-red    { background: var(--status-sold-bg);       color: var(--status-sold);       }
.badge-blue   { background: var(--status-processing-bg); color: var(--status-processing); }
.badge-gray   { background: var(--status-inactive-bg);   color: var(--status-inactive);   }

/* Drawer overlay */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  background: white;
  z-index: 51;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
}
.drawer-panel.open {
  transform: translateX(0);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  background: white;
  border-radius: var(--radius-max);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-panel {
  transform: scale(1);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 70;
  background: #111827;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-max);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* Primary button style using CSS var */
.btn-primary {
  background: var(--sidebar-bg);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-max);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover {
  background: #3D6DAF;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: #374151;
  padding: 8px 20px;
  border-radius: var(--radius-max);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #D1D5DB;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover {
  background: #F9FAFB;
}

.btn-danger {
  background: #DC2626;
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-max);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover {
  background: #B91C1C;
}

/* ─── Page backgrounds ──────────────────────── */
.bg-login { background: #EBEBEB; }

/* ─── Table header ──────────────────────────── */
thead tr, .table-header {
  background: #F5F5F5;
}
table {
  border-collapse: collapse;
}
thead th {
  color: var(--color-primary) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  border-bottom: 1px solid #D1D5DB;
}
tbody td {
  border-bottom: 1px solid #D1D5DB;
}

/* ─── Theme-color utilities ─────────────────── */
.text-primary        { color: var(--color-primary); }
.bg-primary          { background: var(--color-primary); }
.bg-primary:hover    { background: var(--color-primary-hover); }
.bg-primary-light    { background: var(--color-primary-light); }
.text-secondary      { color: var(--color-secondary); }
.bg-secondary        { background: var(--color-secondary); }

/* ─── Link styled with primary color ────────── */
.link-primary {
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 500;
}
.link-primary:hover { opacity: 0.8; }

/* ─── Hyperlink color ───────────────────────── */
.link-action {
  color: #2F81C7;
}
.link-action:hover {
  color: #2F81C7;
  opacity: 0.8;
}

/* ─── Topbar avatar ─────────────────────────── */
.topbar-avatar-circle {
  background: var(--color-primary);
}

/* ─── Dashboard: summary card accent border (left side) ─── */
.card-accent-green  { border-left: 4px solid #16A34A; }
.card-accent-blue   { border-left: 4px solid var(--color-primary); }
.card-accent-amber  { border-left: 4px solid #D97706; }
.card-accent-red    { border-left: 4px solid #DC2626; }
.card-accent-gray   { border-left: 4px solid #6B7280; }

/* ─── Preset bar (dynamic width/color via data attributes + JS) ─── */
.preset-bar {
  width: var(--bar-width);
  background: var(--bar-color);
}

.card-icon-green  { background: #DCFCE7; color: #16A34A; }
.card-icon-blue   { background: var(--color-primary-light); color: var(--color-primary); }
.card-icon-amber  { background: #FEF3C7; color: #D97706; }
.card-icon-red    { background: #FEE2E2; color: #DC2626; }
.card-icon-gray   { background: #F3F4F6; color: #6B7280; }

.card-sub-green   { color: #16A34A; }
.card-sub-blue    { color: var(--color-primary); }
.card-sub-amber   { color: #D97706; }
.card-sub-red     { color: #DC2626; }
.card-sub-gray    { color: #6B7280; }

/* ─── Line clamp (2 lines max) ──────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Row icon (uniform size for product row) ─ */
.row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.row-icon svg {
  width: 14px !important;
  height: 14px !important;
}
.row-icon span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.row-icon span svg {
  width: 14px !important;
  height: 14px !important;
}

/* ─── Tooltip (JS-positioned floating div) ──── */
#global-tooltip {
  position: fixed;
  background: white;
  color: #374151;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-max);
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transition: opacity 0.12s;
}
#global-tooltip.visible {
  opacity: 1;
}

/* ─── Product thumbnail placeholder ─────────── */
.product-thumb {
  border-radius: var(--radius-max);
}

/* ─── Preset color dot ──────────────────────── */
.preset-dot {
  background: var(--dot-color, #6B7280);
}

/* ─── Preset filter chips ───────────────────── */
.preset-chip {
  background: white;
  color: #374151;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-max);
  cursor: pointer;
  font-weight: 400;
  font-size: 12px;
}
.preset-chip svg {
  opacity: 1;
  color: var(--chip-color);
}
.preset-chip:hover {
  border-color: var(--chip-border, #D1D5DB);
}
.preset-chip.active {
  background: var(--chip-bg, white);
  color: #374151;
  border-color: var(--chip-border);
}
.preset-chip.active svg {
  color: var(--chip-color);
}

/* ─── Onboarding icon ───────────────────────── */
.onboarding-icon {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ─── Admin nav branding ────────────────────── */
.admin-brand-box {
  background: var(--color-secondary);
}
.admin-brand-text {
  color: var(--color-secondary);
}

/* ─── Preset badge (dynamic color via CSS vars) ── */
.preset-badge {
  background: var(--badge-bg);
  color: var(--badge-color);
}

/* ─── Skeleton dynamic sizes ────────────────── */
.skeleton-line {
  height: 20px;
  margin-bottom: 12px;
  width: var(--sk-width, 80%);
}
.skeleton-cell {
  height: 16px;
  width: var(--sk-width, 60%);
}
