:root {
    color-scheme: light;
    --tm-bg: #e9edf3;
    --tm-text: #1f2937;
    --tm-surface: #f3f5f9;
    --tm-surface-alt: #e6ebf2;
    --tm-border: #cfd7e3;
    --tm-muted: #5b6472;
    --tm-link: #2f6fdc;
    --tm-primary: #2f6fdc;
    --tm-primary-border: #2b62c5;
    --tm-focus: #7aa7ff;
    --tm-shadow: 0 16px 32px rgba(31, 41, 55, 0.08);
    --tm-sidebar-bg: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
    --tm-top-row-bg: #f3f5f9;
}

:root[data-theme="light"][data-light="sand"] {
    --tm-bg: #efe9e1;
    --tm-text: #2a2520;
    --tm-surface: #f7f3ee;
    --tm-surface-alt: #ece4db;
    --tm-border: #d7cec3;
    --tm-muted: #6a5f57;
    --tm-link: #b85c38;
    --tm-primary: #b85c38;
    --tm-primary-border: #a94f2f;
    --tm-focus: #d28a66;
    --tm-top-row-bg: #f7f3ee;
}

:root[data-theme="light"][data-light="mist"] {
    --tm-bg: #e6eef0;
    --tm-text: #1f2a2e;
    --tm-surface: #f1f6f7;
    --tm-surface-alt: #e1ecef;
    --tm-border: #c6d5da;
    --tm-muted: #5d6b73;
    --tm-link: #2b7aa3;
    --tm-primary: #2b7aa3;
    --tm-primary-border: #256a8e;
    --tm-focus: #5aa7c9;
    --tm-top-row-bg: #f1f6f7;
}

:root[data-theme="light"][data-light="lavender"] {
    --tm-bg: #ece9f6;
    --tm-text: #262133;
    --tm-surface: #f6f4fb;
    --tm-surface-alt: #e4dff1;
    --tm-border: #d2cbe8;
    --tm-muted: #6a6375;
    --tm-link: #6b5bd4;
    --tm-primary: #6b5bd4;
    --tm-primary-border: #5a4ac4;
    --tm-focus: #9a8bf0;
    --tm-top-row-bg: #f6f4fb;
}

:root[data-theme="light"][data-light="mint"] {
    --tm-bg: #e8f2ee;
    --tm-text: #22312c;
    --tm-surface: #f2f8f6;
    --tm-surface-alt: #dfeee8;
    --tm-border: #c6ddd3;
    --tm-muted: #5f6e68;
    --tm-link: #2f8f7a;
    --tm-primary: #2f8f7a;
    --tm-primary-border: #287c6b;
    --tm-focus: #5fb7a1;
    --tm-top-row-bg: #f2f8f6;
}

:root[data-theme="light"][data-light="sky"] {
    --tm-bg: #e6edf5;
    --tm-text: #1e2c3a;
    --tm-surface: #f1f5fa;
    --tm-surface-alt: #dee7f2;
    --tm-border: #c7d5e5;
    --tm-muted: #5b6a7a;
    --tm-link: #2d6fb7;
    --tm-primary: #2d6fb7;
    --tm-primary-border: #275fa0;
    --tm-focus: #6aa0dd;
    --tm-top-row-bg: #f1f5fa;
}

:root[data-theme="light"][data-light="blush"] {
    --tm-bg: #f1e7e3;
    --tm-text: #2c2320;
    --tm-surface: #f7f0ed;
    --tm-surface-alt: #e8d9d2;
    --tm-border: #d9c9c2;
    --tm-muted: #6b5b54;
    --tm-link: #c96a57;
    --tm-primary: #c96a57;
    --tm-primary-border: #b95e4c;
    --tm-focus: #e09a88;
    --tm-top-row-bg: #f7f0ed;
}

:root[data-theme="light"][data-light="olive"] {
    --tm-bg: #eceee6;
    --tm-text: #2a2f25;
    --tm-surface: #f6f7f0;
    --tm-surface-alt: #e2e6d6;
    --tm-border: #cfd6c4;
    --tm-muted: #6a7261;
    --tm-link: #6b8a3c;
    --tm-primary: #6b8a3c;
    --tm-primary-border: #5c7734;
    --tm-focus: #9bb56a;
    --tm-top-row-bg: #f6f7f0;
}

[data-theme="dark"] {
    color-scheme: dark;
    --tm-bg: #1f2127;
    --tm-text: #e5e7ef;
    --tm-surface: #2a2c33;
    --tm-surface-alt: #24262d;
    --tm-border: #3a3d46;
    --tm-muted: #a1a7b7;
    --tm-link: #90b4ff;
    --tm-primary: #3b82f6;
    --tm-primary-border: #2f6fdc;
    --tm-focus: #90b4ff;
    --tm-top-row-bg: #252730;
    --tm-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--tm-bg);
    color: var(--tm-text);
}

a, .btn-link {
    color: var(--tm-link);
}

.btn-primary {
    color: #fff;
    background-color: var(--tm-primary);
    border-color: var(--tm-primary-border);
}

.btn,
.form-control,
.form-select {
    border-radius: 10px;
}

.btn {
    box-shadow: 0 6px 16px rgba(47, 111, 220, 0.2);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
    box-shadow: none;
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--tm-border);
}

.form-control {
    min-height: 38px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--tm-focus);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.text-muted {
    color: var(--tm-muted) !important;
}

.card,
.list-group-item,
.form-control,
.form-select,
.input-group-text {
    background-color: var(--tm-surface);
    color: var(--tm-text);
    border-color: var(--tm-border);
}

