/* ═══════════════════════════════════════════════════════════════
   COREIDON.AI — Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Theme Variables ── */
:root {
    /* Brand Colors */
    --brand-deep: #091C3A;
    --brand-navy: #00284A;

    /* Light Theme (default) */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F5F0;
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #F8F5F0;
    --bg-sidebar: #091C3A;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-sidebar-active: rgba(255,255,255,0.1);

    --text-primary: #000000;
    --text-secondary: #2B303B;
    --text-muted: #6B7280;
    --text-sidebar: rgba(248,245,240,0.7);
    --text-sidebar-active: #FFFFFF;

    --border-default: #E5E7EB;
    --border-subtle: #F0EDE8;
    --border-sidebar: rgba(255,255,255,0.08);

    --btn-primary-bg: #091C3A;
    --btn-primary-text: #FFFFFF;
    --btn-primary-hover: #0D2A52;
    --btn-secondary-bg: #FFFFFF;
    --btn-secondary-text: #2B303B;
    --btn-secondary-border: #E5E7EB;
    --btn-secondary-hover: #F8F5F0;
    --btn-danger-bg: #DC2626;
    --btn-danger-text: #FFFFFF;

    --accent-success: #059669;
    --accent-success-bg: #ECFDF5;
    --accent-warning: #D97706;
    --accent-warning-bg: #FFFBEB;
    --accent-danger: #DC2626;
    --accent-danger-bg: #FEF2F2;
    --accent-info: #091C3A;
    --accent-info-bg: #EEF2FF;

    --input-bg: #FFFFFF;
    --input-border: #E5E7EB;
    --input-focus-border: #091C3A;
    --input-placeholder: #9CA3AF;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    --sidebar-width: 260px;
    --header-height: 56px;
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #0A0A0A;
    --bg-surface: #111111;
    --bg-surface-alt: #1A1A1A;
    --bg-sidebar: #0A0A0A;
    --bg-sidebar-hover: rgba(255,255,255,0.04);
    --bg-sidebar-active: rgba(255,255,255,0.08);

    --text-primary: #FFFFFF;
    --text-secondary: rgba(248,245,240,0.7);
    --text-muted: rgba(248,245,240,0.5);
    --text-sidebar: rgba(248,245,240,0.5);
    --text-sidebar-active: #FFFFFF;

    --border-default: #2B303B;
    --border-subtle: #1F2937;
    --border-sidebar: #2B303B;

    --btn-primary-bg: #F8F5F0;
    --btn-primary-text: #091C3A;
    --btn-primary-hover: #FFFFFF;
    --btn-secondary-bg: #1A1A1A;
    --btn-secondary-text: #F8F5F0;
    --btn-secondary-border: #2B303B;
    --btn-secondary-hover: #222222;

    --accent-success-bg: rgba(5,150,105,0.15);
    --accent-warning-bg: rgba(217,119,6,0.15);
    --accent-danger-bg: rgba(220,38,38,0.15);
    --accent-info-bg: rgba(9,28,58,0.3);

    --input-bg: #1A1A1A;
    --input-border: #2B303B;
    --input-focus-border: #F8F5F0;
    --input-placeholder: rgba(248,245,240,0.3);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* ── Base Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
    font-family: var(--font-body);
    background: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ── Typography ── */
h1, h2, h3, h4, .heading { font-family: var(--font-heading); }

/* ── Layout Shell ── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.sidebar-brand {
    padding: 20px 20px;
    border-bottom: 1px solid var(--border-sidebar);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand svg { width: 32px; height: 32px; }

.sidebar-brand-name {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-sidebar-active);
}

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

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-sidebar);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-nav-item:hover { background: var(--bg-sidebar-hover); color: var(--text-sidebar-active); }
.sidebar-nav-item.active-tab { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); border-left: none; font-weight: 600; }

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: background-color 0.2s ease;
}

.top-bar {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.top-bar-title {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

/* ── Cards & Surfaces ── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.card-padded { padding: 24px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}
.btn-primary:hover { background: var(--btn-primary-hover); }

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border-color: var(--btn-secondary-border);
}
.btn-secondary:hover { background: var(--btn-secondary-hover); }

.btn-soft {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--accent-info-bg);
    color: var(--accent-info);
}
.btn-soft:hover { opacity: 0.8; }
.btn-soft.muted {
    background: var(--bg-surface-alt);
    color: var(--text-muted);
}
.btn-soft.muted:hover { color: var(--text-primary); }

.btn-danger {
    background: var(--btn-danger-bg);
    color: var(--btn-danger-text);
    border-color: var(--btn-danger-bg);
}
.btn-danger:hover { opacity: 0.9; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-surface-alt); }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 12px 24px; font-size: 13px; }

/* ── Inputs ── */
.input, input[type="text"], input[type="number"], input[type="date"],
input[type="file"], input[type="email"], input[type="password"],
textarea, select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color 0.15s ease, background-color 0.2s ease;
    outline: none;
    width: 100%;
}

