/* Solid color tokens. Use var(--primary). Alpha: color-mix(in srgb, var(--primary) 10%, transparent). */
:root {
    --background: #ffffff;
    --foreground: #17202c;
    --card: #ffffff;
    --card-foreground: #17202c;
    --popover: #ffffff;
    --popover-foreground: #17202c;
    --primary: #bf813b;
    --primary-foreground: #ffffff;
    --secondary: #f5f5f5;
    --secondary-foreground: #1a1a1a;
    --muted: #f5f5f5;
    --muted-foreground: #4c5776;
    --accent: #f5f5f5;
    --accent-foreground: #17202c;
    --destructive: #ef4343;
    --destructive-foreground: #ffffff;
    --border: #eeeaeb;
    --input: #e4e4e7;
    --ring: #bf813b;
    --success: #298e5f;
    --warning: #f59f0a;
    --info: #2463eb;
    --radius: 0.5rem;
    --table-header: #fcfcfc;
    --gradient-primary: linear-gradient(90deg, #000000 0%, #0d1322 100%);
    --text-xs: 0.75rem;
    --text-xs--line-height: calc(1 / 0.75);
    --text-sm: 0.875rem;
    --text-sm--line-height: calc(1.25 / 0.875);
    --text-base: 1rem;
    --text-base--line-height: calc(1.5 / 1);
    --text-lg: 1.125rem;
    --text-lg--line-height: calc(1.75 / 1.125);
    --text-xl: 1.25rem;
    --text-xl--line-height: calc(1.75 / 1.25);
    --text-2xl: 1.5rem;
    --text-2xl--line-height: calc(2 / 1.5);
    --text-3xl: 1.875rem;
    --text-3xl--line-height: calc(2.25 / 1.875);
    --text-4xl: 2.25rem;
    --text-4xl--line-height: calc(2.5 / 2.25);
}

body.dark-theme {
    --background: #26282b;
    --foreground: #f1f0ee;
    --card: #29292e;
    --card-foreground: #f1f0ee;
    --popover: #29292e;
    --popover-foreground: #f1f0ee;
    --primary: #dab681;
    --primary-foreground: #221f1c;
    --secondary: #35353b;
    --secondary-foreground: #f1f0ee;
    --muted: #35353b;
    --muted-foreground: #bcb9b3;
    --accent: #3a3a40;
    --accent-foreground: #f1f0ee;
    --destructive: #e25050;
    --destructive-foreground: #ffffff;
    --border: #43464c;
    --input: #43464c;
    --ring: #dab681;
    --success: #59c090;
    --warning: #ecb351;
    --info: #7d9fe8;
    --table-header: #222226;
}

body.theme-blue {
    --primary: #2463eb;
    --primary-foreground: #ffffff;
    --ring: #2463eb;
}

body.theme-blue.dark-theme {
    --primary: #7d9fe8;
    --primary-foreground: #17202c;
    --ring: #7d9fe8;
}

body.theme-emerald {
    --primary: #0f766e;
    --primary-foreground: #ffffff;
    --ring: #0f766e;
}

body.theme-emerald.dark-theme {
    --primary: #5eead4;
    --primary-foreground: #17202c;
    --ring: #5eead4;
}

body.theme-violet {
    --primary: #6d28d9;
    --primary-foreground: #ffffff;
    --ring: #6d28d9;
}

body.theme-violet.dark-theme {
    --primary: #c4b5fd;
    --primary-foreground: #17202c;
    --ring: #c4b5fd;
}

body.theme-rose {
    --primary: #be123c;
    --primary-foreground: #ffffff;
    --ring: #be123c;
}

body.theme-rose.dark-theme {
    --primary: #fda4af;
    --primary-foreground: #17202c;
    --ring: #fda4af;
}

.tyne-theme-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tyne-theme-option {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
    color: var(--card-foreground);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tyne-theme-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.tyne-theme-option:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--foreground) 6%, transparent);
}

.tyne-theme-option:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 10px 28px color-mix(in srgb, var(--primary) 16%, transparent);
}

.tyne-theme-option:has(input:focus-visible) {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.tyne-theme-preview {
    position: relative;
    display: block;
    min-height: 132px;
    padding: 16px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--theme-swatch) 28%, transparent), transparent 42%),
        linear-gradient(160deg, color-mix(in srgb, var(--theme-swatch) 18%, var(--muted)) 0%, var(--muted) 100%);
}

.tyne-theme-preview-chrome {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: calc(var(--radius) - 2px);
    background: color-mix(in srgb, var(--card) 88%, transparent);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--foreground) 8%, transparent);
}

.tyne-theme-preview-bar {
    display: block;
    width: 42%;
    height: 8px;
    border-radius: 999px;
    background: var(--theme-swatch);
}

.tyne-theme-preview-panel {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-end;
}

.tyne-theme-preview-line {
    display: block;
    width: 78%;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted-foreground) 28%, transparent);
}

.tyne-theme-preview-line.is-short {
    width: 54%;
}

.tyne-theme-preview-cta {
    display: block;
    width: 44%;
    height: 18px;
    margin-top: 2px;
    border-radius: calc(var(--radius) - 4px);
    background: var(--theme-swatch);
}

.tyne-theme-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--border);
    background: var(--card);
}

.tyne-theme-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tyne-theme-name {
    min-width: 0;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.tyne-theme-desc {
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.tyne-theme-switch {
    flex-shrink: 0;
    pointer-events: none;
}

.tyne-theme-switch .tyne-switch-ui {
    display: block;
    width: 42px;
    height: 24px;
    border: 1px solid color-mix(in srgb, var(--muted-foreground) 45%, var(--border));
    background: color-mix(in srgb, var(--muted-foreground) 22%, var(--muted));
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--foreground) 12%, transparent);
}

.tyne-theme-switch .tyne-switch-ui::after {
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 1px solid color-mix(in srgb, var(--muted-foreground) 20%, transparent);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--foreground) 28%, transparent);
}

.tyne-theme-option:has(input:checked) .tyne-theme-switch .tyne-switch-ui {
    border-color: var(--theme-swatch);
    background: var(--theme-swatch);
    box-shadow: none;
}

.tyne-theme-option:has(input:checked) .tyne-theme-switch .tyne-switch-ui::after {
    transform: translateX(18px);
    border-color: transparent;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--foreground) 22%, transparent);
}

.tyne-theme-footer {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.text-xs {
    font-size: var(--text-xs);
    line-height: var(--text-xs--line-height);
}

.text-sm {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
}

.text-base {
    font-size: var(--text-base);
    line-height: var(--text-base--line-height);
}

.text-lg {
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
}

.text-xl {
    font-size: var(--text-xl);
    line-height: var(--text-xl--line-height);
}

.text-2xl {
    font-size: var(--text-2xl);
    line-height: var(--text-2xl--line-height);
}

.text-3xl {
    font-size: var(--text-3xl);
    line-height: var(--text-3xl--line-height);
}

.text-4xl {
    font-size: var(--text-4xl);
    line-height: var(--text-4xl--line-height);
}

.font-thin { font-weight: 100; }
.font-extralight { font-weight: 200; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

.text-fg { color: var(--foreground); }
.text-muted-fg { color: var(--muted-foreground); }
.min-w-0 { min-width: 0; }

.tyne-card-title {
    margin: 0 0 16px;
    color: var(--foreground);
    font-size: 16px;
    font-weight: 600;
}

.tyne-field {
    margin-bottom: 12px;
}

.tyne-editor .tyne-editor-input {
    display: none;
}

.tyne-editor .note-editor.note-frame {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--background);
    color: var(--foreground);
    box-shadow: none;
}

.tyne-editor .note-editor.note-frame .note-toolbar {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    background: var(--muted);
}

.tyne-editor .note-editor.note-frame .note-editing-area,
.tyne-editor .note-editor.note-frame .note-editable,
.tyne-editor .note-editor.note-frame .note-statusbar {
    background: var(--background);
    color: var(--foreground);
}

.tyne-editor .note-editor.note-frame .note-editable {
    min-height: 120px;
    padding: 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

.tyne-editor .note-editor.note-frame .note-editable:focus {
    outline: none;
    box-shadow: none;
}

.tyne-editor .note-editor.note-frame .note-placeholder {
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 400;
}

.tyne-editor .note-editor.note-frame .note-btn-group .note-btn {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background: var(--card);
    color: var(--foreground);
    box-shadow: none;
}

.tyne-editor .note-editor.note-frame .note-btn-group .note-btn:hover,
.tyne-editor .note-editor.note-frame .note-btn-group .note-btn:focus,
.tyne-editor .note-editor.note-frame .note-btn-group .note-btn.active {
    border-color: var(--ring);
    background: var(--accent);
    color: var(--accent-foreground);
    box-shadow: none;
}

.tyne-editor .note-editor.note-frame .note-btn-group .note-btn i,
.tyne-editor .note-editor.note-frame .note-btn-group .note-btn .note-icon-caret {
    color: inherit;
}

.tyne-editor .note-editor.note-frame .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--popover);
    color: var(--popover-foreground);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--foreground) 10%, transparent);
}

.tyne-editor .note-editor.note-frame .note-statusbar {
    border-top: 1px solid var(--border);
}

.tyne-editor.is-invalid .note-editor.note-frame {
    border-color: var(--destructive);
    box-shadow: 0 0 0 0.6px var(--destructive);
}

.tyne-editor.is-disabled .note-editor.note-frame {
    opacity: 0.55;
    pointer-events: none;
}

body.dark-theme .tyne-editor .note-editor.note-frame .note-toolbar {
    background: var(--secondary);
}

.tyne-label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
}

.tyne-required {
    margin-left: 4px;
    color: var(--destructive);
}

.form-control.tyne-input,
.form-select.tyne-select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background-color: var(--background);
    box-shadow: none !important;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 400;
    line-height: 40px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.form-control.tyne-input {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.5;
    resize: none;
}

.form-control.tyne-input::placeholder {
    color: var(--muted-foreground);
    font-weight: 400;
}

