/* ==========================================================================
   Business OS Base Layer
   Reset, variables, typography, base elements, utilities, and helpers only.
   ========================================================================== */

:root {
    color-scheme: light;
    --primary-color: #10b981;
    --primary-hover: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --primary-border: #6ee7b7;
    --primary-soft: rgba(16, 185, 129, .12);
    --border-color: #e5e7eb;
    --page-background: #ffffff;
    --text-color: #1f2937;
    --muted-color: #64748b;
    --surface-color: #ffffff;
    --font-family: Arial, sans-serif;

    /* Canonical semantic design tokens. Legacy variables above remain aliases. */
    --ds-font-family: var(--font-family);
    --ds-text: var(--text-color);
    --ds-text-muted: var(--muted-color);
    --ds-text-subtle: #94a3b8;
    --ds-text-disabled: #94a3b8;
    --ds-text-inverse: #ffffff;
    --ds-surface: var(--surface-color);
    --ds-surface-muted: #f8fafc;
    --ds-surface-hover: #f1f5f9;
    --ds-surface-elevated: #ffffff;
    --ds-surface-page: var(--page-background);
    --ds-surface-deep: #eef2f7;
    --ds-control-surface: #ffffff;
    --ds-control-disabled: #f1f5f9;
    --ds-border: var(--border-color);
    --ds-border-subtle: #f1f5f9;
    --ds-border-strong: #d1d5db;
    --ds-focus-ring: var(--primary-soft);
    --ds-overlay: rgba(15, 23, 42, .5);
    --ds-danger: #dc2626;
    --ds-danger-hover: #b91c1c;
    --ds-danger-soft: #fee2e2;
    --ds-danger-text: #991b1b;
    --ds-warning: #d97706;
    --ds-warning-soft: #fef3c7;
    --ds-warning-text: #92400e;
    --ds-info: #2563eb;
    --ds-info-soft: #dbeafe;
    --ds-info-text: #1d4ed8;
    --ds-success: #166534;
    --ds-success-soft: #dcfce7;
    --ds-success-text: #166534;
    --ds-neutral-soft: #f1f5f9;
    --ds-neutral-text: #475569;
    --ds-radius-sm: 8px;
    --ds-radius-md: 12px;
    --ds-radius-lg: 18px;
    --ds-radius-xl: 24px;
    --ds-radius-pill: 999px;
    --ds-shadow-sm: 0 4px 18px rgba(15, 23, 42, .05);
    --ds-shadow-md: 0 8px 24px rgba(15, 23, 42, .06);
    --ds-shadow-lg: 0 18px 48px rgba(15, 23, 42, .14);
    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-5: 20px;
    --ds-space-6: 24px;
    --ds-space-7: 28px;
    --ds-space-8: 32px;
    --ds-control-height: 44px;
    --ds-button-height: 40px;
    --ds-icon-button-size: 40px;
    --ds-transition: 180ms ease;
    --ds-z-sticky: 100;
    --ds-z-dropdown: 1000;
    --ds-z-overlay: 1400;
    --ds-z-modal: 1500;
    --ds-z-toast: 2000;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-background: #111827;
    --surface-color: #182235;
    --text-color: #e5edf7;
    --muted-color: #9aa9bc;
    --border-color: #334155;
    --ds-text-subtle: #718096;
    --ds-text-disabled: #718096;
    --ds-surface-muted: #222e42;
    --ds-surface-hover: #29384e;
    --ds-surface-elevated: #1d2940;
    --ds-surface-deep: #141d2d;
    --ds-control-surface: #222e42;
    --ds-control-disabled: #1d293b;
    --ds-border-subtle: #29364a;
    --ds-border-strong: #475569;
    --ds-overlay: rgba(2, 6, 23, .72);
    --ds-shadow-sm: 0 4px 18px rgba(0, 0, 0, .2);
    --ds-shadow-md: 0 8px 24px rgba(0, 0, 0, .25);
    --ds-shadow-lg: 0 18px 48px rgba(0, 0, 0, .42);
    --ds-success: #86efac;
    --ds-success-text: #86efac;
    --ds-success-soft: #153826;
    --ds-warning: #fcd34d;
    --ds-warning-text: #fcd34d;
    --ds-warning-soft: #422d0d;
    --ds-danger: #fca5a5;
    --ds-danger-text: #fca5a5;
    --ds-danger-hover: #ef4444;
    --ds-danger-soft: #481b26;
    --ds-info: #93c5fd;
    --ds-info-text: #93c5fd;
    --ds-info-soft: #1e3a5f;
    --ds-neutral-soft: #29364a;
    --ds-neutral-text: #cbd5e1;
}

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

html {
    color-scheme: light;
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--text-color);
    background: var(--page-background);
    font-family: inherit;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button {
    border: 0;
}

img,
svg {
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

[hidden] {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-danger { color: var(--ds-danger-text); }
.text-success { color: var(--ds-success-text); }
.text-warning { color: var(--ds-warning-text); }
.text-info { color: var(--ds-info-text); }
.text-muted { color: var(--ds-text-muted); }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.d-none { display: none; }
.d-inline-block { display: inline-block; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--ds-space-2); }
.mb-5 { margin-bottom: var(--ds-space-5); }
.section-heading-spaced { margin-top: var(--ds-space-6); }
.payroll-view-actions { display:flex;align-items:center;flex-wrap:wrap;gap:var(--ds-space-2);margin-bottom:var(--ds-space-7); }
.payroll-view-actions + .section-heading-spaced { margin-top:0; }
.table-empty-cell { padding: var(--ds-space-7); text-align: center; }
.table-col-check { width: 40px; }
.table-col-actions { width: 240px; }
.table-cell-message { max-width: 400px; }
.table-cell-context { max-width: 250px; }
.empty-state-icon-lg { font-size: 48px; }