.input:focus, input:focus, textarea:focus, select:focus {
    border-color: var(--input-focus-border);
}

::placeholder { color: var(--input-placeholder); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }

thead { background: var(--bg-surface-alt); }
thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-default);
}

tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.2s ease;
}

tbody tr { transition: background-color 0.1s ease; }
tbody tr:hover { background: var(--bg-surface-alt); }
tbody tr:last-child td { border-bottom: none; }

/* ── Status Pills ── */
.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Modals ── */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}
.modal.active { display: flex; }

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

/* ── Tabs ── */
.tab-bar { display: flex; gap: 24px; }

.tab-btn {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: 8px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active, .tab-btn[style*="border-b"] {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* ── Labels ── */
.label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ── Chips ── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--accent-info-bg);
    color: var(--brand-deep);
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
}

[data-theme="dark"] .chip {
    background: rgba(248,245,240,0.1);
    color: var(--text-primary);
}

/* ── Theme Toggle ── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    font-size: 16px;
}
.theme-toggle:hover { background: var(--bg-surface-alt); color: var(--text-primary); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Utility ── */
.hidden { display: none !important; }
.module-content.hidden { display: none !important; }

/* ── Transitions ── */
.card, .sidebar, .top-bar, .main-area, table, thead, tbody td,
input, textarea, select, .modal-content, .theme-toggle {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ── Prevent FOUC ── */
html:not([data-theme]) { visibility: hidden; }

/* ═══════════════════════════════════════════════════════════════
   Tailwind-replacement Utility Classes
   ═══════════════════════════════════════════════════════════════ */

/* ── Display ── */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* ── Flexbox ── */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* ── 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)); }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-5 { grid-column: span 5 / span 5; }

/* ── Gap ── */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }
.gap-x-6 { column-gap: 1.5rem; }
.gap-y-2 { row-gap: 0.5rem; }

/* ── Space Between ── */
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ── Divide ── */
.divide-y > * + * { border-top: 1px solid var(--border-default); }