.form-control.tyne-input:hover,
.form-select.tyne-select:hover,
.form-control.tyne-input:focus,
.form-control.tyne-input:focus-visible,
.form-select.tyne-select:focus,
.form-select.tyne-select:focus-visible {
    border-color: var(--ring) !important;
    outline: none !important;
    box-shadow: 0 0 0 0.6px var(--ring) !important;
}

.form-control.tyne-input.is-invalid,
.form-select.tyne-select.is-invalid,
.form-control.tyne-input.is-invalid:hover,
.form-control.tyne-input.is-invalid:focus,
.form-control.tyne-input.is-invalid:focus-visible,
.form-select.tyne-select.is-invalid:hover,
.form-select.tyne-select.is-invalid:focus,
.form-select.tyne-select.is-invalid:focus-visible {
    border-color: var(--destructive) !important;
    box-shadow: 0 0 0 0.6px var(--destructive) !important;
}

.form-control.tyne-input:disabled,
.form-select.tyne-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-control.tyne-input.tyne-control-sm,
.form-select.tyne-select.tyne-control-sm {
    height: 36px;
    font-size: 13px;
    line-height: 34px;
}

.form-control.tyne-input.tyne-control-md,
.form-select.tyne-select.tyne-control-md {
    height: 40px;
    line-height: 38px;
}

textarea.form-control.tyne-input.tyne-control-sm,
textarea.form-control.tyne-input.tyne-control-md {
    height: auto;
    min-height: 96px;
    line-height: 1.5;
}

input[type="file"].form-control.tyne-input.tyne-control-sm {
    line-height: 34px;
}

input[type="file"].form-control.tyne-input.tyne-control-sm::file-selector-button {
    height: 24px;
}

/* Same box as the text inputs: 40px, same border and radius. Hostio's trigger is h-10. */
.nice-select.tyne-select {
    float: none;
    height: 40px !important;
    padding: 0 32px 0 12px !important;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background-color: var(--background) !important;
    box-shadow: none !important;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 400;
    line-height: 38px !important;
}

.nice-select.tyne-select.tyne-control-sm {
    height: 36px !important;
    font-size: 13px;
    line-height: 34px !important;
}

.nice-select.tyne-select.tyne-control-md {
    height: 40px !important;
    line-height: 38px !important;
}

.nice-select.tyne-select .current {
    color: var(--foreground);
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
}

.nice-select.tyne-select.tyne-control-sm .current {
    font-size: 13px;
}

.nice-select.tyne-select:hover,
.nice-select.tyne-select:focus,
.nice-select.tyne-select.open {
    border-color: var(--ring) !important;
    outline: none !important;
    box-shadow: 0 0 0 0.6px var(--ring) !important;
}

.nice-select.tyne-select.is-invalid,
.nice-select.tyne-select.is-invalid:hover,
.nice-select.tyne-select.is-invalid:focus,
.nice-select.tyne-select.is-invalid.open {
    border-color: var(--destructive) !important;
    box-shadow: 0 0 0 0.6px var(--destructive) !important;
}

.nice-select.tyne-select.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nice-select.tyne-select:after,
.nice-select.tyne-select.open:after {
    content: "";
    top: 50%;
    right: 14px;
    width: 6px;
    height: 6px;
    margin-top: 0;
    border: 0;
    border-right: 1.5px solid var(--muted-foreground);
    border-bottom: 1.5px solid var(--muted-foreground);
    font-family: inherit;
    font-size: 0;
    font-weight: 400;
    transform: translateY(-50%) rotate(45deg);
}

.nice-select.tyne-select.open:after {
    transform: translateY(-50%) rotate(225deg);
}

.nice-select.tyne-select .nice-select-search-box {
    display: none;
}

.nice-select.tyne-select .list {
    margin-top: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--popover);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow-y:auto ;
}

.nice-select.tyne-select .list li {
    min-height: 32px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-transform: none;
}

.nice-select.tyne-select .list li:last-child {
    margin-bottom: 0;
}

.nice-select.tyne-select .option:hover,
.nice-select.tyne-select .option.focus,
.nice-select.tyne-select .option.selected,
.nice-select.tyne-select .option.selected.focus {
    background: var(--accent);
    color: var(--foreground);
}

.nice-select.tyne-select.tyne-dropdown-portal {
    position: fixed !important;
    z-index: 1060 !important;
    float: none !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: default !important;
}

.nice-select.tyne-select.tyne-dropdown-portal::after {
    display: none !important;
}

.nice-select.tyne-select.tyne-dropdown-portal .list {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    transition: none !important;
}

input[type="file"].form-control.tyne-input {
    line-height: 38px;
    padding-top: 0;
    padding-bottom: 0;
}

input[type="file"].form-control.tyne-input::file-selector-button {
    height: 28px;
    margin-right: 12px;
    padding: 0 10px;
    border: 0;
    border-radius: calc(var(--radius) - 4px);
    background: transparent;
    color: var(--foreground);
    font-size: 13px;
    font-weight: 500;
}

.tyne-error {
    margin-top: 4px;
    color: var(--destructive);
    font-size: 12px;
    line-height: 1.3;
}

.tyne-hint {
    margin-top: 4px;
    color: var(--muted-foreground);
    font-size: 12px;
}

.tyne-drop {
    position: relative;
}

.tyne-drop-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.tyne-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 116px;
    padding: 20px 16px;
    border: 1px dashed var(--input);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    text-align: center;
}

.tyne-drop-zone:focus-within {
    border-color: var(--ring);
    box-shadow: 0 0 0 0.6px var(--ring);
}

.tyne-drop--invalid .tyne-drop-zone,
.tyne-drop--invalid .tyne-drop-zone:focus-within {
    border-color: var(--destructive);
    box-shadow: 0 0 0 0.6px var(--destructive);
}

.tyne-drop--over .tyne-drop-zone {
    border-color: var(--primary);
    background: var(--accent);
    box-shadow: none;
}

.tyne-drop--over [data-tyne-drop-browse] {
    display: none;
}

.tyne-drop--disabled {
    opacity: 0.5;
    pointer-events: none;
}

.tyne-drop-caption {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 1.3;
}

.tyne-drop-caption::before {
    content: attr(data-rest);
}

.tyne-drop--over .tyne-drop-caption {
    color: var(--foreground);
    font-weight: 500;
}

.tyne-drop--over .tyne-drop-caption::before {
    content: attr(data-over);
}

.tyne-drop-file {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--background);
}

.tyne-drop-thumb {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    background: var(--accent);
    color: var(--muted-foreground);
}

.tyne-drop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tyne-drop-meta {
    min-width: 0;
    flex: 1;
}

.tyne-drop-name {
    display: block;
    overflow: hidden;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tyne-drop-size {
    display: block;
    margin-top: 2px;
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 1.3;
}

.tyne-drop-remove {
    flex: 0 0 auto;
}

.tyne-drop-zone[hidden],
.tyne-drop-preview[hidden],
.tyne-drop-reject[hidden] {
    display: none;
}

.tyne-drop-preview {
    position: relative;
    overflow: hidden;
    border: 1px dashed var(--input);
    border-radius: var(--radius);
    background: var(--muted);
}

.tyne-drop-preview img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.tyne-drop-preview .tyne-drop-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid var(--border);
    background: var(--background);
}

/* Inline file dropzone (40px height to align with standard text inputs) */
.tyne-drop--inline {
    width: 100%;
}

.tyne-drop--inline .tyne-drop-zone {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 40px;
    min-height: 40px;
    padding: 0 4px 0 12px;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 2px);
    background: var(--background);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.tyne-drop--inline .tyne-drop-zone:hover {
    border-color: var(--ring);
}

.tyne-drop--inline .tyne-drop-zone:focus-within {
    border-color: var(--ring);
    box-shadow: 0 0 0 0.6px var(--ring);
}

.tyne-drop--inline.tyne-drop--invalid .tyne-drop-zone {
    border-color: var(--destructive);
    box-shadow: 0 0 0 0.6px var(--destructive);
}

.tyne-drop--inline.tyne-drop--over .tyne-drop-zone {
    border-color: var(--primary);
    background: var(--accent);
    box-shadow: none;
}

.tyne-drop--inline .tyne-drop-inline-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.tyne-drop--inline .tyne-drop-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.tyne-drop--inline .tyne-drop-caption {
    margin: 0;
    font-size: 13px;
    color: var(--muted-foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tyne-drop--inline .tyne-drop-browse-btn {
    flex-shrink: 0;
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
}

.tyne-drop--inline .tyne-drop-preview {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 40px;
    min-height: 40px;
    padding: 0 4px 0 8px;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 2px);
    background: var(--background);
}

.tyne-drop--inline .tyne-drop-preview-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.tyne-drop--inline .tyne-drop-thumb {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--muted);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.tyne-drop--inline .tyne-drop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tyne-drop--inline .tyne-drop-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.tyne-drop--inline .tyne-drop-preview .tyne-drop-remove {
    position: static;
    border: 0;
    background: transparent;
    padding: 4px;
    height: 28px;
    width: 28px;
    color: var(--muted-foreground);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    cursor: pointer;
}

.tyne-drop--inline .tyne-drop-preview .tyne-drop-remove:hover {
    background: var(--accent);
    color: var(--destructive);
}

.tyne-drop--inline .tyne-drop-zone[hidden],
.tyne-drop--inline .tyne-drop-preview[hidden] {
    display: none !important;
}

.tyne-input-wrap {
    position: relative;
}

.tyne-input-wrap .tyne-input {
    padding-right: 40px;
}

.tyne-input-icon {
    position: absolute;
    top: 50%;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none !important;
    border-radius: 999px;
    background: transparent;
    color: var(--primary);
    transform: translateY(-50%);
    cursor: pointer;
}

.tyne-input-icon:hover {
    background: var(--accent);
}

/* Daterangepicker, skinned with the Tyne field tokens. */
.daterangepicker {
    width: auto;
    margin-top: 4px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--popover);
    color: var(--popover-foreground);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.daterangepicker:before,
.daterangepicker:after {
    display: none;
}

.daterangepicker .calendar-table {
    border-color: transparent;
    background: var(--popover);
}

.daterangepicker .calendar-table th,
.daterangepicker .calendar-table td {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: calc(var(--radius) - 4px);
    color: var(--foreground);
    font-size: 13px;
    line-height: 32px;
}

.daterangepicker th.month {
    color: var(--foreground);
    font-size: 14px;
    font-weight: 600;
}

.daterangepicker .calendar-table .next span,
.daterangepicker .calendar-table .prev span {
    border-color: var(--foreground);
}

.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
    background: var(--accent);
    color: var(--foreground);
}

