
html[data-pc-theme="light"],
html:not([data-pc-theme="dark"]) {
    --tm-scrollbar-thumb: #94a3b8;
    --tm-scrollbar-track: transparent;
}

html[data-pc-theme="dark"] {
    --tm-scrollbar-thumb: #4b5563;
    --tm-scrollbar-track: transparent;
}

.pc-header .pc-head-link img {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: cover;
}

/* Keep persisted sidebar groups open immediately (avoids collapse flash on navigation) */
.pc-navbar > .pc-item.pc-hasmenu.pc-trigger > .pc-submenu {
    display: block !important;
}

html[data-tm-sidebar-open~="finance"] .pc-navbar > .pc-hasmenu[data-sidebar-group="finance"] > .pc-submenu,
html[data-tm-sidebar-open~="content"] .pc-navbar > .pc-hasmenu[data-sidebar-group="content"] > .pc-submenu,
html[data-tm-sidebar-open~="growth"] .pc-navbar > .pc-hasmenu[data-sidebar-group="growth"] > .pc-submenu,
html[data-tm-sidebar-open~="extra"] .pc-navbar > .pc-hasmenu[data-sidebar-group="extra"] > .pc-submenu,
html[data-tm-sidebar-open~="tools"] .pc-navbar > .pc-hasmenu[data-sidebar-group="tools"] > .pc-submenu {
    display: block !important;
}

/* Opened group label only: white text (not icons/arrows, not child links) */
.pc-navbar > .pc-item.pc-hasmenu.pc-trigger > .pc-link > .pc-mtext {
    color: #fff !important;
}

/* Bold only when that group's page is active */
.pc-navbar > .pc-item.pc-hasmenu.active > .pc-link,
.pc-navbar > .pc-item.pc-hasmenu.active > .pc-link > .pc-mtext {
    font-weight: 700 !important;
}

.tm-schedule-dates {
    max-width: 250px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
}

.tm-schedule-dates .tm-badge {
    margin-bottom: 0;
}

td.tm-schedule-date-col {
    max-width: 250px;
    white-space: normal !important;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--tm-scrollbar-thumb) var(--tm-scrollbar-track);
}

