:root {
    --kf-bg: #f8f8f5;
    --kf-surface: #ffffff;
    --kf-border: #e6e6e0;
    --kf-text: #1f1f1f;
    --kf-muted: #6b6b6b;
    --kf-shadow: 0 3px 0px rgba(15, 15, 15, 0.06);
    --kf-radius: 6px;
    --kf-radius-pill: 999px;
    --kf-primary: #5b5be0;
    --kf-hover: #eae8ff;
}

.theme-dark {
    --kf-bg: #111111;
    --kf-surface: #1b1b1f;
    --kf-border: rgba(255, 255, 255, 0.08);
    --kf-text: #f5f5ff;
    --kf-muted: #c3c4d6;
    --kf-shadow: 0 18px rgba(0, 0, 0, 0.45);
    --kf-primary: #7f7fff;
    --kf-hover: rgba(126, 126, 255, 0.18);
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--kf-bg);
    color: var(--kf-text);
    line-height: 1.6;
}

.text-white {
    color: var(--kf-text) !important;
}

.text-white-50 {
    color: var(--kf-muted) !important;
}

.auth-alert {
    display: flex;
    gap: 0.75rem;
    border-radius: var(--kf-radius);
    padding: 0.85rem 1rem;
    align-items: flex-start;
    border: 1px solid var(--kf-border);
    background: var(--kf-surface);
    box-shadow: var(--kf-shadow);
    position: relative;
}

.auth-alert-danger {
    border-color: rgba(220, 53, 69, 0.2);
    background: rgba(220, 53, 69, 0.08);
    color: #b0202f;
}

.auth-alert-success {
    border-color: rgba(25, 135, 84, 0.2);
    background: rgba(25, 135, 84, 0.08);
    color: #196c42;
}

.auth-alert__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--kf-radius-pill);
    background: rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.auth-alert-danger .auth-alert__icon {
    background: rgba(220, 53, 69, 0.15);
    color: #b0202f;
}

.auth-alert-success .auth-alert__icon {
    background: rgba(25, 135, 84, 0.2);
    color: #0f5f34;
}

.auth-alert__copy ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.auth-alert__close {
    border: none;
    background: transparent;
    color: inherit;
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
}

.auth-alert__close:hover {
    opacity: 1;
}

.error-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--kf-bg);
}

.error-card {
    max-width: 480px;
}

.error-brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--kf-text);
}

.error-card .code {
    font-size: 4rem;
    color: var(--kf-primary);
}

.form-label.required::after,
.label-required::after {
    content: ' *';
    color: #d9534f;
    font-weight: 600;
}

.browse-by-skills {
    padding: 1rem;
    margin: 20px 0;
    /* border-radius: 14px; */
}

.surface,
.glass-card {
    background: var(--kf-surface);
    border: 1px solid var(--kf-border);
    border-radius: 14px;
    box-shadow: var(--kf-shadow);
    color: var(--kf-text);
}

.surface-muted {
    background: #fdfdfc;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
}

.glass-card input,
.glass-card select,
.glass-card textarea,
.glass-card .form-check-label {
    color: var(--kf-text);
}

.glass-card input::placeholder,
.glass-card textarea::placeholder {
    color: var(--kf-muted);
}

.glass-card .form-control {
    background-color: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    padding: 0.65rem 0.85rem;
    color: var(--kf-text);
}

.kf-modal .form-control {
    background-color: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    padding: 0.65rem 0.85rem;
    color: var(--kf-text);
}

.theme-dark .glass-card .form-control {
    background-color: #18181f;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f5f5ff;
}

.theme-dark .kf-modal .form-control {
    background-color: #18181f;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f5f5ff;
}

.theme-dark .glass-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.theme-dark .kf-modal .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.glass-card .form-control:focus {
    border-color: var(--kf-primary);
    box-shadow: 0 0 0 2px rgba(91, 91, 224, 0.15);
    outline: none;
}

.kf-modal .form-control:focus {
    border-color: var(--kf-primary);
    box-shadow: 0 0 0 2px rgba(91, 91, 224, 0.15);
    outline: none;
}

.glass-button {
    border-radius: var(--kf-radius-pill);
    padding: 0.55rem 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    background: var(--kf-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--kf-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.glass-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(91, 91, 224, 0.25);
}

.theme-dark .glass-button {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.theme-dark .glass-button:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.65);
}

