/* ============================================================================
   WMS SUPABASE EDITION - GLOBAL STYLESHEET
   Matching the dark industrial design tokens from Inventory / Transactions / Assets
   ============================================================================ */

:root {
  /* Indigo light / enterprise palette */
  --bg: #f5f6fb;
  --surface: #ffffff;
  --raised: #f8f9fd;
  --hover: #f0f1fa;
  --line: #e5e7f0;
  --line-bright: #d7d9e8;
  --text: #202238;
  --soft: #4b5068;
  --muted: #777d95;
  --cyan: #4f46e5;
  --cyan-soft: rgba(79, 70, 229, 0.09);
  --purple: #7c3aed;
  --amber: #b7791f;
  --red: #dc4658;
  --green: #16845b;
  --sidebar-width: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   AUTH SCREEN
   ============================================================================ */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.08), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(155, 124, 255, 0.08), transparent 45%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--raised), var(--surface));
  box-shadow: 0 24px 60px rgba(30, 35, 70, 0.10);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(79, 70, 229, 0.05));
  border: 1px solid rgba(79, 70, 229, 0.35);
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 15px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-brand p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.auth-message {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-bright);
  background: rgba(31, 41, 55, 0.025);
  color: var(--soft);
  font-size: 12px;
}

.auth-message.auth-error {
  border-color: rgba(255, 100, 116, 0.4);
  background: rgba(255, 100, 116, 0.12);
  color: var(--red);
}

.auth-setup-note {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 189, 90, 0.35);
  background: rgba(255, 189, 90, 0.09);
  color: var(--amber);
  font-size: 12px;
  line-height: 1.5;
}

.auth-setup-note code {
  font-family: "JetBrains Mono", monospace;
  background: rgba(31, 41, 55, 0.06);
  padding: 2px 5px;
  border-radius: 4px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 11px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ============================================================================
   APP SHELL & SIDEBAR
   ============================================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 900;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar-subtitle {
  font-size: 10px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  padding: 10px 12px 6px;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--soft);
  padding: 10px 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 13px "Manrope", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--cyan-soft);
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--cyan);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--line-bright);
  color: var(--cyan);
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-meta {
  min-width: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
  text-transform: uppercase;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 800;
}

.sidebar-toggle {
  appearance: none;
  border: 1px solid var(--line-bright);
  background: var(--raised);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 16px;
  cursor: pointer;
}

.mobile-overlay {
  display: none;
}

.page-content {
  flex: 1;
  padding: 26px clamp(16px, 2.2vw, 32px) 44px;
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================================
   BUTTONS, HEADINGS, PANELS & SHARED COMPONENTS
   ============================================================================ */

.btn {
  appearance: none;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  padding: 9px 14px;
  font: 700 12px "Manrope", sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--raised);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-block {
  width: 100%;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--cyan);
  font: 600 10px "JetBrains Mono", monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-heading p {
  margin: 5px 0 0;
  color: var(--soft);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(30, 35, 70, 0.045);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.035), transparent 60%);
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-tag {
  padding: 4px 8px;
  border-radius: 99px;
  border: 1px solid var(--line-bright);
  background: var(--raised);
  color: var(--soft);
  font: 600 10px "JetBrains Mono", monospace;
}

.panel-description {
  margin: 0;
  padding: 16px 20px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.6;
}

.info-icon {
  color: var(--cyan);
  font-size: 16px;
}

/* ============================================================================
   DASHBOARD
   ============================================================================ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(79, 70, 229, 0.04), var(--raised) 45%, var(--surface));
}

.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  margin-bottom: 12px;
}

.metric-icon.blue { background: rgba(79, 70, 229, 0.14); color: var(--cyan); }
.metric-icon.purple { background: rgba(187, 166, 255, 0.15); color: var(--purple); }
.metric-icon.orange { background: rgba(255, 195, 107, 0.15); color: var(--amber); }
.metric-icon.green { background: rgba(66, 232, 160, 0.15); color: var(--green); }

.metric-label {
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  margin-top: 6px;
  font: 700 28px "JetBrains Mono", monospace;
  color: var(--text);
}

.metric-description {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.secondary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 11px 14px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  font: 600 10px "JetBrains Mono", monospace;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.07);
  color: var(--soft);
  font-size: 12px;
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: var(--hover);
}

.empty-state {
  padding: 28px 16px !important;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 99px;
  font: 700 10px "JetBrains Mono", monospace;
  background: var(--raised);
  color: var(--soft);
}

.status-posted { background: #eaf8f1; color: #16734f; border: 1px solid #d2efdf; }
.status-draft { background: rgba(255, 195, 107, 0.14); color: var(--amber); }
.status-error { background: rgba(255, 141, 153, 0.15); color: var(--red); }

.stock-alert-item {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.07);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stock-alert-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.stock-alert-code {
  font: 600 11px "JetBrains Mono", monospace;
  color: var(--cyan);
}

.stock-alert-quantity {
  font-size: 11px;
  color: var(--amber);
}

.error-banner {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 9px;
  border: 1px solid rgba(255, 100, 116, 0.35);
  background: rgba(255, 100, 116, 0.11);
  color: var(--red);
  font-size: 12px;
}

/* ============================================================================
   MASTER DATA
   ============================================================================ */