.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
    background: transparent;
    color: var(--muted-foreground);
}

.daterangepicker td.in-range {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--foreground);
    border-radius: 0;
}

.daterangepicker td.active,
.daterangepicker td.active:hover,
.daterangepicker td.start-date,
.daterangepicker td.end-date,
.daterangepicker td.start-date.end-date {
    background: var(--primary);
    color: var(--primary-foreground);
}

.daterangepicker td.start-date {
    border-radius: calc(var(--radius) - 4px) 0 0 calc(var(--radius) - 4px);
}

.daterangepicker td.end-date {
    border-radius: 0 calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0;
}

.daterangepicker td.start-date.end-date {
    border-radius: calc(var(--radius) - 4px);
}

.daterangepicker .drp-buttons {
    border-top-color: var(--border);
}

.daterangepicker .drp-selected {
    color: var(--muted-foreground);
    font-size: 12px;
}

.daterangepicker .drp-buttons .btn {
    height: 32px;
    margin-left: 6px;
    padding: 0 12px;
    border-radius: calc(var(--radius) - 2px);
    font-size: 13px;
    font-weight: 500;
    line-height: 30px;
    box-shadow: none;
}

.daterangepicker .drp-buttons .applyBtn {
    border: 0;
    background: var(--primary);
    color: var(--primary-foreground);
}

.daterangepicker .drp-buttons .cancelBtn {
    border: 1px solid var(--input);
    background: var(--background);
    color: var(--foreground);
}

.daterangepicker select.hourselect,
.daterangepicker select.minuteselect,
.daterangepicker select.secondselect,
.daterangepicker select.ampmselect {
    height: 32px;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 4px);
    background: var(--background);
    color: var(--foreground);
    font-size: 13px;
}

.daterangepicker .ranges li:hover {
    background: var(--accent);
    color: var(--foreground);
}

.daterangepicker .ranges li.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.tyne-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

input.form-check-input.tyne-check-input,
.table input[type="checkbox"],
.table input[type="radio"],
.tynetable input[type="checkbox"],
.tynetable input[type="radio"],
.table-basic input[type="checkbox"],
.table-basic input[type="radio"],
.table-content input[type="checkbox"],
.table-content input[type="radio"],
.table-responsive input[type="checkbox"],
.table-responsive input[type="radio"],
.role-table input[type="checkbox"],
.role-table input[type="radio"],
.input-check-radio input[type="checkbox"],
.input-check-radio input[type="radio"],
.input-check-radio .form-check .form-check-input,
.table-content.table-basic .table .check-box .form-check-input,
.tyne-check-input {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 0 !important;
    border: 1px solid var(--primary) !important;
    border-radius: calc(var(--radius) - 4px) !important;
    background-color: var(--background) !important;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--foreground) 5%, transparent);
    cursor: pointer;
    vertical-align: middle;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    display: inline-block;
}

input.form-check-input.tyne-check-input[type="radio"],
.table input[type="radio"],
.tynetable input[type="radio"],
.table-basic input[type="radio"],
.table-content input[type="radio"],
.table-responsive input[type="radio"],
.role-table input[type="radio"],
.input-check-radio input[type="radio"],
.input-check-radio .form-check .form-check-input[type="radio"],
.tyne-check-input[type="radio"] {
    border-radius: 50% !important;
}

input.form-check-input.tyne-check-input:checked,
.table input[type="checkbox"]:checked,
.tynetable input[type="checkbox"]:checked,
.table-basic input[type="checkbox"]:checked,
.table-content input[type="checkbox"]:checked,
.table-responsive input[type="checkbox"]:checked,
.role-table input[type="checkbox"]:checked,
.input-check-radio input[type="checkbox"]:checked,
.input-check-radio .form-check .form-check-input:checked:not([type="radio"]),
.table-content.table-basic .table .check-box .form-check-input:checked,
.tyne-check-input:checked {
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 14px !important;
}

input.form-check-input.tyne-check-input[type="checkbox"]:indeterminate,
.table input[type="checkbox"]:indeterminate,
.tynetable input[type="checkbox"]:indeterminate,
.table-basic input[type="checkbox"]:indeterminate,
.table-content input[type="checkbox"]:indeterminate,
.table-responsive input[type="checkbox"]:indeterminate,
.role-table input[type="checkbox"]:indeterminate,
.input-check-radio input[type="checkbox"]:indeterminate,
.input-check-radio .form-check .form-check-input[type="checkbox"]:indeterminate,
.tyne-check-input[type="checkbox"]:indeterminate {
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M5 10h10'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 14px !important;
}

input.form-check-input.tyne-check-input[type="radio"]:checked,
.table input[type="radio"]:checked,
.tynetable input[type="radio"]:checked,
.table-basic input[type="radio"]:checked,
.table-content input[type="radio"]:checked,
.table-responsive input[type="radio"]:checked,
.role-table input[type="radio"]:checked,
.input-check-radio input[type="radio"]:checked,
.input-check-radio .form-check .form-check-input[type="radio"]:checked,
.tyne-check-input[type="radio"]:checked {
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e") !important;
    background-size: 100% !important;
}

.tyne-check-input:focus,
.table input[type="checkbox"]:focus,
.table input[type="radio"]:focus,
.tynetable input[type="checkbox"]:focus,
.tynetable input[type="radio"]:focus,
.table-basic input[type="checkbox"]:focus,
.table-basic input[type="radio"]:focus,
.table-content input[type="checkbox"]:focus,
.table-content input[type="radio"]:focus,
.table-responsive input[type="checkbox"]:focus,
.table-responsive input[type="radio"]:focus,
.input-check-radio input[type="checkbox"]:focus,
.input-check-radio input[type="radio"]:focus {
    border-color: var(--ring) !important;
    box-shadow: 0 0 0 1px var(--ring) !important;
    outline: none !important;
}

.tyne-check-input:disabled,
.tyne-check:has(.tyne-check-input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.tyne-check-label {
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
}

.tyne-choice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tyne-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.tyne-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.tyne-switch input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.tyne-switch-ui {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--input);
    transition: background 0.2s ease;
}

.tyne-switch-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--background);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--foreground) 20%, transparent);
    transition: transform 0.2s ease;
}

.tyne-switch input:checked + .tyne-switch-ui {
    background: var(--primary);
}

.tyne-switch input:checked + .tyne-switch-ui::after {
    transform: translateX(16px);
}

.tyne-switch input:disabled + .tyne-switch-ui,
.tyne-switch:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.tyne-switch input:focus-visible + .tyne-switch-ui {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.tyne-switch-label {
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
}

.tyne-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 8px 16px;
    border: 1px solid transparent !important;
    border-radius: var(--radius) !important;
    background: var(--primary);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--foreground) 6%, transparent);
    color: var(--primary-foreground) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.tyne-btn:hover {
    background: color-mix(in srgb, var(--primary) 90%, transparent);
    color: var(--primary-foreground) !important;
}

.tyne-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 1px var(--ring);
}

.tyne-btn:disabled,
.tyne-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.tyne-btn i {
    font-size: 16px;
    line-height: 1;
}

.tyne-btn-destructive {
    border-color: color-mix(in srgb, var(--destructive) 10%, transparent) !important;
    background: color-mix(in srgb, var(--destructive) 10%, transparent);
    box-shadow: none;
    color: var(--destructive) !important;
    font-weight: 500;
}

.tyne-btn-destructive:hover {
    background: color-mix(in srgb, var(--destructive) 15%, transparent);
    color: var(--destructive) !important;
}

.tyne-btn-outline {
    border-color: var(--input) !important;
    background: var(--background);
    box-shadow: none;
    color: var(--foreground) !important;
    font-weight: 500;
}

.tyne-btn-outline:hover {
    border-color: var(--primary) !important;
    background: var(--accent);
    color: var(--foreground) !important;
}

.tyne-btn-secondary {
    background: var(--secondary);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--foreground) 5%, transparent);
    color: var(--secondary-foreground) !important;
    font-weight: 500;
}

.tyne-btn-secondary:hover {
    background: color-mix(in srgb, var(--secondary) 80%, transparent);
    color: var(--secondary-foreground) !important;
}

.tyne-btn-ghost {
    background: transparent;
    box-shadow: none;
    color: var(--foreground) !important;
    font-weight: 500;
}

.tyne-btn-ghost:hover {
    background: var(--accent);
    color: var(--accent-foreground) !important;
}

.tyne-btn-link {
    height: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: var(--primary) !important;
    font-weight: 500;
    text-decoration: underline !important;
    text-underline-offset: 4px;
}

.tyne-btn-link:hover {
    background: transparent;
    color: var(--primary) !important;
}

.tyne-btn-gradient {
    background: var(--gradient-primary);
    box-shadow: 0 10px 15px -3px color-mix(in srgb, var(--foreground) 10%, transparent);
    color: var(--primary-foreground) !important;
}

.tyne-btn-gradient:hover {
    background: var(--gradient-primary);
    box-shadow: 0 20px 25px -5px color-mix(in srgb, var(--foreground) 12%, transparent);
    color: var(--primary-foreground) !important;
}

.tyne-btn-sm {
    height: 32px;
    padding: 0 10px;
    border-radius: calc(var(--radius) - 2px) !important;
    font-size: 13px;
    font-weight: 500;
}

.tyne-btn-md {
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
}

