html {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.18), transparent 24rem);
    background-color: #f8fafc;
}

html.dark body {
    background-color: #020617;
}

.glass-panel {
    background-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
}

html.dark .glass-panel {
    background-color: rgba(15, 23, 42, 0.85);
}

.status-pill {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background-color: rgba(255, 255, 255, 0.5);
}

html.dark .status-pill {
    background-color: rgba(30, 41, 59, 0.7);
}

.auth-surface {
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(59, 130, 246, 0.04)),
        rgba(255, 255, 255, 0.92);
}

html.dark .auth-surface {
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(59, 130, 246, 0.04)),
        rgba(15, 23, 42, 0.92);
}

.input-surface {
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    background-color: #ffffff;
    border-color: rgba(148, 163, 184, 0.45);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-surface:focus {
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

html.dark .input-surface {
    color: #e5e7eb;
    -webkit-text-fill-color: #e5e7eb;
    caret-color: #e5e7eb;
    background-color: rgba(2, 6, 23, 0.92);
    border-color: rgba(71, 85, 105, 0.85);
}

input[type="search"] {
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
}

html.dark input[type="search"] {
    color: #e5e7eb;
    -webkit-text-fill-color: #e5e7eb;
    caret-color: #e5e7eb;
}

input.input-surface:-webkit-autofill,
input.input-surface:-webkit-autofill:hover,
input.input-surface:-webkit-autofill:focus,
input[type="search"]:-webkit-autofill,
input[type="search"]:-webkit-autofill:hover,
input[type="search"]:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    box-shadow: 0 0 0 1000px #ffffff inset;
}

html.dark input.input-surface:-webkit-autofill,
html.dark input.input-surface:-webkit-autofill:hover,
html.dark input.input-surface:-webkit-autofill:focus,
html.dark input[type="search"]:-webkit-autofill,
html.dark input[type="search"]:-webkit-autofill:hover,
html.dark input[type="search"]:-webkit-autofill:focus {
    -webkit-text-fill-color: #e5e7eb;
    caret-color: #e5e7eb;
    box-shadow: 0 0 0 1000px rgba(2, 6, 23, 0.92) inset;
}

select.input-surface {
    color-scheme: light;
}

select.input-surface option {
    color: #0f172a;
    background-color: #ffffff;
}

html.dark select.input-surface {
    color-scheme: dark;
    color: #f8fafc;
    background-color: #0f172a;
    border-color: rgba(71, 85, 105, 0.85);
}

html.dark select.input-surface option {
    color: #f8fafc;
    background-color: #0f172a;
}

html.dark select.input-surface:disabled {
    color: #94a3b8;
    background-color: rgba(15, 23, 42, 0.88);
}

.dashboard-hero {
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(59, 130, 246, 0.08)),
        rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(20px);
}

html.dark .dashboard-hero {
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(59, 130, 246, 0.05)),
        rgba(15, 23, 42, 0.9);
    border-color: rgba(51, 65, 85, 0.9);
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 20px 45px rgba(148, 163, 184, 0.12);
}

html.dark .dashboard-card {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(51, 65, 85, 0.95);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.35);
}

.dashboard-stat {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

html.dark .dashboard-stat {
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(51, 65, 85, 0.8);
}

.surface-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 14px 32px rgba(148, 163, 184, 0.14);
}

html.dark .surface-card {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(51, 65, 85, 0.95);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.34);
}

.surface-muted {
    background: rgba(248, 250, 252, 0.92);
}

html.dark .surface-muted {
    background: rgba(2, 6, 23, 0.52);
}

.rrhh-employee-grid {
    background: rgba(255, 255, 255, 0.96);
}

.rrhh-employee-table {
    color: #334155;
}

.rrhh-employee-table thead th {
    color: #334155;
}

.rrhh-employee-table-body {
    background: rgba(255, 255, 255, 0.98);
}