.master-notice {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid var(--line-bright);
  background: var(--raised);
}

.master-notice.error {
  border-color: rgba(255, 100, 116, 0.4);
  background: rgba(255, 100, 116, 0.12);
  color: var(--red);
}

.master-notice.warning {
  border-color: rgba(255, 189, 90, 0.4);
  background: rgba(255, 189, 90, 0.12);
  color: var(--amber);
}

.master-notice.success {
  border-color: rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.1);
  color: var(--cyan);
}

.master-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.master-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.master-tab {
  appearance: none;
  border: 1px solid var(--line-bright);
  background: var(--raised);
  color: var(--soft);
  padding: 8px 13px;
  border-radius: 8px;
  font: 700 12px "Manrope", sans-serif;
  cursor: pointer;
}

.master-tab.active {
  background: var(--cyan-soft);
  border-color: rgba(79, 70, 229, 0.4);
  color: var(--cyan);
}

.master-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.master-search,
.master-field input,
.master-field select,
.master-field textarea,
.login-form input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: var(--raised);
  color: var(--text);
  font: 500 13px "Manrope", sans-serif;
  outline: none;
  color-scheme: light;
}

.master-field textarea {
  height: auto;
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
}

.master-search:focus,
.master-field input:focus,
.master-field select:focus,
.master-field textarea:focus,
.login-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.master-list-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.master-count {
  margin-left: 8px;
  font: 600 11px "JetBrains Mono", monospace;
  color: var(--muted);
}

.master-status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 99px;
  font: 700 10px "JetBrains Mono", monospace;
}

.master-status.active {
  background: rgba(79, 70, 229, 0.12);
  color: var(--cyan);
}

.master-status.inactive {
  background: rgba(255, 141, 153, 0.12);
  color: var(--red);
}

.master-action-group {
  display: flex;
  gap: 6px;
}

.master-action {
  appearance: none;
  border: 1px solid var(--line-bright);
  background: var(--raised);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  font: 700 11px "Manrope", sans-serif;
  cursor: pointer;
}

.master-action:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.master-action.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.master-action.success:hover {
  border-color: var(--green);
  color: var(--green);
}

/* ============================================================================
   MODAL & FORMS
   ============================================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(25, 28, 55, 0.42);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  background: var(--surface);
  padding: 22px;
  box-shadow: 0 24px 60px rgba(30, 35, 70, 0.14);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.modal-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.modal-close {
  appearance: none;
  border: 1px solid var(--line-bright);
  background: var(--raised);
  color: var(--soft);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

.master-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
}

.master-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--soft);
}

.master-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Toast Notifications for Master Data */
#wms-master-toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}

.wms-master-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-bright);
  background: var(--raised);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(30, 35, 70, 0.10);
}

.wms-master-toast.success { border-left: 4px solid var(--cyan); }
.wms-master-toast.warning { border-left: 4px solid var(--amber); }
.wms-master-toast.error { border-left: 4px solid var(--red); }

.wms-master-toast-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}

/* ============================================================================
   PLACEHOLDER MODULE
   ============================================================================ */

.placeholder-card {
  max-width: 540px;
  margin: 48px auto;
  padding: 34px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}

.placeholder-icon {
  font-size: 36px;
  color: var(--cyan);
  margin-bottom: 12px;
}

.placeholder-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.placeholder-card p {
  margin: 0 0 14px;
  color: var(--soft);
  font-size: 13px;
}

/* ============================================================================
   RESPONSIVE MOBILE
   ============================================================================ */

@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid,
  .secondary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .mobile-topbar {
    display: flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .app-shell.sidebar-open .mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(25, 28, 55, 0.38);
    z-index: 850;
  }
}