body,
.tm-overlay,
.tm-modal-body,
.pc-content,
.table-responsive,
.select2-results__options,
.profile-notification-scroll,
.simplebar-content-wrapper,
.modal-body,
.card-body,
.dropdown-menu,
.note-editing-area,
.dataTables_scrollBody {
    scrollbar-width: thin;
    scrollbar-color: var(--tm-scrollbar-thumb) var(--tm-scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.tm-overlay::-webkit-scrollbar,
.tm-modal-body::-webkit-scrollbar,
.pc-content::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.select2-results__options::-webkit-scrollbar,
.profile-notification-scroll::-webkit-scrollbar,
.simplebar-content-wrapper::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.card-body::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.note-editing-area::-webkit-scrollbar,
.dataTables_scrollBody::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.tm-overlay::-webkit-scrollbar-track,
.tm-modal-body::-webkit-scrollbar-track,
.pc-content::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.select2-results__options::-webkit-scrollbar-track,
.profile-notification-scroll::-webkit-scrollbar-track,
.simplebar-content-wrapper::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.card-body::-webkit-scrollbar-track,
.dropdown-menu::-webkit-scrollbar-track,
.note-editing-area::-webkit-scrollbar-track,
.dataTables_scrollBody::-webkit-scrollbar-track {
    background: var(--tm-scrollbar-track);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.tm-overlay::-webkit-scrollbar-thumb,
.tm-modal-body::-webkit-scrollbar-thumb,
.pc-content::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.select2-results__options::-webkit-scrollbar-thumb,
.profile-notification-scroll::-webkit-scrollbar-thumb,
.simplebar-content-wrapper::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.card-body::-webkit-scrollbar-thumb,
.dropdown-menu::-webkit-scrollbar-thumb,
.note-editing-area::-webkit-scrollbar-thumb,
.dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: var(--tm-scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.tm-overlay::-webkit-scrollbar-thumb:hover,
.tm-modal-body::-webkit-scrollbar-thumb:hover,
.pc-content::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.select2-results__options::-webkit-scrollbar-thumb:hover,
.profile-notification-scroll::-webkit-scrollbar-thumb:hover,
.simplebar-content-wrapper::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.card-body::-webkit-scrollbar-thumb:hover,
.dropdown-menu::-webkit-scrollbar-thumb:hover,
.note-editing-area::-webkit-scrollbar-thumb:hover,
.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--tm-scrollbar-thumb) 85%, #000 15%);
    background-clip: padding-box;
}

.tm-navbar-profile-header {
    background: var(--tm-primary-gradient);
    color: var(--tm-secondary-fg);
}

.tm-profile-settings-link,
.tm-profile-settings-link span,
.tm-profile-settings-link .pc-icon {
    color: #fff !important;
}

.tm-profile-settings-link .pc-icon,
.tm-profile-settings-link svg {
    fill: #fff !important;
    stroke: #fff !important;
    color: #fff !important;
}

.tm-profile-settings-link:hover,
.tm-profile-settings-link:hover span,
.tm-profile-settings-link:hover .pc-icon {
    color: #fff !important;
}

.pc-header .pc-head-link {
    position: relative;
}

.tm-notif-count-badge.tm-badge {
    position: absolute;
    top: 0.15rem;
    right: 0.1rem;
    z-index: 10;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    font-size: 0.625rem;
    line-height: 1;
    pointer-events: none;
}

/* Profile settings page: white copy in dark theme */
html[data-pc-theme="dark"] .tm-profile-page,
html[data-pc-theme="dark"] .tm-profile-page h5,
html[data-pc-theme="dark"] .tm-profile-page h6,
html[data-pc-theme="dark"] .tm-profile-page label,
html[data-pc-theme="dark"] .tm-profile-page p,
html[data-pc-theme="dark"] .tm-profile-page .font-semibold,
html[data-pc-theme="dark"] .tm-profile-page .font-medium {
    color: #fff;
}

html[data-pc-theme="dark"] .tm-profile-page .text-danger,
html[data-pc-theme="dark"] .tm-profile-page .text-danger * {
    color: #f87171 !important;
}

#toast-container.toast-bottom-right {
    bottom: 1.25rem;
    right: 1.25rem;
}

#toast-container > div {
    opacity: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.tm-finance-bar {
    background: var(--tm-primary-gradient);
    color: var(--tm-primary-fg);
}

.tm-overlay {
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.22s ease;
    overflow-y: auto;
}

.tm-overlay-stack {
    z-index: 1080;
}

.tm-overlay > div {
    transform: translateY(12px) scale(0.98);
    transition: transform 0.22s ease;
}

.tm-overlay.is-open {
    opacity: 1;
}

.tm-overlay.is-open > div {
    transform: translateY(0) scale(1);
}

.tm-modal-card > form {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    min-height: 0;
}

.tm-modal-body {
    max-height: 75vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

.tm-modal-body::-webkit-scrollbar {
    width: 8px;
}

.tm-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.tm-modal-body::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.tm-modal-card:is([data-pc-theme="dark"] *),
.tm-modal-card:is([data-pc-theme="dark"] *) .border,
.tm-modal-card:is([data-pc-theme="dark"] *) .border-t,
.tm-modal-card:is([data-pc-theme="dark"] *) .border-b,
.tm-modal-card:is([data-pc-theme="dark"] *) .border-l,
.tm-modal-card:is([data-pc-theme="dark"] *) .border-r {
    border-color: rgb(70 72 76);
}

.tm-modal-body:is([data-pc-theme="dark"] *) {
    scrollbar-color: #4b4e54 transparent;
}

.tm-modal-body:is([data-pc-theme="dark"] *)::-webkit-scrollbar-thumb {
    background: #4b4e54;
}
.modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: 520px;
    margin: 1.75rem auto;
    pointer-events: none;
}

.modal-lg {
    max-width: 820px;
}

.modal-xl {
    max-width: 1040px;
}

.modal-dialog-scrollable {
    height: calc(100% - 3.5rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    color: #1d2630;
    border-radius: 0.75rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

[data-pc-theme="dark"] .modal-content {
    background-color: #2b2c2f;
    color: #d1d5db;
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.modal-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em;
    color: inherit;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.7;
    cursor: pointer;
}

[data-pc-theme="dark"] .btn-close {
    filter: invert(1);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background-color: #000;
}

.modal-backdrop.show {
    opacity: 0.5;
}

body.modal-open {
    overflow: hidden;
}

.note-modal,
.note-popover {
    z-index: 2000 !important;
}

/* Saved Summernote HTML on the note detail page */
.rich-content {
    color: #1d2630;
    line-height: 1.7;
    word-break: break-word;
}

[data-pc-theme="dark"] .rich-content {
    color: #e5e7eb;
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content blockquote,
.rich-content pre,
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    margin: 0 0 0.75rem;
}

.rich-content h1 { font-size: 2rem; font-weight: 700; line-height: 1.25; }
.rich-content h2 { font-size: 1.7rem; font-weight: 700; line-height: 1.3; }
.rich-content h3 { font-size: 1.4rem; font-weight: 650; line-height: 1.35; }
.rich-content h4 { font-size: 1.2rem; font-weight: 650; }
.rich-content h5 { font-size: 1.05rem; font-weight: 650; }
.rich-content h6 { font-size: 0.95rem; font-weight: 650; }

.rich-content ul { list-style: disc; padding-left: 1.5rem; }
.rich-content ol { list-style: decimal; padding-left: 1.5rem; }
.rich-content li { margin: 0.2rem 0; }
.rich-content blockquote {
    border-left: 3px solid #eab308;
    padding-left: 0.9rem;
    opacity: 0.95;
}
.rich-content a { color: #2563eb; text-decoration: underline; }
[data-pc-theme="dark"] .rich-content a { color: #93c5fd; }
.rich-content img { max-width: 100%; height: auto; }

.rich-content font[size="1"] { font-size: 10px !important; }
.rich-content font[size="2"] { font-size: 13px !important; }
.rich-content font[size="3"] { font-size: 16px !important; }
.rich-content font[size="4"] { font-size: 18px !important; }
.rich-content font[size="5"] { font-size: 24px !important; }
.rich-content font[size="6"] { font-size: 32px !important; }
.rich-content font[size="7"] { font-size: 48px !important; }

.rich-content [align="center"],
.rich-content [style*="text-align: center"],
.rich-content [style*="text-align:center"] { text-align: center !important; }
.rich-content [align="right"],
.rich-content [style*="text-align: right"],
.rich-content [style*="text-align:right"] { text-align: right !important; }
.rich-content [align="left"],
.rich-content [style*="text-align: left"],
.rich-content [style*="text-align:left"] { text-align: left !important; }
.rich-content [align="justify"],
.rich-content [style*="text-align: justify"],
.rich-content [style*="text-align:justify"] { text-align: justify !important; }

.penalty-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.penalty-day {
    min-height: 2.75rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.75rem;
    padding: 0.35rem 0.4rem;
    background: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
}

[data-pc-theme="dark"] .penalty-day {
    background: rgba(15, 23, 42, 0.35);
    border-color: rgba(148, 163, 184, 0.2);
}

.penalty-day.is-empty {
    background: transparent;
    border-color: transparent;
}

.penalty-day.has-penalty {
    border-color: rgba(220, 53, 69, 0.55);
    background: rgba(220, 53, 69, 0.08);
}

.penalty-day-num {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}

.penalty-day-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #dc3545;
}

.note-editor.note-frame {
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
}

.note-editor .note-toolbar {
    background: #f8fafc !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.note-editor .note-btn,
.note-editor .note-btn i,
.note-editor .note-icon,
.note-editor .note-current-fontsize,
.note-editor .note-current-fontname,
.note-editor .note-dropdown-menu,
.note-editor .note-dropdown-item {
    color: #1d2630 !important;
}

.note-editor .note-btn {
    background: #fff !important;
    border-color: #e5e7eb !important;
}

.note-editor .note-dropdown-menu {
    background: #fff !important;
}

.note-editor .note-editing-area .note-editable {
    background: #fff !important;
    color: #1d2630 !important;
    font-size: 16px !important;
}

[data-pc-theme="dark"] .note-editor .note-toolbar,
[data-pc-theme="dark"] .note-editor .note-btn,
[data-pc-theme="dark"] .note-editor .note-dropdown-menu {
    background: #2b2c2f !important;
    border-color: #393b3f !important;
}

[data-pc-theme="dark"] .note-editor .note-btn,
[data-pc-theme="dark"] .note-editor .note-btn i,
[data-pc-theme="dark"] .note-editor .note-icon,
[data-pc-theme="dark"] .note-editor .note-current-fontsize,
[data-pc-theme="dark"] .note-editor .note-current-fontname,
[data-pc-theme="dark"] .note-editor .note-dropdown-item {
    color: #e5e7eb !important;
}

[data-pc-theme="dark"] .note-editor .note-editing-area .note-editable {
    background: #1f2023 !important;
    color: #e5e7eb !important;
}

.note-editor .note-editable font[size="1"],
.rich-content font[size="1"] { font-size: 10px !important; }
.note-editor .note-editable font[size="2"],
.rich-content font[size="2"] { font-size: 13px !important; }
.note-editor .note-editable font[size="3"],
.rich-content font[size="3"] { font-size: 16px !important; }
.note-editor .note-editable font[size="4"],
.rich-content font[size="4"] { font-size: 18px !important; }
.note-editor .note-editable font[size="5"],
.rich-content font[size="5"] { font-size: 24px !important; }
.note-editor .note-editable font[size="6"],
.rich-content font[size="6"] { font-size: 32px !important; }
.note-editor .note-editable font[size="7"],
.rich-content font[size="7"] { font-size: 48px !important; }

.note-editor .note-editable h1 { font-size: 2rem !important; }
.note-editor .note-editable h2 { font-size: 1.7rem !important; }
.note-editor .note-editable h3 { font-size: 1.4rem !important; }
.note-editor .note-editable h4 { font-size: 1.2rem !important; }
.note-editor .note-editable h5 { font-size: 1.05rem !important; }
.note-editor .note-editable h6 { font-size: 0.95rem !important; }

.penalty-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.6;
    padding-bottom: 0.25rem;
}

html[data-pc-theme="light"],
html:not([data-pc-theme="dark"]) {
    --tm-primary-bg: #4680ff;
    --tm-primary-fg: #ffffff;
    --tm-primary-border: #3a6fd8;
    --tm-secondary-bg: #64748b;
    --tm-secondary-fg: #ffffff;
    --tm-secondary-border: #556376;
    --tm-success-bg: rgba(34, 197, 94, 0.14);
    --tm-success-fg: #15803d;
    --tm-success-border: rgba(34, 197, 94, 0.35);
    --tm-warning-bg: rgba(245, 158, 11, 0.16);
    --tm-warning-fg: #b45309;
    --tm-warning-border: rgba(245, 158, 11, 0.38);
    --tm-danger-bg: rgba(239, 68, 68, 0.14);
    --tm-danger-fg: #b91c1c;
    --tm-danger-border: rgba(239, 68, 68, 0.35);
    --tm-info-bg: rgba(14, 165, 233, 0.14);
    --tm-info-fg: #0369a1;
    --tm-info-border: rgba(14, 165, 233, 0.35);
    --tm-neutral-bg: rgba(100, 116, 139, 0.12);
    --tm-neutral-fg: #475569;
    --tm-neutral-border: rgba(100, 116, 139, 0.28);
    --tm-accent-bg: rgba(168, 85, 247, 0.14);
    --tm-accent-fg: #7e22ce;
    --tm-accent-border: rgba(168, 85, 247, 0.35);
    --tm-primary-gradient: linear-gradient(135deg, #4680ff 0%, #5b7cff 50%, #7c3aed 100%);
    --tm-secondary-gradient: linear-gradient(135deg, #64748b 0%, #475569 100%);
    --tm-success-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --tm-warning-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    --tm-danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --tm-info-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --tm-accent-gradient: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

html[data-pc-theme="dark"] {
    --tm-primary-bg: #5b8cff;
    --tm-primary-fg: #f8fafc;
    --tm-primary-border: #4a78e6;
    --tm-secondary-bg: #475569;
    --tm-secondary-fg: #f1f5f9;
    --tm-secondary-border: #64748b;
    --tm-success-bg: rgba(34, 197, 94, 0.2);
    --tm-success-fg: #86efac;
    --tm-success-border: rgba(34, 197, 94, 0.45);
    --tm-warning-bg: rgba(245, 158, 11, 0.22);
    --tm-warning-fg: #fcd34d;
    --tm-warning-border: rgba(245, 158, 11, 0.45);
    --tm-danger-bg: rgba(239, 68, 68, 0.22);
    --tm-danger-fg: #fca5a5;
    --tm-danger-border: rgba(239, 68, 68, 0.45);
    --tm-info-bg: rgba(14, 165, 233, 0.22);
    --tm-info-fg: #7dd3fc;
    --tm-info-border: rgba(14, 165, 233, 0.45);
    --tm-neutral-bg: rgba(148, 163, 184, 0.18);
    --tm-neutral-fg: #cbd5e1;
    --tm-neutral-border: rgba(148, 163, 184, 0.35);
    --tm-accent-bg: rgba(168, 85, 247, 0.22);
    --tm-accent-fg: #d8b4fe;
    --tm-accent-border: rgba(168, 85, 247, 0.45);
    --tm-primary-gradient: linear-gradient(135deg, #5b8cff 0%, #6366f1 50%, #9333ea 100%);
    --tm-secondary-gradient: linear-gradient(135deg, #64748b 0%, #334155 100%);
    --tm-success-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
    --tm-warning-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    --tm-danger-gradient: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    --tm-info-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --tm-accent-gradient: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
}

.tm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tm-badge--primary {
    background: var(--tm-primary-bg);
    color: var(--tm-primary-fg);
    border-color: var(--tm-primary-border);
}

.tm-badge--secondary {
    background: var(--tm-secondary-bg);
    color: var(--tm-secondary-fg);
    border-color: var(--tm-secondary-border);
}

.tm-badge--success {
    background: var(--tm-success-bg);
    color: var(--tm-success-fg);
    border-color: var(--tm-success-border);
}

.tm-badge--warning {
    background: var(--tm-warning-bg);
    color: var(--tm-warning-fg);
    border-color: var(--tm-warning-border);
}

.tm-badge--danger {
    background: var(--tm-danger-bg);
    color: var(--tm-danger-fg);
    border-color: var(--tm-danger-border);
}

.tm-badge--info {
    background: var(--tm-info-bg);
    color: var(--tm-info-fg);
    border-color: var(--tm-info-border);
}

.tm-badge--neutral {
    background: var(--tm-neutral-bg);
    color: var(--tm-neutral-fg);
    border-color: var(--tm-neutral-border);
}

.tm-badge--accent {
    background: var(--tm-accent-bg);
    color: var(--tm-accent-fg);
    border-color: var(--tm-accent-border);
}

.tm-btn {
    border: 1px solid transparent;
    font-weight: 600;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.tm-btn:hover {
    filter: brightness(1.05);
}

.tm-btn:active {
    transform: translateY(1px);
}

.tm-btn--primary,
.btn.bg-theme-bg-1.text-white {
    background: var(--tm-primary-gradient) !important;
    color: var(--tm-primary-fg) !important;
    border-color: var(--tm-primary-border) !important;
    box-shadow: 0 4px 14px rgba(70, 128, 255, 0.25);
}

.tm-btn--secondary,
.btn.bg-theme-bg-2.text-white {
    background: var(--tm-secondary-gradient) !important;
    color: var(--tm-secondary-fg) !important;
    border-color: var(--tm-secondary-border) !important;
    box-shadow: 0 4px 14px rgba(71, 85, 105, 0.2);
}

.tm-btn--success {
    background: var(--tm-success-gradient);
    color: #fff;
    border-color: var(--tm-success-border);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.22);
}

.tm-btn--warning {
    background: var(--tm-warning-gradient);
    color: #fff;
    border-color: var(--tm-warning-border);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.22);
}

.tm-btn--danger,
.btn-danger.tm-btn {
    background: var(--tm-danger-gradient);
    color: #fff;
    border-color: var(--tm-danger-border);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.22);
}

.tm-btn--info {
    background: var(--tm-info-gradient);
    color: #fff;
    border-color: var(--tm-info-border);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.22);
}

.tm-btn--neutral {
    background: var(--tm-neutral-bg);
    color: var(--tm-neutral-fg);
    border-color: var(--tm-neutral-border);
}

.tm-btn--accent {
    background: var(--tm-accent-gradient);
    color: #fff;
    border-color: var(--tm-accent-border);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.22);
}

.tm-badge.tm-badge-block {
    display: inline-flex;
    margin-bottom: 0.25rem;
}

#themeToggle .theme-icon-light,
#themeToggle .theme-icon-dark {
    display: none;
}

html[data-pc-theme="light"] #themeToggle .theme-icon-light,
html:not([data-pc-theme="dark"]) #themeToggle .theme-icon-light {
    display: inline-block;
}

html[data-pc-theme="dark"] #themeToggle .theme-icon-dark {
    display: inline-block;
}

html[data-pc-theme="dark"] #themeToggle .theme-icon-light {
    display: none;
}

.flatpickr-calendar {
    z-index: 2100;
}

[data-pc-theme="dark"] .flatpickr-calendar,
[data-pc-theme="dark"] .flatpickr-months .flatpickr-month,
[data-pc-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
[data-pc-theme="dark"] .flatpickr-weekdays,
[data-pc-theme="dark"] span.flatpickr-weekday {
    background: #1b232d;
    color: #e5e7eb;
}

[data-pc-theme="dark"] .flatpickr-day {
    color: #e5e7eb;
}

[data-pc-theme="dark"] .flatpickr-day:hover,
[data-pc-theme="dark"] .flatpickr-day:focus {
    background: #334155;
    border-color: #334155;
}

[data-pc-theme="dark"] .flatpickr-day.flatpickr-disabled,
[data-pc-theme="dark"] .flatpickr-day.prevMonthDay,
[data-pc-theme="dark"] .flatpickr-day.nextMonthDay {
    color: #64748b;
}

[data-pc-theme="dark"] .flatpickr-months .flatpickr-prev-month,
[data-pc-theme="dark"] .flatpickr-months .flatpickr-next-month {
    fill: #e5e7eb;
    color: #e5e7eb;
}

html[data-pc-theme="light"],
html:not([data-pc-theme="dark"]) {
    --tm-input-border: rgb(190 200 208);
    --tm-input-bg: rgb(255 255 255);
    --tm-input-fg: rgb(29 38 48);
    --tm-input-placeholder: rgb(190 200 208);
    --tm-input-focus: rgb(4 169 245);
    --tm-input-focus-ring: rgb(4 169 245 / 0.12);
    --tm-input-hover-bg: rgb(248 250 252);
    --tm-input-option-hover: rgb(4 169 245 / 0.1);
    --tm-input-option-active: rgb(4 169 245 / 0.18);
    --tm-input-results-bg: rgb(255 255 255);
}

html[data-pc-theme="dark"] {
    --tm-input-border: rgb(70 72 76);
    --tm-input-bg: rgb(57 59 63);
    --tm-input-fg: rgb(231 233 235);
    --tm-input-placeholder: rgb(148 163 184);
    --tm-input-focus: rgb(4 169 245);
    --tm-input-focus-ring: rgb(4 169 245 / 0.2);
    --tm-input-hover-bg: rgb(64 66 70);
    --tm-input-option-hover: rgb(4 169 245 / 0.22);
    --tm-input-option-active: rgb(4 169 245 / 0.32);
    --tm-input-results-bg: rgb(47 49 53);
}

.select2-container {
    width: 100% !important;
    z-index: 2190;
}

.select2-container--open {
    z-index: 2200;
}

.select2-container--default .select2-selection--single {
    min-height: calc(2.5rem + 2px) !important;
    height: auto !important;
    border: 1px solid var(--tm-input-border) !important;
    border-radius: 0.25rem !important;
    background-color: var(--tm-input-bg) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.select2-container--default .select2-selection--single:hover {
    background-color: var(--tm-input-hover-bg) !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--tm-input-focus) !important;
    box-shadow: 0 0 0 1px var(--tm-input-focus-ring) !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0.625rem 2.25rem 0.625rem 1rem !important;
    line-height: 1.25 !important;
    font-size: 0.875rem !important;
    color: var(--tm-input-fg) !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--tm-input-placeholder) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 0.65rem !important;
    width: 1.25rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--tm-input-fg) transparent transparent transparent !important;
    opacity: 0.65;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--tm-input-focus) transparent !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    margin-right: 1.75rem;
    color: var(--tm-input-placeholder) !important;
    font-size: 1.1rem;
    line-height: 1;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--tm-input-focus) !important;
}