.tyne-btn-lg {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
}

.tyne-btn-xl {
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
}

.tyne-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.tyne-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

body.dark-theme .form-select.tyne-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f5f5f4' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.tyne-icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -0.125em;
    color: currentColor;
}

.tyne-icon-search {
    max-width: 320px;
}

.tyne-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 12px;
}

.tyne-icon-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 104px;
    padding: 14px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    cursor: pointer;
}

.tyne-icon-tile:hover {
    border-color: var(--ring);
    color: var(--primary);
}

.tyne-icon-tile span {
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    word-break: break-word;
}

.tyne-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.tyne-badge-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.tyne-badge-outline {
    border-color: var(--border);
    background: transparent;
    color: var(--foreground);
}

.tyne-badge-destructive {
    background: color-mix(in srgb, var(--destructive) 12%, transparent);
    color: var(--destructive);
}

.tyne-badge-success {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.tyne-badge-warning {
    background: color-mix(in srgb, var(--warning) 16%, transparent);
    color: var(--warning);
}

.tyne-alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
}

.tyne-alert strong {
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
}

.tyne-alert p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 13px;
}

.tyne-alert-destructive {
    border-color: color-mix(in srgb, var(--destructive) 30%, transparent);
    background: color-mix(in srgb, var(--destructive) 8%, transparent);
}

.tyne-alert-success {
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
    background: color-mix(in srgb, var(--success) 8%, transparent);
}

.tyne-alert-warning {
    border-color: color-mix(in srgb, var(--warning) 35%, transparent);
    background: color-mix(in srgb, var(--warning) 10%, transparent);
}

.tyne-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--accent);
    color: var(--foreground);
    font-size: 13px;
    font-weight: 600;
}

.tyne-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.tyne-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.tyne-avatar-xl {
    width: 104px;
    height: 104px;
    font-size: 28px;
}

.tyne-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.tyne-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 32px 16px;
    color: var(--muted-foreground);
    text-align: center;
}

.tyne-empty h3 {
    margin: 4px 0 0;
    color: var(--foreground);
    font-size: 16px;
}

.tyne-empty p {
    margin: 0;
    font-size: 13px;
}

.tyne-surface {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
    color: var(--card-foreground);
}

.tyne-surface-header,
.tyne-surface-body,
.tyne-surface-footer {
    padding: 16px 18px;
}

.tyne-surface-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.tyne-surface-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.tyne-surface-header p {
    margin: 4px 0 0;
    color: var(--muted-foreground);
    font-size: 13px;
}

.tyne-surface-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border);
}

.tyne-card {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--card);
    color: var(--card-foreground);
}

.tyne-card-primary {
    border-radius: 8px;
}

.tyne-card-primary .tyne-card-header {
    border-bottom: 1px solid var(--border);
}

/* Skin only — keep Bootstrap modal show/hide/display lifecycle intact */
.tyne-modal .modal-dialog {
    margin-left: auto;
    margin-right: auto;
}

.tyne-modal-content {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--card-foreground);
    box-shadow: 0 20px 50px color-mix(in srgb, var(--foreground) 16%, transparent);
}

.tyne-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.tyne-modal-heading {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding-right: 8px;
}

.tyne-modal-title {
    margin: 0;
    color: var(--foreground);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.tyne-modal-description {
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

.tyne-modal-close {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--background);
    color: var(--muted-foreground);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tyne-modal-close:hover {
    border-color: var(--ring);
    background: var(--accent);
    color: var(--foreground);
}

.tyne-modal-close i {
    line-height: 1;
}

.tyne-modal-body {
    padding: 20px;
    background: var(--card);
    color: var(--card-foreground);
}

.tyne-modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--muted) 55%, var(--card));
}

body.dark-theme .tyne-modal-content {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Tyne SweetAlert — Metronic-style confirm / feedback dialogs */
.tyne-swal-container.swal2-backdrop-show,
.tyne-swal-backdrop-show {
    background: color-mix(in srgb, var(--foreground) 42%, transparent) !important;
}

body.swal2-toast-shown .tyne-swal-container.swal2-backdrop-show {
    background: transparent !important;
    pointer-events: none;
}

.tyne-swal.swal2-popup {
    width: min(100%, 420px);
    padding: 28px 24px 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    color: var(--card-foreground);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--foreground) 3%, transparent),
        0 18px 48px color-mix(in srgb, var(--foreground) 18%, transparent);
}

.tyne-swal.swal2-popup.tyne-swal-toast {
    width: auto;
    min-width: 280px;
    max-width: min(100%, 360px);
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 12px 32px color-mix(in srgb, var(--foreground) 14%, transparent);
}

.tyne-swal-show {
    animation: tyne-swal-in 0.22s ease-out;
}

.tyne-swal-hide {
    animation: tyne-swal-out 0.16s ease-in forwards;
}

@keyframes tyne-swal-in {
    from {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes tyne-swal-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.97);
    }
}

.tyne-swal .tyne-swal-icon.swal2-icon {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border: 0 !important;
    border-radius: 16px;
    background: transparent !important;
    color: inherit;
    box-shadow: none;
}

.tyne-swal .tyne-swal-icon.swal2-icon::before,
.tyne-swal .tyne-swal-icon.swal2-icon::after,
.tyne-swal .tyne-swal-icon .swal2-success-ring,
.tyne-swal .tyne-swal-icon .swal2-success-fix-tip,
.tyne-swal .tyne-swal-icon .swal2-success-fix-long,
.tyne-swal .tyne-swal-icon .swal2-success-circular-line-left,
.tyne-swal .tyne-swal-icon .swal2-success-circular-line-right,
.tyne-swal .tyne-swal-icon .swal2-success-fix-line,
.tyne-swal .tyne-swal-icon .swal2-x-mark {
    display: none !important;
}

.tyne-swal .tyne-swal-icon .swal2-icon-content {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}

.tyne-swal-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 26px;
    line-height: 1;
}

.tyne-swal-toast .tyne-swal-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 18px;
}

.tyne-swal-mark-warning {
    background: color-mix(in srgb, #f59e0b 14%, var(--card));
    color: #d97706;
}

.tyne-swal-mark-error {
    background: color-mix(in srgb, var(--destructive) 12%, var(--card));
    color: var(--destructive);
}

.tyne-swal-mark-success {
    background: color-mix(in srgb, #16a34a 12%, var(--card));
    color: #16a34a;
}

.tyne-swal-mark-info,
.tyne-swal-mark-question {
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
    color: var(--primary);
}

.tyne-swal-title.swal2-title {
    margin: 0 0 8px;
    padding: 0;
    color: var(--foreground);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.tyne-swal-text.swal2-html-container {
    margin: 0;
    padding: 0;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.tyne-swal-actions.swal2-actions {
    width: 100%;
    margin: 22px 0 0;
    padding: 0;
    gap: 10px;
}

.tyne-swal-actions .tyne-btn {
    min-width: 108px;
    margin: 0 !important;
}

.tyne-swal-confirm-danger.tyne-btn-destructive {
    border-color: var(--destructive) !important;
    background: var(--destructive);
    color: var(--destructive-foreground) !important;
}

.tyne-swal-confirm-danger.tyne-btn-destructive:hover {
    border-color: color-mix(in srgb, var(--destructive) 88%, #000) !important;
    background: color-mix(in srgb, var(--destructive) 88%, #000);
    color: var(--destructive-foreground) !important;
}

.tyne-swal-close.swal2-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--background);
    color: var(--muted-foreground);
    font-size: 22px;
    line-height: 1;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tyne-swal-close.swal2-close:hover {
    border-color: var(--ring);
    background: var(--accent);
    color: var(--foreground);
}

.tyne-swal-footer.swal2-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: 12px;
}

.tyne-swal-input.swal2-input,
.tyne-swal-input.swal2-textarea {
    margin: 16px 0 0;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 2px);
    background: var(--background);
    color: var(--foreground);
    box-shadow: none;
}

.tyne-swal-input.swal2-input:focus,
.tyne-swal-input.swal2-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.tyne-swal-validation.swal2-validation-message {
    margin: 12px 0 0;
    border: 0;
    border-radius: calc(var(--radius) - 2px);
    background: color-mix(in srgb, var(--destructive) 10%, var(--card));
    color: var(--destructive);
}

.tyne-swal-timer.swal2-timer-progress-bar {
    background: var(--primary);
}

.tyne-swal-toast .tyne-swal-title.swal2-title {
    margin: 0;
    font-size: 14px;
}

.tyne-swal-toast .tyne-swal-icon.swal2-icon {
    width: 36px;
    height: 36px;
    margin: 0 10px 0 0;
}

body.dark-theme .tyne-swal.swal2-popup {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.tyne-card-compact {
    border-radius: 8px;
}

.tyne-card-compact .tyne-card-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.tyne-card-compact .tyne-card-header h3 {
    font-size: 14px;
    line-height: 1.3;
}

.tyne-card-compact .tyne-card-header p {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
}

.tyne-card-compact .tyne-card-body {
    padding: 12px 14px 2px;
}

.tyne-card-compact .tyne-field {
    margin-bottom: 10px;
}

.tyne-card-compact .tyne-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 14px;
}

.tyne-card-tertiary {
    border: 0;
    background: var(--muted);
}

.tyne-card-row {
    border-top: 1px solid var(--border);
}

.tyne-crumb-gap {
    margin-bottom: 14px;
}

.tyne-crumb-link {
    color: var(--muted-foreground);
}

.tyne-crumb-link:hover {
    color: var(--foreground);
}

.tyne-crumb-current {
    color: var(--foreground);
}

.tyne-crumb-sep,
.tyne-crumb-home {
    width: 14px;
    height: 14px;
}

.tyne-crumb-sep,
.tyne-crumb-slash {
    color: color-mix(in srgb, var(--muted-foreground) 60%, transparent);
}

body.rtl .tyne-crumb-sep {
    transform: scaleX(-1);
}

.tyne-card-empty {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--muted) 20%, transparent);
}

.tyne-card-empty-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
}