.btn-outline-neutral {
    border: 1px solid var(--kf-border);
    background: transparent;
    color: var(--kf-text);
    border-radius: var(--kf-radius);
    transition: color 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.btn-outline-neutral:hover {
    background: #f2f2ef;
}

.theme-dark .btn-outline-neutral {
    border-color: rgba(255, 255, 255, 0.25);
    color: #f5f5ff;
    background: rgba(255, 255, 255, 0.02);
}

.theme-dark .btn-outline-neutral:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-outline-light {
    border: 1px solid rgba(91, 91, 224, 0.3);
    background: transparent;
    color: var(--kf-primary);
    border-radius: var(--kf-radius-pill);
    padding: 0.45rem 1.25rem;
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.btn-outline-light:hover {
    background: rgba(91, 91, 224, 0.12);
    color: var(--kf-primary);
}

.theme-dark .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.35);
    color: #f5f5ff;
}

.theme-dark .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-check:checked+.btn-outline-neutral {
    background: #e0deff;
    border-color: #c7c2ff;
    color: #2f2a6f;
    box-shadow: none;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--kf-radius);
    border: 1px solid var(--kf-border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--kf-text);
    transition: background 0.15s ease;
}

.btn-icon:hover {
    background: #f2f2ef;
}

.glass-select,
.form-select,
select {
    background-color: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-pill);
    padding: 0.55rem 2.5rem 0.55rem 0.95rem;
    color: var(--kf-text);
    font-size: 0.95rem;
    appearance: none;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23505062' d='M1.41 0.59 6 5.17l4.59-4.58L12 1.59 6 7.59 0 1.59z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 0.9rem) 50%;
    background-size: 12px 8px;
}

.glass-select:focus,
.form-select:focus,
select:focus {
    border-color: var(--kf-primary);
    box-shadow: 0 0 0 2px rgba(91, 91, 224, 0.15);
    outline: none;
}

.theme-dark .glass-select,
.theme-dark .form-select,
.theme-dark select {
    background: #202026;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--kf-text);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23f5f5ff' d='M1.41 0.59 6 5.17l4.59-4.58L12 1.59 6 7.59 0 1.59z'/%3E%3C/svg%3E");
}

.theme-dark .glass-select option,
.theme-dark select option {
    background: #1b1b1f;
    color: #f2f2ff;
}

.theme-dark .glass-select:focus,
.theme-dark .form-select:focus,
.theme-dark select:focus {
    box-shadow: 0 0 0 2px rgba(127, 127, 255, 0.3);
}

select option {
    padding: 0.5rem 0.75rem;
    border-radius: var(--kf-radius);
}

.enhanced-select {
    position: relative;
    width: 100%;
}

.enhanced-select__trigger {
    width: 100%;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-pill);
    background: #fff;
    color: var(--kf-text);
    padding: 0.55rem 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.enhanced-select__trigger i {
    color: var(--kf-muted);
}

.enhanced-select__trigger:focus {
    outline: none;
    border-color: var(--kf-primary);
}

.enhanced-select__list {
    list-style: none;
    margin: 0;
    padding: 0.2rem 0.1rem;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1100;
}

.enhanced-select.open .enhanced-select__list {
    opacity: 1;
    pointer-events: auto;
}

.enhanced-select__option {
    padding: 0.5rem 0.65rem;
    border-radius: var(--kf-radius);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--kf-text);
}

.enhanced-select__option:hover,
.enhanced-select__option.is-active {
    background: var(--kf-hover);
}

.enhanced-select__option.is-selected {
    background: rgba(91, 91, 224, 0.12);
    color: var(--kf-primary);
    font-weight: 600;
}

.enhanced-select__hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.theme-dark .enhanced-select__trigger {
    background: #1f1f25;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f5f5ff;
}

.theme-dark .enhanced-select__list {
    background: #1f1f24;
    border-color: rgba(255, 255, 255, 0.12);
}

.theme-dark .enhanced-select__option {
    color: #f5f5ff;
}

.theme-dark .enhanced-select__option:hover,
.theme-dark .enhanced-select__option.is-active {
    background: rgba(127, 127, 255, 0.2);
}

.theme-dark .enhanced-select__option.is-selected {
    background: rgba(127, 127, 255, 0.25);
    color: #fff;
}

.select-field {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-pill);
    /* padding: 0.35rem 0.75rem 0.35rem 1.9rem; */
    padding: 0.9rem 0.75rem;
    background: #fff;
}

.select-field--compact {
    /* padding: 0.3rem 0.6rem 0.3rem 1.7rem; */
    padding: 0.3rem 10px;
    border-radius: var(--kf-radius-pill);
}

.select-field>i {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--kf-muted);
}

.select-field--compact>i {
    left: 0.55rem;
    font-size: 0.8rem;
}

.select-field:focus-within {
    border-color: var(--kf-border);
    box-shadow: none;
}

.select-field .enhanced-select {
    width: 100%;
}