/* INDIGO LIGHT ENTERPRISE POLISH — presentation only */
:root {
  --focus-ring: rgba(79, 70, 229, 0.22);
  --shadow-soft: 0 8px 24px rgba(31, 41, 85, 0.055);
  --shadow-card: 0 2px 8px rgba(31, 41, 85, 0.045), 0 12px 28px rgba(31, 41, 85, 0.035);
}
html { scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg); color: var(--text);
  font-family: "Inter", "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}
::selection { color: #fff; background: #4f46e5; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
button, input, select, textarea { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.auth-screen {
  background: radial-gradient(circle at 12% 12%, rgba(79,70,229,.09), transparent 38%),
              radial-gradient(circle at 88% 88%, rgba(124,58,237,.06), transparent 38%), var(--bg);
}
.auth-card {
  border-color: var(--line); border-radius: 18px; background: rgba(255,255,255,.98);
  box-shadow: 0 24px 60px rgba(31,41,85,.12);
}
.brand-mark {
  background: linear-gradient(135deg, rgba(79,70,229,.15), rgba(79,70,229,.04));
  border-color: rgba(79,70,229,.22);
}

/* Sidebar light */
.sidebar { background: #fff; border-right-color: #e7e8f1; box-shadow: 4px 0 18px rgba(31,41,85,.025); }
.sidebar-header, .sidebar-footer { border-color: #ececf4; }
.sidebar-subtitle, .eyebrow { color: #6258dc; }
.nav-section-label { color: #9297aa; }
.nav-item { color: #596078; border-radius: 9px; }
.nav-item:hover { background: #f4f4fb; color: #292b49; }
.nav-item.active {
  color: #4f46e5; background: #efefff; border-color: #e1e0ff;
  box-shadow: inset 3px 0 0 #5b52e8;
}
.user-avatar { color: #5148d8; background: #f1f0ff; border-color: #e4e2ff; }
.user-name { color: #272943; }
.user-role { color: #858aa0; }
.mobile-topbar { background: rgba(255,255,255,.96); box-shadow: 0 2px 12px rgba(31,41,85,.035); }
.sidebar-toggle { background: #fff; color: #343653; border-color: var(--line); }

/* Buttons, headings, panels */
.btn { min-height: 38px; border-radius: 9px; box-shadow: none; }
.btn-primary {
  color: #fff; background: #5148d8; border-color: #5148d8;
  box-shadow: 0 2px 5px rgba(79,70,229,.16);
}
.btn-primary:hover:not(:disabled) { background: #4338ca; border-color: #4338ca; filter: none; }
.btn-secondary { background: #fff; border-color: #dfe1ed; color: #454a63; }
.btn-secondary:hover:not(:disabled) { background: #f7f7ff; border-color: #b9b5f5; color: #4f46e5; }
.page-heading h1 { color: #252743; letter-spacing: -.035em; }
.page-heading p { color: #747a91; }
.panel {
  border-color: #e6e7f0; border-radius: 14px; background: #fff; box-shadow: var(--shadow-card);
}
.panel-header { background: linear-gradient(90deg, rgba(79,70,229,.035), transparent 68%); border-bottom-color: #ececf3; }
.panel-header h2 { color: #292b49; }
.panel-tag { background: #f7f7fc; border-color: #e7e7f1; color: #666c84; }

/* Dashboard */
.metric-card {
  border-color: #e7e8f1; border-radius: 14px;
  background: linear-gradient(145deg, #fff, #fafaff); box-shadow: var(--shadow-soft);
}
.metric-value { color: #242641; font-variant-numeric: tabular-nums; }
.metric-icon.blue { background: rgba(79,70,229,.10); color: #5148d8; }
.metric-icon.purple { background: rgba(124,58,237,.10); color: #7c3aed; }
.metric-icon.orange { background: rgba(183,121,31,.11); color: #a66b12; }
.metric-icon.green { background: rgba(22,132,91,.10); color: #16845b; }

/* Data tables — comfortable spacing */
.table-wrapper { scrollbar-width: thin; scrollbar-color: #c8cadd #f5f6fb; }
.data-table { min-width: 640px; }
.data-table th {
  padding: 13px 15px; background: #f7f7fc; color: #727890;
  border-bottom-color: #e7e8f0; letter-spacing: .045em;
}
.data-table td {
  padding: 14px 15px; color: #4c526a; border-bottom-color: #eff0f5; line-height: 1.55;
}
.data-table tbody tr:hover td { background: #f8f8ff; }
.status-badge { border: 1px solid transparent; font-size: 10px; letter-spacing: .015em; }
.status-posted { background: #eaf8f1; color: #16734f; border-color: #d2efdf; }
.status-draft { background: #fff6e7; color: #98600c; border-color: #f7e7c7; }
.status-error { background: #fff0f1; color: #c43e50; border-color: #f6d8dc; }
.stock-alert-item { border-bottom-color: #eff0f5; }
.stock-alert-name { color: #292b49; }
.stock-alert-code { color: #5148d8; }
.stock-alert-quantity { color: #a66b12; }

/* Master data */
.master-notice { border-color: #e4e5ef; background: #f8f9fd; }
.master-notice.error { border-color: #f2cbd1; background: #fff2f3; color: #bd3c4d; }
.master-notice.warning { border-color: #f2dfb8; background: #fff8eb; color: #96600d; }
.master-notice.success { border-color: #ccebdc; background: #effaf4; color: #16734f; }
.master-toolbar { border-bottom-color: #ececf3; }
.master-tab { background: #fff; border-color: #e1e2ec; color: #626881; }
.master-tab:hover { background: #f8f8ff; border-color: #c9c6f7; }
.master-tab.active { background: #efefff; border-color: #d8d5ff; color: #4f46e5; }
.master-search, .master-field input, .master-field select, .master-field textarea, .login-form input {
  background: #fff; color: #292b49; border-color: #dfe1eb; color-scheme: light; min-height: 40px;
}
.master-search::placeholder, .master-field input::placeholder, .master-field textarea::placeholder, .login-form input::placeholder { color: #9a9eb0; }
.master-search:focus, .master-field input:focus, .master-field select:focus, .master-field textarea:focus, .login-form input:focus {
  border-color: #7169e8; box-shadow: 0 0 0 3px rgba(79,70,229,.10);
}
.master-status.active { background: #eaf8f1; color: #16734f; }
.master-status.inactive { background: #fff0f1; color: #c43e50; }
.master-action { background: #fff; border-color: #e0e1eb; color: #555b73; min-height: 30px; }
.master-action:hover { background: #f6f5ff; border-color: #bdb9f4; color: #4f46e5; }

/* Modal and toast */
.modal-overlay { background: rgba(24,27,54,.42); backdrop-filter: blur(3px); }
.modal-card { border-color: #e4e5ef; background: #fff; box-shadow: 0 24px 70px rgba(25,28,65,.20); border-radius: 16px; }
.modal-header h2 { color: #292b49; }
.modal-close { background: #f8f8fc; border-color: #e5e6ef; color: #626780; }
.wms-master-toast { background: #fff; border-color: #e5e6ef; color: #30334f; box-shadow: 0 12px 32px rgba(31,41,85,.14); }
.wms-master-toast.success { border-left-color: #16845b; }
.wms-master-toast.warning { border-left-color: #b7791f; }
.wms-master-toast.error { border-left-color: #dc4658; }
.placeholder-card { border-color: #e6e7f0; background: #fff; box-shadow: var(--shadow-soft); }
.placeholder-icon { color: #5148d8; }

/* Inputs, scrollbars and accessibility */
input[type="checkbox"], input[type="radio"] { accent-color: #5148d8; }
* { scrollbar-width: thin; scrollbar-color: #c9cbda transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #c9cbda; border: 2px solid transparent; border-radius: 99px; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #aeb1c5; background-clip: padding-box; }

@media (max-width: 820px) {
  .sidebar { background: #fff; box-shadow: 12px 0 35px rgba(25,28,65,.12); }
  .app-shell.sidebar-open .mobile-overlay { background: rgba(25,28,65,.38); backdrop-filter: blur(2px); }
  .page-content { padding-top: 20px; }
  .page-heading { align-items: flex-start; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .auth-screen { padding: 16px; }
  .auth-card { padding: 26px 20px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 22px; }
  .modal-overlay { align-items: flex-end; padding: 10px; }
  .modal-card { max-height: 92vh; padding: 18px; border-radius: 16px 16px 12px 12px; }
  .modal-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important; transition-duration: .01ms !important;
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  }
}



/* Cross-module light controls and global component consistency */
:root { color-scheme: light; }
input, select, textarea, button { font-family: inherit; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  color-scheme: light;
}
button:disabled { cursor: not-allowed; opacity: .58; }
.page-content { background: var(--bg); }