.tyne-card-empty-copy {
    max-width: 280px;
}

.tyne-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.tyne-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
}

.tyne-summary-label {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
}

.tyne-summary-value {
    margin: 4px 0 0;
    color: var(--foreground);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.tyne-summary-hint {
    margin: 4px 0 0;
    color: var(--muted-foreground);
    font-size: 12px;
}

.tyne-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}

.tyne-summary-success .tyne-summary-icon {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.tyne-summary-warning .tyne-summary-icon {
    background: color-mix(in srgb, var(--warning) 16%, transparent);
    color: var(--warning);
}

.tyne-summary-destructive .tyne-summary-icon {
    background: color-mix(in srgb, var(--destructive) 12%, transparent);
    color: var(--destructive);
}

.tyne-summary-info .tyne-summary-icon {
    background: color-mix(in srgb, var(--info) 12%, transparent);
    color: var(--info);
}

.tyne-summary-default,
.tyne-summary-highlight,
.tyne-summary-secondary {
    flex-direction: row;
    gap: 16px;
    padding: 24px;
}

.tyne-summary-secondary {
    gap: 20px;
    padding: 20px;
}

.tyne-summary-copy {
    min-width: 0;
}

.tyne-summary-top,
.tyne-summary-lead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.tyne-summary-lead {
    justify-content: flex-start;
}

.tyne-summary-default .tyne-summary-value,
.tyne-summary-highlight .tyne-summary-value {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.tyne-summary-default .tyne-summary-label,
.tyne-summary-highlight .tyne-summary-label {
    margin: 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
}

.tyne-summary-default .tyne-summary-icon,
.tyne-summary-highlight .tyne-summary-icon,
.tyne-summary-secondary .tyne-summary-icon {
    width: 48px;
    height: 48px;
}

.tyne-summary-default .tyne-summary-icon {
    background: var(--muted);
    color: var(--foreground);
}

.tyne-summary-highlight {
    border-color: transparent;
    background: color-mix(in srgb, var(--primary) 80%, transparent);
    color: var(--primary-foreground);
}

.tyne-summary-highlight .tyne-summary-value,
.tyne-summary-highlight .tyne-summary-label {
    color: var(--primary-foreground);
}

.tyne-summary-highlight .tyne-summary-icon {
    background: #ffffff;
    color: #17202c;
}

.tyne-summary-secondary .tyne-summary-label {
    margin: 0;
    font-size: 14px;
}

.tyne-summary-secondary .tyne-summary-value {
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tyne-summary-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.tyne-summary-secondary .tyne-summary-foot {
    justify-content: flex-start;
}

.tyne-summary-foot .tyne-summary-hint {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tyne-summary-highlight .tyne-summary-hint {
    color: color-mix(in srgb, var(--primary-foreground) 65%, transparent);
}

.tyne-summary-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
}

.tyne-summary-trend-up {
    color: var(--success);
}

.tyne-summary-trend-down {
    color: var(--destructive);
}

.tyne-summary-trend-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tyne-summary-trend-svg {
    width: 20px;
    height: 20px;
}

.tyne-summary-secondary .tyne-summary-trend {
    gap: 6px;
}

.tyne-summary-secondary .tyne-summary-trend-mark {
    width: 20px;
    height: 20px;
    border-radius: 999px;
}

.tyne-summary-secondary .tyne-summary-trend-up .tyne-summary-trend-mark {
    background: color-mix(in srgb, var(--success) 15%, transparent);
}

.tyne-summary-secondary .tyne-summary-trend-down .tyne-summary-trend-mark {
    background: color-mix(in srgb, var(--destructive) 15%, transparent);
}

.tyne-summary-secondary .tyne-summary-trend-svg {
    width: 14px;
    height: 14px;
}

.tyne-summary-strips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tyne-summary-strip {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    width: auto;
    min-width: 7rem;
    padding: 8px 12px;
}

.tyne-summary-strip .tyne-summary-value,
.tyne-summary-strip .tyne-summary-label {
    margin: 0;
}

.tyne-summary-strip .tyne-summary-value {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tyne-summary-strip .tyne-summary-label {
    font-size: 12px;
}

.tyne-summary-strip.is-active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.tyne-summary-block {
    margin-bottom: 12px;
}

.tyne-summary-block + .tyne-summary-block {
    margin-top: 28px;
}

.tynetable-shell {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--card-foreground);
}

.tyne-card .tynetable-shell {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.tynetable-shell.is-static .tynetable-footer {
    display: none;
}

.tyne-card .tyne-calendar {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.tynetable-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.tynetable-title {
    margin: 0;
    color: var(--foreground);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.tynetable td .tyne-field {
    margin-bottom: 0;
}

.tynetable td .nice-select.wide {
    float: none;
    width: 100%;
}

.tynetable-toolbar .tyne-field {
    margin-bottom: 0;
}

.tynetable-search {
    flex: 0 1 200px;
    width: 200px;
    margin-inline-start: auto;
}

.tynetable-search.has-button {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 8px;
    width: auto;
}

.tynetable-search.has-button .tyne-field {
    flex: 0 1 200px;
    width: 200px;
}

.tynetable-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tynetable-bulk {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.tynetable-bulk-count {
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.tynetable-bulk-select {
    flex: 0 0 160px;
    width: 160px;
}

.tynetable-filter {
    flex: 0 0 180px;
    width: 180px;
}

.tynetable-clear {
    flex: 0 0 auto;
}

.tynetable-search .form-control.tyne-input {
    padding-left: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 14px;
}

body.dark-theme .tynetable-search .form-control.tyne-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a1a1aa' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14'/%3E%3C/svg%3E");
}

.tynetable-toolbar .tynetable-search .form-control.tyne-input {
    height: 36px !important;
    border-color: var(--input) !important;
    border-radius: 8px;
    background-color: var(--background);
    box-shadow: none;
    line-height: 34px !important;
    font-size: 12px;
}

.tynetable-toolbar .tynetable-search .form-control.tyne-input:hover,
.tynetable-toolbar .tynetable-search .form-control.tyne-input:focus {
    border-color: var(--ring) !important;
    background-color: var(--background);
}

.tynetable-footer {
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
}

.tyne-page-summary {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
}

.tyne-page-nav-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

.tynetable-footer .tyne-btn-icon,
.tynetable-footer .tyne-page-btn {
    width: 32px;
    height: 32px;
    border-radius: calc(var(--radius) - 2px) !important;
    font-size: 13px;
    box-shadow: none;
}

.tyne-page-size {
    position: relative;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 400;
}

.tyne-page-size .nice-select {
    float: none;
    width: 68px;
    height: 32px !important;
    padding: 0 22px 0 10px !important;
    border-radius: calc(var(--radius) - 2px);
    line-height: 30px !important;
    font-size: 14px;
    font-weight: 500;
    box-shadow: none;
}

.tyne-page-size .nice-select:after,
.tyne-page-size .nice-select.open:after {
    right: 10px;
}

.tyne-page-size .nice-select.open {
    z-index: 1080 !important;
}

.tyne-page-size .nice-select .list {
    top: auto !important;
    bottom: calc(100% + 4px);
    left: 0;
    right: auto;
    min-width: 72px;
    margin-top: 0;
    z-index: 1081 !important;
}

.tyne-page-btn {
    width: 32px;
    padding: 0;
}

.tyne-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--muted-foreground);
}

.tyne-page-nav-mobile {
    display: none;
    width: 100%;
    justify-content: center;
    gap: 8px;
}

.tynetable-empty {
    padding: 8px 16px;
}

.tynetable > tbody > tr:hover > .tynetable-empty {
    --bs-table-accent-bg: transparent;
    background: transparent;
}

.tynetable-skeleton {
    display: block;
    width: 70%;
    height: 14px;
    border-radius: 6px;
    background: var(--muted);
}

@media (max-width: 640px) {
    .tyne-page-nav-desktop {
        display: none;
    }

    .tyne-page-nav-mobile {
        display: flex;
    }
}

.tynetable-wrap.is-divided {
    border-top: 1px solid var(--border);
}

.tynetable {
    --bs-table-color: var(--foreground);
    --bs-table-bg: transparent;
    --bs-table-border-color: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: transparent;
    --bs-table-hover-color: var(--foreground);
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--foreground);
    font-size: 14px;
    vertical-align: middle;
}

.tynetable.table > :not(caption) > * > * {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: transparent;
    box-shadow: none;
    color: var(--foreground);
    line-height: 1.25rem;
    vertical-align: middle;
}

.tynetable.table > :not(caption) > * > *:last-child {
    border-right-width: 0;
}

.tynetable.table > thead > tr > th {
    height: 40px;
    padding: 0 16px;
    background: var(--table-header);
    box-shadow: none;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.tynetable.table > tbody > tr:hover > * {
    background: color-mix(in srgb, var(--muted) 50%, transparent);
    color: var(--foreground);
}

.tynetable.table > tbody > tr:has([data-tynetable-check]:checked) > * {
    background: var(--muted);
}

.tynetable.table > tbody > tr:last-child > * {
    border-bottom-width: 0;
}

body.dark-theme .tynetable.table > :not(caption) > * > * {
    color: var(--foreground);
}

body.dark-theme .tynetable.table > thead > tr > th {
    color: var(--muted-foreground);
    background-color: var(--table-header);
}

.tyne-person {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tyne-person strong {
    display: block;
    color: var(--foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.tyne-person span,
.tyne-stack span {
    display: block;
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 1.2;
}

.tyne-stack strong {
    display: block;
    color: var(--foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.tyne-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--background);
    color: var(--foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.tyne-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--muted-foreground);
}

.tyne-status-success .tyne-status-dot {
    background: var(--success);
}

.tyne-status-warning .tyne-status-dot {
    background: var(--warning);
}

.tyne-status-destructive .tyne-status-dot {
    background: var(--destructive);
}

.tyne-status-secondary .tyne-status-dot {
    background: var(--muted-foreground);
}

.tynetable-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.tynetable-actions .tynetable-icon {
    width: 32px;
    height: 32px;
}

.tyne-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

body.auth-body {
    margin: 0;
    min-height: 100dvh;
    background: var(--background);
    color: var(--foreground);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    position: relative;
    display: grid;
    min-height: 100dvh;
    background: var(--background);
}

.auth-theme {
    position: absolute;
    top: 24px;
    inset-inline-end: 24px;
    z-index: 10;
}

.auth-form-pane {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.auth-form-pane-inner {
    width: 100%;
    max-width: 440px;
}

.auth-brand {
    order: 1;
    display: flex;
    background-color: var(--muted);
    background-image: url('../images/auth/auth-bg.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.dark-theme .auth-brand {
    background-image: url('../images/auth/auth-bg-dark.jpeg');
}

.auth-brand-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--foreground);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.auth-brand-logo:hover {
    color: var(--foreground);
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary);
    color: var(--primary-foreground);
}

.auth-brand-copy h2 {
    margin: 0 0 12px;
    color: var(--foreground);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.auth-brand-copy p {
    margin: 0;
    max-width: 36rem;
    color: var(--muted-foreground);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

.auth-card {
    padding: 32px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--card-foreground);
}

.auth-card-head {
    margin-bottom: 24px;
    text-align: center;
}

.auth-card-head h1 {
    margin: 0 0 16px;
    color: var(--foreground);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.auth-card-head p,
.auth-switch {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 14px;
    line-height: 1.5;
}

.auth-form .tyne-field {
    margin-bottom: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-row-end {
    justify-content: flex-end;
}

.auth-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.auth-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
}

.auth-flash {
    margin-bottom: 16px;
}

.auth-demo {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--muted) 60%, transparent);
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.auth-demo form + form {
    margin-top: 8px;
}

.auth-captcha .tyne-label {
    margin-bottom: 8px;
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }

    .auth-theme {
        top: 40px;
        inset-inline-end: 40px;
    }

    .auth-form-pane {
        order: 1;
        padding: 40px;
    }

    .auth-brand {
        order: 2;
        margin: 20px;
        border: 1px solid var(--border);
        border-radius: 12px;
    }

    .auth-brand-inner {
        padding: 64px;
    }

    .auth-card {
        padding: 40px;
    }
}

.tyne-calendar {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    padding: 16px 16px 8px;
    color: var(--foreground);
}

.tyne-calendar .fc {
    --fc-border-color: var(--border);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: var(--muted);
    --fc-list-event-hover-bg-color: var(--accent);
    --fc-today-bg-color: color-mix(in srgb, var(--primary) 8%, transparent);
    --fc-now-indicator-color: var(--primary);
    font-family: inherit;
}

.tyne-calendar .fc .fc-toolbar.fc-header-toolbar {
    align-items: center;
    margin-bottom: 14px;
    gap: 10px;
}

.tyne-calendar .fc .fc-toolbar-title {
    color: var(--foreground);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.tyne-calendar .fc .fc-button {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background: var(--background) !important;
    box-shadow: none !important;
    color: var(--foreground) !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 30px;
    text-transform: none;
}

.tyne-calendar .fc .fc-button-group {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 2px);
}

.tyne-calendar .fc .fc-button-group > .fc-button {
    border: 0 !important;
    border-radius: 0 !important;
    border-right: 1px solid var(--input) !important;
}

.tyne-calendar .fc .fc-button-group > .fc-button:last-child {
    border-right: 0 !important;
}

.tyne-calendar .fc .fc-button:hover,
.tyne-calendar .fc .fc-button:focus {
    background: var(--accent) !important;
    color: var(--foreground) !important;
}

.tyne-calendar .fc .fc-button-primary:not(:disabled).fc-button-active,
.tyne-calendar .fc .fc-button-primary:not(:disabled):active {
    border-color: transparent !important;
    background: var(--primary) !important;
    color: var(--primary-foreground) !important;
}

.tyne-calendar .fc .fc-scrollgrid {
    overflow: hidden;
    border-radius: 10px;
}

.tyne-calendar .fc .fc-col-header-cell {
    background: var(--table-header);
}

.tyne-calendar .fc .fc-col-header-cell-cushion {
    padding: 10px 0;
    color: var(--muted-foreground);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.tyne-calendar .fc .fc-daygrid-day-number,
.tyne-calendar .fc .fc-list-day-text,
.tyne-calendar .fc .fc-list-day-side-text {
    color: var(--foreground);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.tyne-calendar .fc .fc-daygrid-day-top {
    justify-content: flex-end;
    padding: 6px 8px 0;
}

.tyne-calendar .fc .fc-daygrid-day-frame {
    min-height: 112px;
}

.tyne-calendar .fc .fc-day-other {
    background: color-mix(in srgb, var(--muted) 35%, transparent);
}

.tyne-calendar .fc .fc-day-other .fc-daygrid-day-number {
    color: var(--muted-foreground);
}

.tyne-calendar .fc .fc-day-today .fc-daygrid-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 600;
}

.tyne-calendar .fc-daygrid-event,
.tyne-calendar .fc-timegrid-event,
.tyne-calendar .fc-list-event {
    margin: 1px 6px;
    padding: 2px 6px;
    border: 0;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 14%, var(--background));
    color: var(--foreground);
    font-size: 12px;
    font-weight: 500;
}

.tyne-calendar .fc a.fc-event,
.tyne-calendar .fc a.fc-event:hover {
    color: inherit;
    text-decoration: none;
}

.tyne-calendar .fc .fc-event-time {
    color: var(--muted-foreground);
    font-size: 11px;
    font-weight: 500;
}

.tyne-calendar .fc .fc-event-title {
    font-weight: 500;
}

.tyne-calendar .fc .fc-daygrid-event-harness {
    margin-top: 2px;
}

.tyne-calendar .fc .fc-daygrid-more-link {
    margin: 0 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.tyne-calendar .fc .fc-popover {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--popover);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--foreground) 12%, transparent);
}

.tyne-calendar .fc .fc-popover-header {
    background: var(--table-header);
    color: var(--foreground);
    font-size: 13px;
    font-weight: 600;
}

.tyne-calendar .tyne-event-primary {
    border-left-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 16%, var(--background));
    color: var(--foreground);
}

.tyne-calendar .tyne-event-success {
    border-left-color: var(--success);
    background: color-mix(in srgb, var(--success) 16%, var(--background));
    color: var(--foreground);
}

.tyne-calendar .tyne-event-warning {
    border-left-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 18%, var(--background));
    color: var(--foreground);
}

.tyne-calendar .tyne-event-info {
    border-left-color: var(--info);
    background: color-mix(in srgb, var(--info) 16%, var(--background));
    color: var(--foreground);
}

.tyne-calendar .tyne-event-destructive {
    border-left-color: var(--destructive);
    background: color-mix(in srgb, var(--destructive) 14%, var(--background));
    color: var(--foreground);
}

.tyne-calendar .fc .fc-daygrid-event-dot {
    display: none;
}

.tyne-cal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tyne-cal-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tyne-cal-item[hidden] {
    display: none;
}

.tyne-cal-item strong {
    display: block;
    color: var(--foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

.tyne-cal-item span {
    display: block;
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 1.3;
}

.tyne-cal-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--primary);
}

.tyne-cal-dot-success {
    background: var(--success);
}

.tyne-cal-dot-warning {
    background: var(--warning);
}

.tyne-cal-dot-info {
    background: var(--info);
}

.tyne-cal-dot-destructive {
    background: var(--destructive);
}

.tyne-chart {
    min-height: 280px;
}

.tyne-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
}

.tyne-tags .bootstrap-tagsinput,
.tyne-multi .select2-container--default .select2-selection--multiple,
.tyne-multi span.select2-selection.select2-selection--multiple {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100% !important;
    height: auto;
    min-height: 40px;
    margin: 0;
    padding: 4px 12px;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background: var(--background) !important;
    box-shadow: none !important;
    color: var(--foreground);
    line-height: 1.25;
    cursor: text;
}

.tyne-tags.tyne-control-sm .bootstrap-tagsinput,
.tyne-multi.tyne-control-sm .select2-selection--multiple {
    min-height: 36px;
}

.tyne-tags .bootstrap-tagsinput:hover,
.tyne-tags .bootstrap-tagsinput:focus-within,
.tyne-multi .select2-container--focus .select2-selection--multiple,
.tyne-multi .select2-container--open .select2-selection--multiple {
    border-color: var(--ring) !important;
    outline: none;
    box-shadow: 0 0 0 0.6px var(--ring) !important;
}

.tyne-tags.is-invalid .bootstrap-tagsinput,
.tyne-tags.is-invalid .bootstrap-tagsinput:hover,
.tyne-tags.is-invalid .bootstrap-tagsinput:focus-within,
.tyne-multi.is-invalid .select2-selection--multiple,
.tyne-multi.is-invalid .select2-container--focus .select2-selection--multiple {
    border-color: var(--destructive) !important;
    box-shadow: 0 0 0 0.6px var(--destructive) !important;
}

.tyne-tags.is-disabled .bootstrap-tagsinput,
.tyne-multi.is-disabled .select2-selection--multiple {
    opacity: 0.5;
    cursor: not-allowed;
}

.tyne-tags.is-disabled {
    pointer-events: none;
}

.tyne-multi .select2-container {
    display: block;
    width: 100% !important;
}

.tyne-multi .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0;
    padding: 0;
}

.tyne-multi .select2-search--inline {
    display: inline-flex;
    flex: 1 1 8rem;
    align-items: center;
}

.tyne-tags .bootstrap-tagsinput .badge,
.tyne-multi .select2-container--default .select2-selection--multiple .select2-selection__choice,
.dark-theme .tyne-multi .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    height: auto !important;
    margin: 0 !important;
    padding: 2px 8px !important;
    border: 1px solid var(--border) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background: var(--secondary) !important;
    color: var(--secondary-foreground) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
}

.tyne-tags .bootstrap-tagsinput .badge [data-role="remove"] {
    margin-left: 2px;
    cursor: pointer;
}

.tyne-tags .bootstrap-tagsinput .badge [data-role="remove"]:after {
    padding: 0;
    background: transparent;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.tyne-tags .bootstrap-tagsinput .badge [data-role="remove"]:hover:after {
    background: transparent;
    color: var(--foreground);
}

.tyne-multi .select2-selection--multiple .select2-selection__choice__display {
    padding: 0 !important;
    height: auto;
    line-height: 1.25;
}

.tyne-multi .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.dark-theme .tyne-multi .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.dark-theme .tyne-multi .select2-selection--multiple .select2-selection__choice__remove span {
    position: static;
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--muted-foreground) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1 !important;
}

.tyne-multi .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--foreground) !important;
    background: transparent !important;
}