.select-field .enhanced-select__trigger {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 1rem;
    color: var(--kf-text);
    width: 100%;
    text-align: left;
    gap: 0.25rem;
}

.select-field .enhanced-select__trigger span:first-child {
    flex: 1;
}

.status-select {
    min-width: 150px;
    padding: 0.25rem 0.75rem;
    border-radius: var(--kf-radius-pill);
    background: var(--kf-surface);
    border: 1px solid var(--kf-border);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 5;
}

.status-select .enhanced-select__trigger {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0;
    color: var(--kf-text);
}

.status-select .enhanced-select__list {
    width: 100%;
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 30;
    background: var(--kf-surface);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
}

.theme-dark .select-field {
    background: #1c1c22;
    border-color: rgba(255, 255, 255, 0.15);
}

.theme-dark .select-field>i {
    color: rgba(255, 255, 255, 0.65);
}

.theme-dark .select-field .enhanced-select__trigger {
    color: #f5f5ff;
}

.theme-dark .select-field:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.kf-select {
    position: relative;
    min-width: 180px;
    display: inline-flex;
}

.kf-select .glass-select {
    width: 100%;
    padding-right: 2.2rem;
    font-weight: 500;
    color: var(--kf-text);
}

.kf-select .kf-select-caret {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--kf-muted);
    display: inline-flex;
    align-items: center;
}

.theme-dark .kf-select .kf-select-caret {
    color: #c9ccff;
}

.theme-switcher {
    background: var(--kf-surface);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    margin: 5px;
    margin-bottom: 10px;
    gap: 0.35rem;
}

.theme-switcher .btn.theme-toggle {
    flex: 1;
    border: none;
    border-radius: var(--kf-radius);
    color: var(--kf-muted);
    background: transparent;
    font-weight: 500;
    padding: 0.45rem 0.6rem;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.theme-switcher .btn.theme-toggle:hover {
    background: var(--kf-hover);
}

.theme-switcher .btn.theme-toggle.active {
    background: #e0deff;
    color: var(--kf-primary);
    box-shadow: 0 0 0 1px rgba(91, 91, 224, 0.3);
}

.theme-dark .theme-switcher {
    background: #16161b;
    border-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .theme-switcher .btn.theme-toggle {
    color: var(--kf-muted);
}

.theme-dark .theme-switcher .btn.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.theme-dark .theme-switcher .btn.theme-toggle.active {
    background: rgba(127, 127, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(127, 127, 255, 0.4);
}

.table.surface-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--kf-text);
    --bs-table-border-color: var(--kf-border);
    --bs-table-hover-bg: rgba(0, 0, 0, 0.03);
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
    background: var(--kf-surface);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
}

.surface-table thead th {
    font-weight: 600;
    color: var(--kf-muted);
    border-bottom: 1px solid var(--kf-border);
    background: #fafafa;
}

.surface-table tbody td {
    border-color: var(--kf-border);
    color: var(--kf-text);
}

.surface-table tbody tr:hover {
    background: #f5f5f5;
}

.theme-dark .surface-table {
    --bs-table-bg: transparent;
    --bs-table-color: #f5f5ff;
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.08);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    background: #19191f;
}

.theme-dark .surface-table thead th {
    background: #202026;
    color: var(--kf-muted);
    border-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .surface-table tbody td {
    color: #f5f5ff;
    border-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .surface-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-dark .surface-table thead th {
    background: #22222b;
    color: var(--kf-muted);
}

.theme-dark .surface-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.theme-dark .surface,
.theme-dark .glass-card {
    border-color: var(--kf-border);
    /* border: 1px solid var(--kf-border); */
    box-shadow: 0 3px 0px rgba(55, 55, 55, 0.6);
}

/* Modal styling */
.modal-content.kf-modal {
    background: var(--kf-surface);
    border: 1px solid var(--kf-border);
    border-radius: calc(var(--kf-radius) + 2px);
    box-shadow: var(--kf-shadow);
    color: var(--kf-text);
}

.kf-modal .modal-header,
.kf-modal .modal-footer {
    border-color: var(--kf-border);
}

.kf-modal .modal-header h5 {
    font-weight: 600;
    margin-bottom: 0;
}

.kf-modal dl {
    margin-bottom: 0;
}

.kf-modal dl dt {
    font-weight: 600;
    color: var(--kf-muted);
}

.kf-modal dl dd {
    margin-bottom: 0.5rem;
}

.theme-dark .modal-content.kf-modal {
    background: #1b1b1f;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.theme-dark .kf-modal .modal-header,
.theme-dark .kf-modal .modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .kf-modal dl dt {
    color: #c9ccff;
}

.theme-dark .kf-modal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.theme-dark .kf-modal .btn-close:hover {
    opacity: 1;
}