/* ── Padding ── */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-8 { padding-top: 2rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pl-1 { padding-left: 0.25rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-4 { padding-left: 1rem; }

/* ── Margin ── */
.m-0 { margin: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-1 { margin-left: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ── Width ── */
.w-2 { width: 0.5rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-full { width: 100%; }
.min-w-\[120px\] { min-width: 120px; }
.min-w-\[220px\] { min-width: 220px; }
.max-w-xs { max-width: 20rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-\[220px\] { max-width: 220px; }

/* ── Height ── */
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-32 { height: 8rem; }
.h-fit { height: fit-content; }
.h-full { height: 100%; }
.max-h-40 { max-height: 10rem; }
.max-h-60 { max-height: 15rem; }
.max-h-96 { max-height: 24rem; }
.max-h-\[70vh\] { max-height: 70vh; }
.min-h-\[160px\] { min-height: 160px; }

/* ── Typography ── */
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Text Colors (custom theme) ── */
.text-c-primary { color: var(--text-primary); }
.text-c-secondary { color: var(--text-secondary); }
.text-c-muted { color: var(--text-muted); }
.text-c-success { color: var(--accent-success); }
.text-c-warning { color: var(--accent-warning); }
.text-c-danger { color: var(--accent-danger); }
.text-c-info { color: var(--accent-info); }
.text-white { color: #fff; }
.text-green-700 { color: #15803d; }
.text-purple-700 { color: #7e22ce; }

/* ── Background Colors (custom theme) ── */
.bg-surface { background-color: var(--bg-surface); }
.bg-surface-alt { background-color: var(--bg-surface-alt); }
.bg-brand-deep { background-color: var(--brand-deep); }
.bg-c-success { background-color: var(--accent-success); }
.bg-c-success-bg { background-color: var(--accent-success-bg); }
.bg-c-danger { background-color: var(--accent-danger); }
.bg-c-danger-bg { background-color: var(--accent-danger-bg); }
.bg-c-warning-bg { background-color: var(--accent-warning-bg); }
.bg-c-info-bg { background-color: var(--accent-info-bg); }
.bg-green-100 { background-color: #dcfce7; }
.bg-purple-100 { background-color: #f3e8ff; }

/* ── Border Colors ── */
.border { border-width: 1px; border-style: solid; border-color: var(--border-default); }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-t-0 { border-top-width: 0; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-l-2 { border-left-width: 2px; border-left-style: solid; }
.border-c-border { border-color: var(--border-default); }
.border-c-border-subtle { border-color: var(--border-subtle); }
.border-transparent { border-color: transparent; }
.border-dashed { border-style: dashed; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-500 { border-color: #3b82f6; }
.border-blue-600 { border-color: #2563eb; }
.border-red-100 { border-color: #fee2e2; }
.border-red-200 { border-color: #fecaca; }
.border-amber-100 { border-color: #fef3c7; }
.border-amber-200 { border-color: #fde68a; }
.border-emerald-100 { border-color: #d1fae5; }

/* ── Border Radius ── */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t-lg { border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; }
.rounded-b-lg { border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem; }

/* ── Shadows ── */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }

/* ── Positioning ── */
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-1\.5 { top: 0.375rem; }
.top-3 { top: 0.75rem; }
.top-full { top: 100%; }
.right-0 { right: 0; }
.right-2 { right: 0.5rem; }
.right-8 { right: 2rem; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ── Overflow & Visibility ── */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.pointer-events-none { pointer-events: none; }

/* ── Opacity ── */
.opacity-0 { opacity: 0; }

/* ── Object Fit ── */
.object-cover { object-fit: cover; }

/* ── Cursor ── */
.cursor-pointer { cursor: pointer; }
.cursor-move { cursor: move; }

/* ── Outline ── */
.outline-none { outline: none; }

/* ── Transitions ── */
.transition-all { transition: all 0.15s ease; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.transition-opacity { transition: opacity 0.15s ease; }
.transition-shadow { transition: box-shadow 0.15s ease; }

/* ── Animations ── */
.animate-spin { animation: tw-spin 1s linear infinite; }
.animate-pulse { animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes tw-spin { to { transform: rotate(360deg); } }
@keyframes tw-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.field-invalid {
    animation: field-flash 0.6s ease-out 3;
    border-color: var(--accent-danger) !important;
    background: var(--accent-danger-bg) !important;
}

.worker-card-dragging-invalid {
    opacity: 0.35;
    filter: grayscale(80%);
    pointer-events: none;
    transition: opacity 0.15s ease, filter 0.15s ease;
}
.worker-card-dragging-valid {
    outline: 2px dashed var(--accent-success);
    outline-offset: 2px;
    transition: outline 0.15s ease;
}
@keyframes field-flash {
    0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    50%  { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ── Table ── */
.align-top { vertical-align: top; }

/* ── Accent Color ── */
.accent-blue-600 { accent-color: #2563eb; }

/* ── Scrollbar ── */
.scrollbar-thin::-webkit-scrollbar { width: 4px; height: 4px; }

/* ── Group Hover ── */
.group:hover .group-hover\:visible { visibility: visible; }

/* ── Hover States ── */
.hover\:bg-surface-alt:hover { background-color: var(--bg-surface-alt); }
.hover\:bg-brand-deep:hover { background-color: var(--brand-deep); }
.hover\:bg-c-success:hover { background-color: var(--accent-success); }
.hover\:bg-c-danger:hover { background-color: var(--accent-danger); }
.hover\:bg-c-danger-bg:hover { background-color: var(--accent-danger-bg); }
.hover\:bg-c-info-bg:hover { background-color: var(--accent-info-bg); }
.hover\:bg-c-warning-bg:hover { background-color: var(--accent-warning-bg); }
.hover\:bg-green-200:hover { background-color: #bbf7d0; }
.hover\:text-c-primary:hover { color: var(--text-primary); }
.hover\:text-c-secondary:hover { color: var(--text-secondary); }
.hover\:text-c-info:hover { color: var(--accent-info); }
.hover\:text-c-danger:hover { color: var(--accent-danger); }
.hover\:border-c-info:hover { border-color: var(--accent-info); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:opacity-80:hover { opacity: 0.8; }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }

/* ── File Input Pseudo ── */
.file\:bg-c-info-bg::file-selector-button { background-color: var(--accent-info-bg); }
.file\:border-0::file-selector-button { border: 0; }
.file\:font-semibold::file-selector-button { font-weight: 600; }
.file\:mr-4::file-selector-button { margin-right: 1rem; }
.file\:px-4::file-selector-button { padding-left: 1rem; padding-right: 1rem; }
.file\:py-2::file-selector-button { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.file\:rounded-full::file-selector-button { border-radius: 9999px; }
.file\:text-c-info::file-selector-button { color: var(--accent-info); }
.file\:text-sm::file-selector-button { font-size: 0.875rem; }
.hover\:file\:bg-c-info-bg:hover::file-selector-button { background-color: var(--accent-info-bg); }

/* ── Last Child ── */
.last\:border-0:last-child { border-width: 0; }

/* ── Responsive: md (768px) ── */
@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
}

/* ── Responsive: lg (1024px) ── */
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
}