.tyne-tags .bootstrap-tagsinput input,
.tyne-multi .select2-search--inline .select2-search__field {
    flex: 1 1 8rem;
    width: auto !important;
    min-width: 8rem;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--foreground);
    font-size: 14px;
    line-height: 24px !important;
}

.tyne-tags .bootstrap-tagsinput input::placeholder,
.tyne-multi .select2-search--inline .select2-search__field::placeholder {
    color: var(--muted-foreground);
    opacity: 1;
}

.tyne-multi-dropdown.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--popover);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.tyne-multi-dropdown .select2-search__field {
    height: 32px !important;
    margin: 4px !important;
    padding: 0 8px !important;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background: var(--background);
    color: var(--foreground);
    font-size: 14px;
}

.tyne-multi-dropdown .select2-results__option {
    margin: 2px 4px;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--foreground);
    font-size: 14px;
}

.tyne-multi-dropdown .select2-results__option--highlighted.select2-results__option--selectable,
.tyne-multi-dropdown .select2-results__option--selected {
    background: var(--accent) !important;
    color: var(--foreground) !important;
}

.tyne-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.tyne-tabs.is-full {
    display: flex;
    width: 100%;
}

.tyne-tabs.is-full .tyne-tab {
    flex: 1;
}

.tyne-tab {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted-foreground);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
}