.rrhh-employee-row {
    background: rgba(255, 255, 255, 0.98);
}

.rrhh-employee-row td {
    color: #334155;
}

.rrhh-employee-row td:first-child,
.rrhh-employee-row td:nth-child(2) > div:first-child {
    color: #0f172a;
}

.rrhh-employee-link {
    background: rgba(255, 255, 255, 0.72);
}

.rrhh-employee-link-neutral {
    color: #334155;
    border-color: rgba(148, 163, 184, 0.45);
}

.rrhh-employee-link-primary {
    color: #0369a1;
    border-color: rgba(56, 189, 248, 0.45);
}

.rrhh-employee-empty-row td {
    background: rgba(248, 250, 252, 0.96);
}

html.dark .rrhh-employee-grid {
    background: rgba(2, 6, 23, 0.94);
}

html.dark .rrhh-employee-table,
html.dark .rrhh-employee-table thead th,
html.dark .rrhh-employee-row td {
    color: #cbd5e1;
}

html.dark .rrhh-employee-table-body,
html.dark .rrhh-employee-row {
    background: rgba(2, 6, 23, 0.72);
}

html.dark .rrhh-employee-row:hover {
    background: rgba(15, 23, 42, 0.88);
}

html.dark .rrhh-employee-row td:first-child,
html.dark .rrhh-employee-row td:nth-child(2) > div:first-child {
    color: #f8fafc;
}

html.dark .rrhh-employee-link {
    background: rgba(15, 23, 42, 0.82);
}

html.dark .rrhh-employee-link-neutral {
    color: #e2e8f0;
    border-color: rgba(71, 85, 105, 0.85);
}

html.dark .rrhh-employee-link-primary {
    color: #bae6fd;
    border-color: rgba(8, 145, 178, 0.65);
}

html.dark .rrhh-employee-empty-row td {
    background: rgba(15, 23, 42, 0.82);
    color: #94a3b8;
}

.table-actions-cell {
    min-width: 8rem;
    vertical-align: top;
}

.table-actions-primary {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-left: auto;
}

.table-action-form {
    display: inline-flex;
    flex: 0 0 auto;
}

.table-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    position: relative;
}

.table-action-icon:hover,
.table-action-icon:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.table-action-icon svg {
    width: 1rem;
    height: 1rem;
}

.table-action-icon.is-neutral {
    border-color: rgba(148, 163, 184, 0.42);
    color: #f8fafc;
}

.table-action-icon.is-success {
    border-color: rgba(16, 185, 129, 0.42);
    color: #6ee7b7;
}

.table-action-icon.is-info {
    border-color: rgba(56, 189, 248, 0.42);
    color: #7dd3fc;
}

.table-action-icon.is-primary {
    border-color: rgba(96, 165, 250, 0.42);
    color: #bfdbfe;
}

.table-action-icon.is-warning {
    border-color: rgba(245, 158, 11, 0.42);
    color: #fcd34d;
}

.table-action-icon.is-danger {
    border-color: rgba(244, 63, 94, 0.42);
    color: #fda4af;
}

.table-actions-secondary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
    margin: 0.75rem 0 0 auto;
}

.table-actions-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    flex: 0 0 auto;
}

.table-actions-secondary-row td {
    border-top: 0;
    padding-top: 0;
}

.table-actions-secondary-row .table-actions-secondary {
    margin-top: 0;
}

.table-actions-secondary-left {
    justify-content: flex-start;
    margin-left: 0;
    margin-right: auto;
}

.badge-soft {
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    border: 1px solid rgba(14, 165, 233, 0.18);
}

html.dark .badge-soft {
    background: rgba(14, 165, 233, 0.14);
    color: #7dd3fc;
    border-color: rgba(14, 165, 233, 0.24);
}