.form-check-input {
    background-color: var(--tm-surface);
    border-color: var(--tm-border);
}

.tm-shell {
    display: flex;
    justify-content: center;
}

.tm-prep {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.tm-prep-logo {
    height: 2.7rem;
    width: auto;
}

.tm-prep-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.tm-card {
    background: var(--tm-surface);
    border: 1px solid var(--tm-border);
    border-radius: 14px;
    padding: 1.4rem;
    box-shadow: var(--tm-shadow);
    margin-bottom: 1.5rem;
}

.tm-card-lg {
    width: min(540px, 100%);
}

.tm-card-title {
    text-align: center;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.tm-file-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tm-file-name {
    font-size: 0.85rem;
    color: var(--tm-muted);
}

.tm-radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tm-share-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--tm-border);
    background: var(--tm-surface);
}

.tm-share-bar .form-control {
    background: var(--tm-surface);
}

.tm-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tm-list-info {
    min-width: 0;
}

.tm-list-title {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.tm-list-meta {
    color: var(--tm-muted);
    font-size: 0.9rem;
}

.tm-list-image {
    width: min(280px, 100%);
    border-radius: 12px;
    object-fit: cover;
}

.tm-auth-card {
    max-width: 420px;
    margin: 2rem auto;
    text-align: left;
}

.tm-lock {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tm-board {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tm-column {
    background: var(--tm-surface-alt);
    border: 1px solid var(--tm-border);
    border-radius: 16px;
    padding: 1rem;
    min-height: 200px;
}

.tm-column-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tm-column-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tm-project-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.tm-project-tab {
    border: 1px solid var(--tm-border);
    background: var(--tm-surface);
    color: var(--tm-text);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
}

.tm-project-tab.is-active {
    background: var(--tm-primary);
    border-color: var(--tm-primary-border);
    color: #fff;
}

.tm-project-add-button {
    margin-left: auto;
}

.tm-project-add {
    margin: 0 0 1rem;
}

.tm-project-input {
    min-width: 220px;
    max-width: 320px;
}

.tm-assignee-input {
    min-width: 140px;
    max-width: 200px;
}

.tm-assignee-combo {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 160px;
    max-width: 220px;
    flex: 0 0 auto;
}

.tm-assignee-combo .tm-assignee-input {
    width: 100%;
    padding-right: 1.6rem;
}

.tm-assignee-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--tm-muted);
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
}

.tm-assignee-toggle-sm {
    right: 6px;
    font-size: 0.75rem;
}

.tm-assignee-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--tm-surface);
    border: 1px solid var(--tm-border);
    border-radius: 10px;
    box-shadow: var(--tm-shadow);
    z-index: 20;
    max-height: 200px;
    overflow-y: auto;
}

.tm-assignee-option {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.45rem 0.6rem;
    color: var(--tm-text);
}

.tm-assignee-option:hover {
    background: var(--tm-surface-alt);
}


.tm-assignee {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--tm-muted);
}

.tm-project-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tm-project-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--tm-border);
    background: var(--tm-surface-alt);
    font-size: 0.85rem;
}

.tm-chip-remove {
    border: none;
    background: transparent;
    color: var(--tm-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.tm-chip-remove:hover {
    color: var(--tm-text);
}

.tm-icon-button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--tm-border);
    background: var(--tm-surface);
    color: var(--tm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
}

.tm-icon-button svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.tm-icon-danger {
    color: #e03a3a;
    border-color: #e03a3a;
}

.tm-icon-button:hover {
    background: var(--tm-surface-alt);
}

.tm-column-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem 0.75rem;
}

.tm-board-card {
    padding: 0.75rem;
    margin-bottom: 0;
}

.tm-board-card:not(.tm-editing) {
    user-select: none;
    -webkit-user-drag: element;
}

.tm-board-card:not(.tm-editing) * {
    -webkit-user-drag: element;
}

.tm-drag-item {
    cursor: grab;
}

.tm-drag-item:active {
    cursor: grabbing;
}

@media (max-width: 640px) {
    .tm-card {
        padding: 1rem;
    }

    .tm-card-lg {
        width: 100%;
    }

    .tm-board {
        display: flex;
        gap: 0.75rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        scroll-snap-type: x mandatory;
    }

    .tm-column {
        min-width: 85%;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .input-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .input-group > .form-control,
    .input-group > .btn,
    .input-group > .tm-assignee-combo {
        width: 100%;
        border-radius: 10px;
    }

    .tm-assignee-combo {
        max-width: 100%;
    }

    .tm-project-tabs {
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
}

.tm-drag-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 1;
    background: var(--tm-surface);
    border: 1px solid var(--tm-border);
    border-radius: 12px;
    box-shadow: var(--tm-shadow);
}

.list-group {
    gap: 0.6rem;
}

.list-group-item {
    border-radius: 12px;
    border: 1px solid var(--tm-border);
}

.tm-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tm-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tm-admin-import .tm-import-text {
    min-height: 200px;
    resize: vertical;
}

.tm-import-help code {
    background: var(--tm-surface-alt);
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    border: 1px solid var(--tm-border);
}

.tm-admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--tm-border);
    background: var(--tm-surface-alt);
}

.tm-admin-actions {
    display: inline-flex;
    gap: 0.5rem;
}

.tm-admin-action {
    width: 32px;
    height: 32px;
}

.tm-admin-action svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.tm-admin-danger {
    color: #e03a3a;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