.tyne-tab:hover:not(:disabled):not(.active) {
    color: var(--foreground);
}

.tyne-tab:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.tyne-tab.active {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: none;
}

.tyne-tab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tyne-tab-panels {
    margin-top: 16px;
}

.tyne-profile {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}

.tyne-profile-cover {
    height: 140px;
    background:
        radial-gradient(circle at 18% 30%, color-mix(in srgb, #fff 28%, transparent), transparent 36%),
        linear-gradient(115deg, color-mix(in srgb, var(--primary) 88%, #3a2412), color-mix(in srgb, var(--primary) 42%, var(--card)));
}

.tyne-profile-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: -52px;
    padding: 0 24px;
}

.tyne-profile-id {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    min-width: 0;
}

.tyne-profile-photo {
    flex-shrink: 0;
    border: 4px solid var(--card);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--foreground) 16%, transparent);
}

.tyne-profile-id-copy {
    min-width: 0;
    padding-bottom: 8px;
}

.tyne-profile-name {
    margin: 0;
    color: var(--foreground);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.tyne-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.tyne-profile-body {
    padding: 20px 24px 24px;
}

.tyne-profile-field span {
    display: block;
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 500;
}

.tyne-profile-field strong {
    display: block;
    margin-top: 4px;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 767px) {
    .tyne-profile-head,
    .tyne-profile-id {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Tyne Searchable Select Component
   Single & Multiple Searchable Select with Dropdown Search Box
   Exact height matching Tyne inputs: 40px (Default / MD), 36px (Small / SM)
   ========================================================================== */

.tyne-searchable {
    position: relative;
    width: 100%;
}

.tyne-searchable .select2-container {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
}

/* Single Select Trigger: Strictly 40px (Default / MD) */
/* Flag icon & general icon rendering inside Searchable Select */
.tyne-searchable .select2-selection--single .select2-selection__rendered .d-inline-flex {
    display: inline-flex !important;
    align-items: center !important;
    height: 100% !important;
    max-width: 100%;
}

.tyne-searchable .select2-selection--single .select2-selection__rendered i,
.tyne-searchable-dropdown .select2-results__option i {
    flex-shrink: 0;
    margin-right: 6px;
    vertical-align: middle;
}

html[dir="rtl"] .tyne-searchable .select2-selection--single .select2-selection__rendered i,
html[dir="rtl"] .tyne-searchable-dropdown .select2-results__option i,
body.rtl .tyne-searchable .select2-selection--single .select2-selection__rendered i,
body.rtl .tyne-searchable-dropdown .select2-results__option i {
    margin-right: 0 !important;
    margin-left: 6px !important;
}

.tyne-searchable .select2-container .select2-selection--single,
.tyne-searchable .select2-container--default .select2-selection--single,
.tyne-searchable span.select2-selection.select2-selection--single,
.tyne-searchable.tyne-control-md .select2-container .select2-selection--single,
.tyne-searchable.tyne-control-md .select2-container--default .select2-selection--single,
.tyne-searchable.tyne-control-md span.select2-selection.select2-selection--single {
    position: relative;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 34px 0 12px !important;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background-color: var(--background) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    color: var(--foreground) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 38px !important;
    cursor: pointer;
    overflow: hidden !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Single Select Trigger: Strictly 36px (Small / SM) */
.tyne-searchable.tyne-control-sm .select2-container .select2-selection--single,
.tyne-searchable.tyne-control-sm .select2-container--default .select2-selection--single,
.tyne-searchable.tyne-control-sm span.select2-selection.select2-selection--single {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 30px 0 10px !important;
    font-size: 13px !important;
    line-height: 34px !important;
}

.tyne-searchable .select2-selection--single .select2-selection__rendered,
.tyne-searchable.tyne-control-md .select2-selection--single .select2-selection__rendered {
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    line-height: 38px !important;
    padding: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    color: var(--foreground) !important;
    font-size: 14px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.tyne-searchable.tyne-control-sm .select2-selection--single .select2-selection__rendered {
    height: 34px !important;
    font-size: 13px !important;
    line-height: 34px !important;
}

/* Reserve space for the clear button so long values never overlap the right icons */
.tyne-searchable span.select2-selection--single.select2-selection--clearable,
.tyne-searchable.tyne-control-md span.select2-selection--single.select2-selection--clearable {
    padding-right: 50px !important;
}

.tyne-searchable.tyne-control-sm span.select2-selection--single.select2-selection--clearable {
    padding-right: 46px !important;
}

.tyne-searchable .select2-selection--single .select2-selection__placeholder {
    color: var(--muted-foreground) !important;
}

/* Hover & Focus State */
.tyne-searchable .select2-container--default:hover .select2-selection--single,
.tyne-searchable .select2-container--default.select2-container--focus .select2-selection--single,
.tyne-searchable .select2-container--default.select2-container--open .select2-selection--single,
.tyne-searchable .select2-container--default:hover .select2-selection--multiple,
.tyne-searchable .select2-container--default.select2-container--focus .select2-selection--multiple,
.tyne-searchable .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--ring) !important;
    outline: none !important;
    box-shadow: 0 0 0 0.6px var(--ring) !important;
}

/* Invalid State */
.tyne-searchable.is-invalid .select2-container--default .select2-selection--single,
.tyne-searchable.is-invalid .select2-container--default.select2-container--focus .select2-selection--single,
.tyne-searchable.is-invalid .select2-container--default.select2-container--open .select2-selection--single,
.tyne-searchable.is-invalid .select2-container--default .select2-selection--multiple,
.tyne-searchable.is-invalid .select2-container--default.select2-container--focus .select2-selection--multiple,
.tyne-searchable.is-invalid .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--destructive) !important;
    box-shadow: 0 0 0 0.6px var(--destructive) !important;
}

/* Disabled State */
.tyne-searchable.is-disabled .select2-selection--single,
.tyne-searchable.is-disabled .select2-selection--multiple,
.tyne-searchable .select2-container--default.select2-container--disabled .select2-selection--single,
.tyne-searchable .select2-container--default.select2-container--disabled .select2-selection--multiple {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: var(--muted) !important;
}

/* Custom Chevron Arrow */
.tyne-searchable .select2-container .select2-selection--single .select2-selection__arrow,
.tyne-searchable .select2-container--default .select2-selection--single .select2-selection__arrow,
.tyne-searchable .select2-selection__arrow {
    position: absolute !important;
    top: 50% !important;
    right: 14px !important;
    width: 6px !important;
    height: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-right: 1.5px solid var(--muted-foreground) !important;
    border-bottom: 1.5px solid var(--muted-foreground) !important;
    transform: translateY(-50%) rotate(45deg) !important;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.tyne-searchable .select2-selection__arrow b {
    display: none !important;
}

.tyne-searchable .select2-container--default.select2-container--open .select2-selection__arrow {
    transform: translateY(-50%) rotate(225deg) !important;
}

/* Clear Selection Button */
.tyne-searchable .select2-selection__clear {
    position: absolute !important;
    top: 50% !important;
    right: 28px !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 4px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--muted-foreground) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    cursor: pointer;
    z-index: 2;
    transition: color 0.15s ease;
}

.tyne-searchable .select2-selection__clear:hover {
    color: var(--foreground) !important;
}

/* Multiple Select Trigger: 40px base height matching inputs */
.tyne-searchable .select2-container .select2-selection--multiple,
.tyne-searchable .select2-container--default .select2-selection--multiple,
.tyne-searchable span.select2-selection.select2-selection--multiple,
.tyne-searchable.tyne-control-md .select2-container .select2-selection--multiple,
.tyne-searchable.tyne-control-md .select2-container--default .select2-selection--multiple,
.tyne-searchable.tyne-control-md span.select2-selection.select2-selection--multiple {
    position: relative;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 100% !important;
    height: auto !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 3px 34px 3px 12px !important;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background-color: var(--background) !important;
    box-shadow: none !important;
    color: var(--foreground);
    font-size: 14px;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Multiple Select Trigger: 36px base height (Small / SM) */
.tyne-searchable.tyne-control-sm .select2-container .select2-selection--multiple,
.tyne-searchable.tyne-control-sm .select2-container--default .select2-selection--multiple,
.tyne-searchable.tyne-control-sm span.select2-selection.select2-selection--multiple {
    min-height: 36px !important;
    padding: 2px 30px 2px 10px !important;
    font-size: 13px;
}

/* Multiple selects search from the dropdown search field, exactly like the
   single select. Select2 still renders its inline search inside the trigger,
   which wraps onto a second row and forces the control to double its height,
   so keep it out of the layout. */
.tyne-searchable .select2-search--inline {
    display: none !important;
}

/* Multiple Select: same chevron indicator as the single select */
.tyne-searchable .select2-selection--multiple::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--muted-foreground);
    border-bottom: 1.5px solid var(--muted-foreground);
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.2s ease;
    pointer-events: none;
}

.tyne-searchable .select2-container--open .select2-selection--multiple::after {
    transform: translateY(-50%) rotate(225deg);
}

/* Reserve the same room for the clear button as the single select */
.tyne-searchable.tyne-control-md .select2-container--default .select2-selection--multiple.select2-selection--clearable {
    padding-right: 50px !important;
}

.tyne-searchable.tyne-control-sm .select2-container--default .select2-selection--multiple.select2-selection--clearable {
    padding-right: 46px !important;
}

.tyne-searchable .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.tyne-searchable .select2-selection--multiple .select2-selection__placeholder {
    height: 32px !important;
    line-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--muted-foreground) !important;
    font-size: 14px !important;
}

