/* ================================================================
   bahri-ui-kits — Pro theme overrides
   Polished enterprise aesthetic: generous radius, refined spacing,
   subtle depth, neutral blue-tinted palette, premium feel.
================================================================ */

/* ---- Structural token overrides ---- */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 999px;

  --shadow-raised: 0 2px 8px rgba(30, 40, 80, 0.07), 0 1px 2px rgba(30, 40, 80, 0.05);
  --shadow-overlay: 0 12px 40px rgba(30, 40, 80, 0.16), 0 3px 8px rgba(30, 40, 80, 0.08);

  --border-width-default: 1.5px;

  --motion-fast: 160ms;
  --motion-normal: 240ms;
}

/* ---- Colour overrides — refined neutral blue palette ---- */
html,
html[data-mode="light"] {
  color-scheme: light;

  --color-bg-canvas: #f7f8fc;
  --color-bg-subtle: #eef0f8;
  --color-surface-default: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-overlay: #ffffff;

  --color-text-primary: #1a1f36;
  --color-text-secondary: #52637a;
  --color-text-tertiary: #8a97a8;
  --color-text-inverse: #ffffff;
  --color-text-disabled: #b4bed0;

  --color-border-subtle: #e3e8f4;
  --color-border-default: #ccd4e8;
  --color-border-strong: #99a8c8;
  --color-border-focus: #2563eb;

  --color-icon-primary: #1a1f36;
  --color-icon-secondary: #52637a;
  --color-icon-inverse: #ffffff;

  --color-action-primary-bg: #2563eb;
  --color-action-primary-bg-hover: #1d4ed8;
  --color-action-primary-text: #ffffff;

  --color-action-secondary-bg: #eff4ff;
  --color-action-secondary-bg-hover: #e0ebff;
  --color-action-secondary-text: #3b6fd4;

  --color-feedback-success-bg: #ecfdf5;
  --color-feedback-success-text: #065f46;
  --color-feedback-success-border: #a7f3d0;

  --color-feedback-warning-bg: #fffbeb;
  --color-feedback-warning-text: #78350f;
  --color-feedback-warning-border: #fcd34d;

  --color-feedback-danger-bg: #fff1f2;
  --color-feedback-danger-text: #9f1239;
  --color-feedback-danger-border: #fda4af;

  --color-focus-ring: #93c5fd;
  --color-overlay-scrim: rgba(26, 31, 54, 0.42);
}

html[data-mode="dark"] {
  color-scheme: dark;

  --color-bg-canvas: #0f1117;
  --color-bg-subtle: #13161f;
  --color-surface-default: #191d2c;
  --color-surface-raised: #1e2338;
  --color-surface-overlay: #242944;

  --color-text-primary: #e8ecf4;
  --color-text-secondary: #8a97b4;
  --color-text-tertiary: #5a6882;
  --color-text-inverse: #ffffff;
  --color-text-disabled: #3a4560;

  --color-border-subtle: #1e2438;
  --color-border-default: #2a3254;
  --color-border-strong: #3d4e7a;
  --color-border-focus: #60a5fa;

  --color-icon-primary: #e8ecf4;
  --color-icon-secondary: #8a97b4;
  --color-icon-inverse: #ffffff;

  --color-action-primary-bg: #3b82f6;
  --color-action-primary-bg-hover: #2563eb;
  --color-action-primary-text: #ffffff;

  --color-action-secondary-bg: #1a2444;
  --color-action-secondary-bg-hover: #202e54;
  --color-action-secondary-text: #93c5fd;

  --color-feedback-success-bg: #052e16;
  --color-feedback-success-text: #86efac;
  --color-feedback-success-border: #166534;

  --color-feedback-warning-bg: #2d1f00;
  --color-feedback-warning-text: #fde68a;
  --color-feedback-warning-border: #92400e;

  --color-feedback-danger-bg: #2d0a14;
  --color-feedback-danger-text: #fca5a5;
  --color-feedback-danger-border: #9f1239;

  --color-focus-ring: #3b82f6;
  --color-overlay-scrim: rgba(15, 17, 23, 0.60);
}

/* ---- Component overrides ---- */

/* Buttons — refined, slightly larger, pill-friendly */
.btn {
  font-weight: 500;
  padding: 8px 18px;
  letter-spacing: -0.005em;
}

.btn-sm { padding: 5px 12px; }
.btn-lg { padding: 11px 22px; }

.btn-primary {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.30);
}

.btn-primary.is-hover {
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  box-shadow: 0 1px 2px rgba(30, 40, 80, 0.06);
}

/* Fields — generous padding, refined focus */
.field {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
}

.field.is-focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-focus-ring) 25%, transparent);
}

select.field-select {
  padding: 9px 28px 9px 14px;
  border-radius: var(--radius-sm);
}

/* Badges — pill by default */
.bdg {
  font-weight: 500;
  letter-spacing: 0;
  padding: 3px 10px;
}

/* Cards — elevated, more generous padding */
.crd {
  border-radius: var(--radius-md);
}

.crd-elev {
  box-shadow: var(--shadow-raised);
}

.crd-body {
  padding: 1.25rem;
  gap: 6px;
}

.crd-foot {
  padding: 0.875rem 1.25rem;
}

/* Tabs — pill style looks better in Pro */
.tabs .tab {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.tabs-pill {
  border-radius: var(--radius-md);
  padding: 4px;
}

.tabs-pill .tab {
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.tabs-pill .tab.is-active {
  box-shadow: 0 1px 4px rgba(30, 40, 80, 0.10);
}

/* Dialog — softer, more spacious */
.dlg {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
}

.dlg-head {
  padding: 1.25rem 1.5rem;
}

.dlg-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.dlg-foot {
  padding: 1rem 1.5rem;
  background: var(--color-surface-default);
  border-top: 1.5px solid var(--color-border-subtle);
  gap: 0.75rem;
}

/* Table — more airy */
.tbl th {
  padding: 11px 1.25rem;
  font-size: 0.6875rem;
}

.tbl td {
  padding: 11px 1.25rem;
}

/* Toggle */
.toggle-sw.is-on { background: var(--color-action-primary-bg); }

.toggle-sw {
  --sw-w: 40px;
  --sw-h: 22px;
}