.ui-tooltip-trigger,
.table-action-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ui-tooltip-trigger {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.ui-tooltip-trigger::after,
.table-action-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.55rem);
    transform: translateX(-50%) translateY(0.25rem);
    width: max-content;
    max-width: min(20rem, 70vw);
    padding: 0.6rem 0.75rem;
    border-radius: 0.8rem;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.22);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 40;
}

.ui-tooltip-trigger:hover::after,
.ui-tooltip-trigger:focus-visible::after,
.table-action-icon:hover::after,
.table-action-icon:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.ui-tooltip-trigger:hover,
.ui-tooltip-trigger:focus-visible {
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(224, 242, 254, 0.95);
    color: #0369a1;
    outline: none;
}

html.dark .ui-tooltip-trigger {
    border-color: rgba(71, 85, 105, 0.85);
    background: rgba(15, 23, 42, 0.92);
    color: #cbd5e1;
}

html.dark .ui-tooltip-trigger:hover,
html.dark .ui-tooltip-trigger:focus-visible {
    border-color: rgba(14, 165, 233, 0.4);
    background: rgba(12, 74, 110, 0.32);
    color: #bae6fd;
}

.ui-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(255, 255, 255, 0.68);
    color: #334155;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.ui-action-link:hover {
    border-color: rgba(14, 165, 233, 0.32);
    background: rgba(248, 250, 252, 0.96);
    color: #0f172a;
}

html.dark .ui-action-link {
    border-color: rgba(71, 85, 105, 0.8);
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
}

html.dark .ui-action-link:hover {
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
}

.menu-dropdown {
    position: relative;
}

.menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.78);
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.menu-trigger.is-open {
    color: #0f172a;
    border-color: rgba(14, 165, 233, 0.28);
    background: rgba(224, 242, 254, 0.92);
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.12);
}

html.dark .menu-trigger {
    border-color: rgba(51, 65, 85, 0.95);
    background: rgba(15, 23, 42, 0.82);
}

html.dark .menu-trigger.is-open {
    color: #e0f2fe;
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(12, 74, 110, 0.28);
}

.menu-panel {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
    width: max-content;
    max-width: min(90vw, 72rem);
}

.menu-panel[hidden] {
    display: none !important;
}

.menu-section-title {
    letter-spacing: 0.18em;
}

html.dark .menu-panel {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(51, 65, 85, 0.95);
    box-shadow: 0 18px 35px rgba(2, 6, 23, 0.36);
}

@media (max-width: 1279px) {
    .menu-panel {
        width: min(90vw, 42rem);
    }
}

dialog {
    color: inherit;
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
}

html.dark dialog::backdrop {
    background: rgba(2, 6, 23, 0.7);
}

.app-modal {
    width: min(100%, 42rem);
    margin: auto;
    padding: 0;
    border-radius: 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(59, 130, 246, 0.03)),
        rgba(255, 255, 255, 0.98);
    color: #0f172a;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
}

.app-modal-wide {
    width: min(100%, 72rem);
}

.app-modal-compact {
    width: min(100%, 56rem);
}

html.dark .app-modal {
    border-color: rgba(51, 65, 85, 0.95);
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(59, 130, 246, 0.05)),
        rgba(15, 23, 42, 0.98);
    color: #e2e8f0;
    box-shadow: 0 30px 60px rgba(2, 6, 23, 0.48);
}

.app-modal-header {
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(248, 250, 252, 0.78);
}

html.dark .app-modal-header {
    border-color: rgba(51, 65, 85, 0.95);
    background: rgba(2, 6, 23, 0.42);
}

.app-modal-body {
    background: transparent;
}

.app-modal-copy {
    color: #475569;
}

html.dark .app-modal-copy {
    color: #cbd5e1;
}

.availability-check-results {
    color: #0f172a;
}

.availability-check-summary {
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.availability-check-summary-ok {
    border-color: rgba(16, 185, 129, 0.22);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(209, 250, 229, 0.9));
    color: #065f46;
}

.availability-check-summary-warn {
    border-color: rgba(245, 158, 11, 0.24);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.9));
    color: #92400e;
}