.select2-dropdown {
    border: 1px solid var(--tm-input-border) !important;
    border-radius: 0.25rem !important;
    background-color: var(--tm-input-results-bg) !important;
    color: var(--tm-input-fg) !important;
    z-index: 2200 !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 240px;
    background-color: var(--tm-input-results-bg) !important;
}

.select2-container--default .select2-search--dropdown {
    padding: 0.5rem 0.65rem 0.35rem !important;
    background: var(--tm-input-results-bg) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--tm-input-border) !important;
    border-radius: 0.25rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    background: var(--tm-input-bg) !important;
    color: var(--tm-input-fg) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--tm-input-focus) !important;
    box-shadow: 0 0 0 1px var(--tm-input-focus-ring) !important;
    outline: none !important;
}

.select2-container--default .select2-results__option {
    padding: 0.5rem 0.85rem !important;
    font-size: 0.875rem !important;
    color: var(--tm-input-fg) !important;
    background-color: transparent !important;
}

.select2-container--default .select2-results__option--selectable {
    cursor: pointer;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--tm-input-option-hover) !important;
    color: var(--tm-input-fg) !important;
}

.select2-container--default .select2-results__option--selected {
    background-color: var(--tm-input-option-active) !important;
    color: var(--tm-input-fg) !important;
    font-weight: 600;
}