.tyne-searchable.tyne-control-sm .select2-selection--multiple .select2-selection__placeholder {
    height: 28px !important;
    line-height: 28px !important;
    font-size: 13px !important;
}

/* Multiple Selection Choices / Chips */
.tyne-searchable .select2-container--default .select2-selection--multiple .select2-selection__choice,
body.dark-theme .tyne-searchable .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    height: 26px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 1px solid var(--border) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background: var(--secondary) !important;
    color: var(--secondary-foreground) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 24px !important;
    box-sizing: border-box !important;
}

.tyne-searchable.tyne-control-sm .select2-container--default .select2-selection--multiple .select2-selection__choice {
    height: 22px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    line-height: 20px !important;
}

.tyne-searchable .select2-selection--multiple .select2-selection__choice__display {
    padding: 0 !important;
    line-height: 1.25;
}

.tyne-searchable .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
body.dark-theme .tyne-searchable .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    position: static !important;
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--muted-foreground) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1 !important;
    cursor: pointer;
}

.tyne-searchable .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--foreground) !important;
}

/* Searchable Dropdown Popup */
.tyne-searchable-dropdown.select2-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background: var(--popover) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
    overflow: hidden;
    z-index: 1065 !important;
}

/* Search Input inside Dropdown */
.tyne-searchable-dropdown .select2-search--dropdown {
    position: relative;
    display: block !important;
    padding: 8px !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--popover) !important;
}

.tyne-searchable-dropdown .select2-search--dropdown::before {
    content: "\f002";
    font-family: "Line Awesome Free";
    font-weight: 900;
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    font-size: 13px;
    pointer-events: none;
}

.tyne-searchable-dropdown .select2-search__field {
    width: 100% !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 6px 10px 6px 30px !important;
    border: 1px solid var(--input) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background: var(--background) !important;
    color: var(--foreground) !important;
    font-size: 13px !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.tyne-searchable-dropdown .select2-search__field:focus {
    border-color: var(--ring) !important;
    box-shadow: 0 0 0 0.6px var(--ring) !important;
}

.tyne-searchable-dropdown .select2-search__field::placeholder {
    color: var(--muted-foreground) !important;
    opacity: 1;
}

/* Dropdown Results List */
.tyne-searchable-dropdown .select2-results {
    padding: 4px 0;
}

.tyne-searchable-dropdown .select2-results__options {
    margin: 0 !important;
    padding: 4px !important;
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
}

.tyne-searchable-dropdown .select2-results__option {
    margin: 2px 0 !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    color: var(--foreground) !important;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.tyne-searchable-dropdown .select2-results__option--highlighted.select2-results__option--selectable,
.tyne-searchable-dropdown .select2-results__option[aria-selected="true"],
.tyne-searchable-dropdown .select2-results__option--selected {
    background: var(--accent) !important;
    color: var(--foreground) !important;
}

.tyne-searchable-dropdown .select2-results__option[aria-selected="true"] {
    font-weight: 500;
}

.tyne-searchable-dropdown .select2-results__option[aria-disabled="true"] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.tyne-searchable-dropdown .select2-results__message {
    padding: 12px !important;
    color: var(--muted-foreground) !important;
    font-size: 13px !important;
    text-align: center;
}

/* ==========================================================================
   RTL Support for Searchable Select
   ========================================================================== */
html[dir="rtl"] .tyne-searchable .select2-container--default .select2-selection--single,
body.rtl .tyne-searchable .select2-container--default .select2-selection--single,
html[dir="rtl"] .tyne-searchable span.select2-selection.select2-selection--single,
body.rtl .tyne-searchable span.select2-selection.select2-selection--single {
    padding: 0 12px 0 34px !important;
    text-align: right;
}

html[dir="rtl"] .tyne-searchable span.select2-selection--single.select2-selection--clearable,
body.rtl .tyne-searchable span.select2-selection--single.select2-selection--clearable {
    padding-right: 12px !important;
    padding-left: 50px !important;
}

html[dir="rtl"] .tyne-searchable.tyne-control-sm span.select2-selection--single.select2-selection--clearable,
body.rtl .tyne-searchable.tyne-control-sm span.select2-selection--single.select2-selection--clearable {
    padding-right: 10px !important;
    padding-left: 46px !important;
}

html[dir="rtl"] .tyne-searchable .select2-selection__arrow,
body.rtl .tyne-searchable .select2-selection__arrow {
    right: auto !important;
    left: 14px !important;
}

html[dir="rtl"] .tyne-searchable .select2-selection__clear,
body.rtl .tyne-searchable .select2-selection__clear {
    right: auto !important;
    left: 28px !important;
}

html[dir="rtl"] .tyne-searchable .select2-container--default .select2-selection--multiple,
body.rtl .tyne-searchable .select2-container--default .select2-selection--multiple,
html[dir="rtl"] .tyne-searchable span.select2-selection.select2-selection--multiple,
body.rtl .tyne-searchable span.select2-selection.select2-selection--multiple {
    padding: 4px 12px 4px 34px !important;
    text-align: right;
}

html[dir="rtl"] .tyne-searchable-dropdown .select2-search--dropdown::before,
body.rtl .tyne-searchable-dropdown .select2-search--dropdown::before {
    left: auto;
    right: 18px;
}

html[dir="rtl"] .tyne-searchable-dropdown .select2-search__field,
body.rtl .tyne-searchable-dropdown .select2-search__field {
    padding: 6px 30px 6px 10px !important;
    text-align: right;
}

html[dir="rtl"] .tyne-searchable-dropdown .select2-results__option,
body.rtl .tyne-searchable-dropdown .select2-results__option {
    text-align: right;
}

/* ==========================================================================
   Dark Theme Enhancements for Searchable Select
   ========================================================================== */
body.dark-theme .tyne-searchable .select2-selection--single,
body.dark-theme .tyne-searchable .select2-selection--multiple {
    background-color: var(--background) !important;
    border-color: var(--input) !important;
    color: var(--foreground) !important;
}

body.dark-theme .tyne-searchable-dropdown.select2-dropdown {
    background-color: var(--popover) !important;
    border-color: var(--border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .tyne-searchable-dropdown .select2-search__field {
    background-color: var(--background) !important;
    border-color: var(--input) !important;
    color: var(--foreground) !important;
}

/* ==========================================================================
   Dark Theme Enhancements for Institutional Report Headers
   ========================================================================== */
body.dark-theme .institutional-print-header {
    background: var(--card) !important;
    border-bottom-color: var(--border) !important;
    color: var(--foreground);
}

body.dark-theme .institutional-print-header-table {
    border-bottom-color: var(--border) !important;
}

body.dark-theme .institutional-print-header h3,
body.dark-theme .institutional-print-header-table h3 {
    color: var(--foreground) !important;
}

body.dark-theme .institutional-print-header p,
body.dark-theme .institutional-print-header .text-muted,
body.dark-theme .institutional-print-header-table p,
body.dark-theme .institutional-print-header-table .text-muted {
    color: var(--muted-foreground) !important;
}

body.dark-theme .institutional-print-header .bg-light {
    background-color: var(--muted) !important;
    border-color: var(--border) !important;
}

body.dark-theme .institutional-print-header .text-dark {
    color: var(--foreground) !important;
}

body.dark-theme .institutional-print-header .border-top {
    border-top-color: var(--border) !important;
}

body.dark-theme .logo_dark {
    display: none !important;
}

body.dark-theme .logo_lite {
    display: inline-block !important;
}

@media print {
    .logo_dark {
        display: inline-block !important;
    }

    .logo_lite {
        display: none !important;
    }

    body.dark-theme .institutional-print-header,
    body.dark-theme .institutional-print-header-table {
        background: #ffffff !important;
        color: #0f172a !important;
        border-color: #e2e8f0 !important;
    }

    body.dark-theme .institutional-print-header h3,
    body.dark-theme .institutional-print-header-table h3,
    body.dark-theme .institutional-print-header .text-dark {
        color: #0f172a !important;
    }
}

/* --------------------------------------------------------------------------
   Sticky Left Form Column (Two-Column CRUD / Index Pages)
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
    .tyne-sticky-form-col,
    .sticky-form-col {
        position: -webkit-sticky;
        position: sticky;
        top: calc(var(--shell-header-h, 60px) + 20px);
        align-self: flex-start;
        z-index: 10;
    }
}