.availability-check-message {
    color: inherit;
}

.availability-check-subcopy {
    color: rgba(15, 23, 42, 0.68);
}

.availability-check-stat {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.76);
}

.availability-check-stat-label,
.availability-check-metric-label {
    color: #64748b;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.availability-check-stat-value,
.availability-check-metric-value {
    margin-top: 0.35rem;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
}

.availability-check-lines {
    grid-template-columns: 1fr;
}

.availability-check-line-card {
    border-color: rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.availability-check-line-chip {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(241, 245, 249, 0.96);
    color: #475569;
}

.availability-check-item-name {
    color: #0f172a;
}

.availability-check-item-note,
.availability-check-muted {
    color: #64748b;
}

.availability-check-metric {
    border-color: rgba(226, 232, 240, 0.95);
    background: rgba(248, 250, 252, 0.92);
}

.availability-check-metric-emphasis-ok {
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(236, 253, 245, 0.92);
}

.availability-check-metric-emphasis-short {
    border-color: rgba(244, 63, 94, 0.2);
    background: rgba(255, 241, 242, 0.96);
}

.availability-check-status {
    border: 1px solid transparent;
}

.availability-check-status-ok {
    background: rgba(220, 252, 231, 0.92);
    border-color: rgba(16, 185, 129, 0.2);
    color: #047857;
}

.availability-check-status-short {
    background: rgba(255, 228, 230, 0.94);
    border-color: rgba(244, 63, 94, 0.2);
    color: #be123c;
}

.availability-check-shortage-note {
    color: #be123c;
}

html.dark .availability-check-results {
    color: #e2e8f0;
}

html.dark .availability-check-summary-ok {
    border-color: rgba(16, 185, 129, 0.24);
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.56), rgba(4, 120, 87, 0.28));
    color: #d1fae5;
}

html.dark .availability-check-summary-warn {
    border-color: rgba(245, 158, 11, 0.26);
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.58), rgba(146, 64, 14, 0.26));
    color: #fde68a;
}

html.dark .availability-check-subcopy {
    color: rgba(226, 232, 240, 0.74);
}

html.dark .availability-check-stat {
    border-color: rgba(51, 65, 85, 0.95);
    background: rgba(2, 6, 23, 0.42);
}

html.dark .availability-check-stat-label,
html.dark .availability-check-metric-label {
    color: #94a3b8;
}

html.dark .availability-check-stat-value,
html.dark .availability-check-metric-value,
html.dark .availability-check-item-name {
    color: #f8fafc;
}

html.dark .availability-check-line-card {
    border-color: rgba(51, 65, 85, 0.95);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.94));
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.34);
}

html.dark .availability-check-line-chip {
    border-color: rgba(51, 65, 85, 0.95);
    background: rgba(15, 23, 42, 0.92);
    color: #cbd5e1;
}

html.dark .availability-check-item-note,
html.dark .availability-check-muted {
    color: #94a3b8;
}

html.dark .availability-check-metric {
    border-color: rgba(51, 65, 85, 0.95);
    background: rgba(15, 23, 42, 0.78);
}

html.dark .availability-check-metric-emphasis-ok {
    border-color: rgba(16, 185, 129, 0.26);
    background: rgba(6, 78, 59, 0.28);
}

html.dark .availability-check-metric-emphasis-short {
    border-color: rgba(244, 63, 94, 0.26);
    background: rgba(127, 29, 29, 0.28);
}

html.dark .availability-check-status-ok {
    background: rgba(6, 78, 59, 0.44);
    border-color: rgba(16, 185, 129, 0.22);
    color: #a7f3d0;
}

html.dark .availability-check-status-short {
    background: rgba(127, 29, 29, 0.42);
    border-color: rgba(244, 63, 94, 0.2);
    color: #fecdd3;
}

html.dark .availability-check-shortage-note {
    color: #fda4af;
}