.select2-container--default .select2-results__option--selected.select2-results__option--highlighted {
    background-color: var(--tm-input-option-active) !important;
}

.select2-container--default .select2-results__option[aria-disabled="true"] {
    color: var(--tm-input-placeholder) !important;
}

[data-pc-theme="dark"] .select2-dropdown,
html[data-pc-theme="dark"] .select2-dropdown {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-selection--single,
html[data-pc-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: rgb(57 59 63) !important;
    border-color: rgb(70 72 76) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-pc-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: rgb(231 233 235) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder,
html[data-pc-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgb(148 163 184) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b,
html[data-pc-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: rgb(231 233 235) transparent transparent transparent !important;
}

[data-pc-theme="dark"] .select2-dropdown,
html[data-pc-theme="dark"] .select2-dropdown {
    background-color: rgb(47 49 53) !important;
    border-color: rgb(70 72 76) !important;
    color: rgb(231 233 235) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-search--dropdown,
html[data-pc-theme="dark"] .select2-container--default .select2-search--dropdown {
    background: rgb(47 49 53) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field,
html[data-pc-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background: rgb(57 59 63) !important;
    border-color: rgb(70 72 76) !important;
    color: rgb(231 233 235) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-results > .select2-results__options,
html[data-pc-theme="dark"] .select2-container--default .select2-results > .select2-results__options {
    background-color: rgb(47 49 53) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-results__option,
html[data-pc-theme="dark"] .select2-container--default .select2-results__option {
    color: rgb(231 233 235) !important;
    background-color: transparent !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
html[data-pc-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: rgba(4, 169, 245, 0.22) !important;
    color: rgb(231 233 235) !important;
}

[data-pc-theme="dark"] .select2-container--default .select2-results__option--selected,
html[data-pc-theme="dark"] .select2-container--default .select2-results__option--selected {
    background-color: rgba(4, 169, 245, 0.32) !important;
    color: rgb(231 233 235) !important;
}


.select2.select2-container{
    margin-top: .5rem !important;
}

/* Auth: password visibility toggle */
.tm-password-field {
    position: relative;
}

.tm-password-field .form-control {
    padding-right: 2.75rem;
}

.tm-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    color: rgba(100, 116, 139, 0.95);
    border-radius: 0.5rem;
    cursor: pointer;
}

.tm-password-toggle:hover {
    color: rgb(51, 65, 85);
    background: rgba(148, 163, 184, 0.15);
}

.tm-password-toggle .hidden {
    display: none !important;
}

.tm-password-toggle i {
    font-size: 1.15rem;
    line-height: 1;
}

/* Auth: OTP digit boxes */
.tm-otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.tm-otp-digit {
    width: 100%;
    height: 3rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    border-radius: 0.75rem;
    padding-left: 0;
    padding-right: 0;
}

.tm-otp-digit:focus {
    border-color: rgb(4 169 245);
    box-shadow: 0 0 0 3px rgba(4, 169, 245, 0.18);
}

@media (min-width: 400px) {
    .tm-otp-boxes {
        gap: 0.65rem;
    }

    .tm-otp-digit {
        height: 3.25rem;
        font-size: 1.35rem;
    }
}

.auth-form .auth-card-wide {
    max-width: 420px;
}
