.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* ===== WorkTracker App Layout ===== */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
}

.wt-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wt-topbar {
    background: #0078d4;
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.wt-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.wt-topbar a, .wt-topbar button {
    color: white;
}

.wt-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.wt-topbar-bug-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
}

.wt-topbar-bug-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.wt-main {
    flex: 1;
    padding: 1rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Login Page ===== */

.wt-login-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.wt-user-name {
    display: none;
}

.wt-logout-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.wt-logout-btn:hover {
    background: rgba(255,255,255,0.25);
}

.wt-login-link {
    color: white;
    text-decoration: none;
}

@media (min-width: 600px) {
    .wt-user-name {
        display: inline;
    }
}

.wt-login-page {
    text-align: center;
    padding: 3rem 1rem;
}

.wt-login-page h1 {
    font-size: 2rem;
    color: #0078d4;
}

.wt-login-btn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
}

/* ===== Dashboard ===== */

.wt-dashboard {
    padding: 0.5rem 0;
}

.wt-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 1.5rem;
}

.wt-welcome {
    text-align: center;
    margin-bottom: 0;
    font-size: 1.4rem;
    color: #333;
}

.wt-gear-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background 0.15s;
    line-height: 1;
}

.wt-gear-btn:hover {
    background: rgba(0,0,0,0.06);
}

.wt-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.wt-header-actions .wt-gear-btn {
    position: static;
    right: auto;
    top: auto;
    transform: none;
}

.wt-bell-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f5;
    color: #555;
    border: 1px solid #d9d9d9;
    font-size: 1.15rem;
    line-height: 1;
    border-radius: 999px;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wt-bell-btn-idle {
    cursor: default;
}

.wt-bell-btn-alert {
    background: #f8d7da;
    color: #b71c1c;
    border-color: #ef9a9a;
    animation: wt-bell-glow 1.1s ease-in-out infinite, wt-bell-wiggle 1.3s ease-in-out infinite;
}

.wt-bell-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #d32f2f;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1rem;
}

@keyframes wt-bell-glow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(211, 47, 47, 0);
        background: #f8d7da;
    }
    50% {
        box-shadow: 0 0 0.5rem rgba(211, 47, 47, 0.75);
        background: #ffcdd2;
    }
}

@keyframes wt-bell-wiggle {
    0%, 100% {
        transform: translateY(-50%) rotate(0deg);
    }
    20% {
        transform: translateY(-50%) rotate(-12deg);
    }
    40% {
        transform: translateY(-50%) rotate(10deg);
    }
    60% {
        transform: translateY(-50%) rotate(-8deg);
    }
    80% {
        transform: translateY(-50%) rotate(6deg);
    }
}

.wt-button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.wt-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    min-height: 140px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.wt-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.wt-tile:active {
    transform: scale(0.97);
}

.wt-tile-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.wt-tile-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

/* ===== Page Layout ===== */

.wt-page {
    padding: 0.5rem 0;
}

.wt-page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.wt-page-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.wt-back-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: #0078d4;
    white-space: nowrap;
}

.wt-back-btn:hover {
    background: #e8f0fe;
}

/* Use the layout-level back button; suppress per-page header back/home buttons. */
.wt-page-header .wt-back-btn {
    display: none !important;
}

/* ===== Placeholder (Coming Soon) ===== */

.wt-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 16px;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wt-placeholder-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}

.wt-placeholder h3 {
    margin: 0 0 0.5rem;
    color: #666;
}

/* ===== Common Components ===== */

.wt-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.wt-error {
    background: #fde8e8;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.wt-muted {
    color: #888;
    font-style: italic;
}

.wt-section {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wt-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: #333;
}

/* ===== Buttons ===== */

.wt-btn {
    background: #0078d4;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

.wt-btn:hover:not(:disabled) {
    background: #005a9e;
}

.wt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wt-btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.wt-btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.wt-btn-primary {
    background: #0078d4;
}

.wt-btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
}

.wt-btn-icon.wt-btn-danger:hover {
    color: #c62828;
}

/* ===== Form Controls ===== */

.wt-input, .wt-textarea, .wt-select, .wt-date-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.wt-textarea {
    resize: vertical;
}

.wt-inline-edit {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.wt-inline-edit > span {
    flex: 1 1 auto;
    min-height: 2.1rem;
    display: flex;
    align-items: center;
    white-space: pre-wrap;
    word-break: break-word;
}

.wt-inline-edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wt-inline-edit-heading {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.wt-inline-edit-heading > label {
    margin: 0;
}

.wt-inline-edit-pencil {
    font-size: 0.9rem;
    line-height: 1;
    padding: 0.05rem 0.15rem;
}

.wt-inline-edit-value {
    min-height: 2.1rem;
    display: flex;
    align-items: center;
    white-space: pre-wrap;
    word-break: break-word;
}

.wt-part-image-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.wt-part-image {
    max-width: 220px;
    max-height: 220px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.wt-part-image-wrap label,
.wt-part-file-actions {
    position: relative;
}

.wt-part-image-wrap label input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wt-part-file-actions {
    margin-top: 0.4rem;
    display: flex;
    gap: 0.5rem;
}

.wt-btn-xs-remove {
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
}

.wt-part-detail-page .wt-section h3 {
    margin-bottom: 0.45rem;
}

.wt-part-detail-page .wt-p2p-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem 1.6rem;
}

.wt-part-detail-page .wt-p2p-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.wt-part-detail-page .wt-p2p-field > label {
    margin-bottom: 0.05rem;
    font-weight: 600;
    color: #4a4a4a;
}

.wt-part-detail-page .wt-p2p-field-wide {
    grid-column: span 2;
}

.wt-part-detail-page .wt-part-media-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.wt-part-detail-page .wt-part-media-image {
    min-width: 240px;
}

.wt-part-detail-page .wt-part-media-files {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.wt-part-detail-page .wt-er-dropzone {
    max-width: 280px;
    min-height: 64px;
    padding: 0.6rem 0.75rem;
}

.wt-part-detail-page .wt-part-file-dropzone {
    max-width: 140px;
    min-height: 32px;
    padding: 0.3rem 0.4rem;
}

.wt-part-detail-page .wt-part-file-dropzone-horizontal {
    min-width: 210px;
    max-width: 260px;
    min-height: 38px;
    padding: 0.35rem 0.55rem;
}

.wt-part-detail-page .wt-er-dropzone-icon {
    font-size: 1.15rem;
}

.wt-part-detail-page .wt-er-dropzone-text {
    font-size: 0.76rem;
}

.wt-part-detail-page .wt-link {
    color: #1565c0;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.wt-part-file-heading {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wt-part-file-heading label {
    margin: 0;
}

.wt-part-file-heading-edit {
    font-size: 0.95rem;
    padding: 0.05rem 0.15rem;
}

.wt-part-file-upload-controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.wt-part-file-download-status {
    margin-top: 0.15rem;
    margin-bottom: 0;
}

.wt-part-file-choose-btn {
    position: relative;
    overflow: hidden;
}

.wt-part-file-choose-btn input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wt-part-file-edit {
    position: absolute;
    top: 0.15rem;
    right: 0.2rem;
    z-index: 2;
}

.wt-part-file-edit input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wt-part-file-edit-outside {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    background: #fff;
    color: #2c3e50;
}

.wt-part-file-edit-outside input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wt-part-code-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.wt-part-code-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wt-part-code-card > label {
    margin: 0;
}

.wt-part-code-image-wrap {
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    background: #fff;
    padding: 0.3rem;
}

.wt-part-code-image {
    display: block;
}

.wt-part-code-image-barcode {
    width: 210px;
    height: auto;
}

.wt-part-code-image-qr {
    width: 96px;
    height: 96px;
}

.wt-inventory-row-clickable {
    cursor: pointer;
}

.wt-inventory-row-clickable:hover {
    background: #f5f9ff;
}

@media (max-width: 900px) {
    .wt-part-detail-page .wt-p2p-field-wide {
        grid-column: span 1;
    }

    .wt-part-detail-page .wt-part-media-files {
        width: 100%;
    }
}

/* ===== Daily Scrum ===== */

.wt-date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.wt-date-nav .wt-date-input {
    flex: 1;
    min-width: 140px;
}

.wt-scrum-status {
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.wt-status-submitted {
    background: #e8f5e9;
    color: #2e7d32;
}

.wt-status-draft {
    background: #fff3e0;
    color: #ef6c00;
}

.wt-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.wt-quick-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.wt-timeslots {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.wt-timeslot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.wt-slot-active {
    background: #e3f2fd;
}

.wt-slot-off {
    background: #f5f5f5;
    opacity: 0.7;
}

.wt-slot-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    flex-shrink: 0;
}

.wt-slot-time {
    white-space: nowrap;
    min-width: 130px;
    font-size: 0.85rem;
}

.wt-slot-location {
    flex: 1;
    padding: 0.2rem 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.8rem;
    min-width: 0;
}

/* ===== Task List ===== */

.wt-task-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wt-task-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    gap: 0.5rem;
}

.wt-task-card-compact {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.wt-task-added {
    opacity: 0.6;
}

.wt-task-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.wt-task-info strong {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wt-task-desc {
    font-size: 0.85rem;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wt-task-meta {
    font-size: 0.75rem;
    color: #888;
}

.wt-task-single-line {
    display: block;
    font-size: 0.85rem;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wt-added-badge {
    font-size: 0.75rem;
    color: #2e7d32;
    font-weight: 600;
    white-space: nowrap;
}

.wt-add-task {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.wt-add-task .wt-input {
    flex: 1;
}

.wt-submit-section {
    text-align: center;
}

/* --- Daily Scrum: Task Search / Filter / Sort Controls --- */

.wt-scrum-task-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.wt-scrum-task-search {
    flex: 1;
    min-width: 140px;
}

.wt-scrum-task-filter,
.wt-scrum-task-sort {
    width: auto;
    min-width: 120px;
    flex: 0 1 auto;
}

.wt-scrum-task-pane {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem;
    background: #fafafa;
}

/* ===== Checklists ===== */

.wt-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wt-filter-row .wt-select {
    flex: 1;
    max-width: 250px;
}

.wt-checklist-toggle-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wt-checklist-create-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.wt-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wt-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.wt-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.wt-card-header strong {
    font-size: 0.95rem;
}

.wt-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.wt-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wt-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.wt-badge-notstarted { background: #e0e0e0; color: #555; }
.wt-badge-workinprogress { background: #fff3e0; color: #ef6c00; }
.wt-badge-underreview { background: #e3f2fd; color: #1565c0; }
.wt-badge-complete { background: #e8f5e9; color: #2e7d32; }
.wt-badge-draft { background: #fff3e0; color: #ef6c00; }
.wt-badge-submitted { background: #e3f2fd; color: #1565c0; }
.wt-badge-pendingapproval { background: #e3f2fd; color: #1565c0; }
.wt-badge-approved { background: #e8f5e9; color: #2e7d32; }
.wt-badge-rejected { background: #fde8e8; color: #c62828; }
.wt-badge-closed { background: #e0e0e0; color: #555; }
.wt-badge-qboload { background: #f3e5f5; color: #7b1fa2; }

.wt-form-users-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    background: #fafafa;
}

.wt-progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.wt-progress-sm {
    height: 6px;
}

.wt-progress-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.wt-progress-text {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

.wt-checklist-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.wt-checklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wt-checklist-item {
    padding: 0.6rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
}

.wt-item-completed {
    background: #f1f8e9;
    border-color: #c5e1a5;
}

.wt-check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

.wt-check-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.wt-check-text {
    font-size: 0.9rem;
}

.wt-text-strike {
    text-decoration: line-through;
    color: #888;
}

.wt-item-meta {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
    padding-left: 1.75rem;
}

.wt-item-notes {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.25rem;
    padding-left: 1.75rem;
    font-style: italic;
}

/* ===== Responsive ===== */

@media (min-width: 600px) {
    .wt-button-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .wt-tile {
        min-height: 160px;
        padding: 2rem 1.5rem;
    }

    .wt-tile-icon {
        font-size: 3rem;
    }

    .wt-tile-label {
        font-size: 1.1rem;
    }
}

@media (max-width: 400px) {
    .wt-tile {
        min-height: 110px;
        padding: 1rem 0.75rem;
    }

    .wt-tile-icon {
        font-size: 2rem;
    }

    .wt-tile-label {
        font-size: 0.85rem;
    }
}

/* ===== Blazor Infrastructure ===== */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.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."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* ===== Timesheet ===== */

.wt-ts-month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.wt-ts-month-title {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
}

.wt-ts-calendar {
    overflow-x: auto;
}

.wt-ts-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.wt-ts-cal-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.wt-ts-cal-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 8px;
    cursor: pointer;
    padding: 0.2rem;
    transition: background 0.15s;
    font-size: 0.85rem;
}

.wt-ts-cal-cell:hover:not(.wt-ts-cal-empty) {
    background: #e3f2fd;
}

.wt-ts-cal-empty {
    cursor: default;
}

.wt-ts-cal-selected {
    background: #0078d4 !important;
    color: white;
}

.wt-ts-cal-selected .wt-ts-cal-hours {
    color: rgba(255,255,255,0.85);
}

.wt-ts-cal-today {
    outline: 2px solid #0078d4;
    outline-offset: -2px;
}

.wt-ts-cal-submitted {
    background: #e8f5e9;
}

.wt-ts-cal-day {
    font-weight: 600;
    font-size: 0.8rem;
}

.wt-ts-cal-hours {
    font-size: 0.65rem;
    color: #666;
    font-weight: 500;
}

.wt-ts-hours-full {
    color: #2e7d32;
    font-weight: 700;
}

.wt-ts-day-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wt-ts-day-header h3 {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 1rem;
}

.wt-ts-week-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #555;
}

.wt-ts-entries {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wt-ts-entry {
    padding: 0.65rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.wt-ts-entry-approved {
    border-left: 3px solid #4caf50;
}

.wt-ts-entry-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wt-ts-entry-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.wt-ts-entry-info strong {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wt-ts-entry-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.wt-ts-hours-display {
    font-weight: 700;
    font-size: 1rem;
    color: #0078d4;
    min-width: 3rem;
    text-align: right;
}

.wt-ts-hours-input {
    width: 5rem !important;
    text-align: center;
}

.wt-ts-desc-input {
    width: 14rem !important;
}

.wt-ts-top-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.wt-ts-submit-dock {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.wt-ts-submit-status {
    margin: 0;
    text-align: right;
    font-size: 0.8rem;
}

.wt-ts-common-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wt-ts-common-card {
    cursor: pointer;
    padding: 0.5rem;
}

.wt-ts-common-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wt-ts-record-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
}

.wt-ts-add-form {
    border: 2px solid #0078d4;
}

.wt-ts-form-info {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.wt-ts-form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.wt-ts-form-row label {
    min-width: 4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.wt-ts-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* --- Timesheet Action Buttons --- */

.wt-ts-action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.wt-ts-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f0f6ff;
    color: #0078d4;
    border: 2px solid #cce0f5;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.wt-ts-action-btn:hover {
    background: #dbeafe;
    border-color: #0078d4;
}

.wt-ts-action-icon {
    font-size: 1.5rem;
}

@media (max-width: 500px) {
    .wt-ts-action-buttons {
        grid-template-columns: 1fr;
    }
}

/* --- Timesheet Picker Panel --- */

.wt-ts-picker {
    border: 2px solid #0078d4;
    max-height: 60vh;
    overflow-y: auto;
}

.wt-ts-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.wt-ts-picker-header h3 {
    margin: 0;
}

.wt-ts-picker-subhead {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin: 0.75rem 0 0.4rem;
}

/* --- Search Bar --- */

.wt-ts-search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: nowrap;
}

.wt-ts-search-bar .wt-input {
    flex: 1;
    min-width: 0;
}

.wt-ts-search-old {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
}

@media (max-width: 760px) {
    .wt-ts-top-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .wt-ts-submit-dock {
        justify-content: flex-start;
    }

    .wt-ts-search-bar {
        flex-wrap: wrap;
    }
}

/* --- Overtime Badge & Toggle --- */

.wt-ts-entry-overtime {
    border-left: 3px solid #ef6c00;
}

.wt-ts-ot-badge {
    color: #ef6c00;
    font-weight: 700;
    font-size: 0.8rem;
}

.wt-ts-ot-active {
    color: #ef6c00 !important;
    font-weight: 700;
}

.wt-ts-ot-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.wt-ts-ot-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.wt-ts-timeoff-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.wt-ts-timeoff-summary-head h3 {
    margin: 0;
}

.wt-ts-timeoff-summary-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.wt-ts-timeoff-summary-card {
    border: 1px solid #d5e4f5;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    background: #f7fbff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wt-ts-timeoff-summary-label {
    color: #4a4a4a;
    font-size: 0.9rem;
}

.wt-ts-timeoff-dialog {
    width: min(760px, 94vw);
    max-height: min(85vh, 820px);
    overflow-y: auto;
}

.wt-ts-timeoff-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.wt-ts-timeoff-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #555;
}

.wt-ts-timeoff-balance-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.wt-ts-timeoff-balance-grid > div {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.wt-ts-timeoff-balance-grid > div span {
    font-size: 0.75rem;
    color: #666;
}

.wt-ts-timeoff-balance-total {
    border-color: #0078d4 !important;
    background: #f0f7ff;
}

.wt-ts-timeoff-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.wt-ts-timeoff-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    font-size: 0.88rem;
}

.wt-ts-timeoff-planned {
    color: #b54800;
}

/* ===== Project Lookup ===== */

.wt-proj-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.wt-proj-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    border: 1px solid #e0e0e0;
}

.wt-proj-list-item:hover {
    background: #e3f2fd;
    border-color: #0078d4;
}

.wt-proj-list-num {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0078d4;
    min-width: 80px;
    flex-shrink: 0;
}

.wt-proj-list-desc {
    font-size: 0.9rem;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Sortable Table Headers --- */

.wt-sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}

.wt-sortable-th:hover {
    background: #e3f2fd;
}

/* --- Project Table --- */

.wt-proj-table {
    border-collapse: collapse;
}

.wt-proj-table-row {
    cursor: pointer;
    transition: background 0.12s;
}

.wt-proj-table-row:hover {
    background: #e3f2fd !important;
}

.wt-proj-table td.wt-proj-list-num {
    font-weight: 700;
    color: #0078d4;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    background: transparent;
    min-height: auto;
    display: table-cell;
    border-radius: 0;
}

.wt-proj-direct-lookup {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
}

.wt-proj-direct-lookup .wt-input {
    flex: 1;
}

.wt-proj-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.wt-proj-detail-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.wt-proj-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 500px) {
    .wt-proj-grid {
        grid-template-columns: 1fr;
    }
}

.wt-proj-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.wt-proj-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wt-proj-field span {
    font-size: 0.95rem;
    color: #1a1a1a;
    padding: 0.35rem 0.5rem;
    background: #f5f5f5;
    border-radius: 6px;
    min-height: 2rem;
    display: flex;
    align-items: center;
}

.wt-proj-status {
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    display: inline-block;
}

.wt-proj-status-inprogress {
    background: #fff3e0;
    color: #ef6c00;
}

.wt-proj-status-complete {
    background: #e8f5e9;
    color: #2e7d32;
}

.wt-proj-status-notstarted {
    background: #f5f5f5;
    color: #757575;
}

/* --- Workorder Tree --- */

.wt-tree {
    padding-left: 0;
}

.wt-tree-node {
    margin-bottom: 0.15rem;
}

.wt-tree-children {
    padding-left: 1.25rem;
    border-left: 2px solid #e0e0e0;
    margin-left: 0.5rem;
}

.wt-tree-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.wt-tree-toggle {
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
    font-size: 0.85rem;
    user-select: none;
}

.wt-tree-toggle-spacer {
    flex-shrink: 0;
    width: 1rem;
}

.wt-tree-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wt-tree-status {
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.wt-tree-complete {
    background: #e8f5e9;
}

.wt-tree-complete .wt-tree-status {
    color: #2e7d32;
}

.wt-tree-inprogress {
    background: #fff3e0;
}

.wt-tree-inprogress .wt-tree-status {
    color: #ef6c00;
}

.wt-tree-notstarted {
    background: #f5f5f5;
}

.wt-tree-notstarted .wt-tree-status {
    color: #757575;
}

.wt-tree-underreview {
    background: #e0f7fa;
}

.wt-tree-underreview .wt-tree-status {
    color: #00796b;
}

.wt-tree-cancelled {
    background: #fafafa;
    text-decoration: line-through;
    opacity: 0.6;
}

.wt-tree-cancelled .wt-tree-status {
    color: #999;
}

/* --- Data Tables --- */

.wt-table-wrap {
    overflow-x: auto;
}

.wt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.wt-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.wt-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.wt-table tbody tr:hover {
    background: #f8f9fa;
}

.wt-table-grid th,
.wt-table-grid td {
    border: 1px solid #e0e0e0;
}

.wt-table-grid th {
    border-bottom-width: 1px;
}

.wt-sort-header {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.wt-sort-header:hover {
    color: #1565c0;
}

.wt-col-right {
    text-align: right;
}

.wt-col-center {
    text-align: center;
}

/* --- Project Section Header --- */

.wt-proj-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.wt-proj-section-header h3 {
    margin: 0;
}

/* --- Project Finance Note --- */

.wt-proj-finance-note {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin: 0 0 0.75rem;
}

/* --- Negative Balance --- */

.wt-proj-balance-negative {
    color: #c62828 !important;
    font-weight: 600;
}

/* --- Table Totals Row --- */

.wt-table tfoot .wt-table-total td {
    border-top: 2px solid #e0e0e0;
    border-bottom: none;
    padding-top: 0.6rem;
    font-size: 0.9rem;
}

/* --- Paid Invoice Row --- */

.wt-table-row-paid td {
    color: #2e7d32;
}

/* --- Tree Legend --- */

.wt-tree-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.wt-tree-legend-item {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

/* --- Time History Summary --- */

.wt-proj-time-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #555;
    flex-wrap: wrap;
    align-items: center;
}

/* --- Time History Date Filters --- */

.wt-time-date-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.wt-time-date-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.wt-time-date-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
}

.wt-time-date-field input[type="date"] {
    width: auto;
    min-width: 140px;
}

/* --- Compact Table --- */

.wt-table-compact th,
.wt-table-compact td {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

.wt-table-compact th {
    font-size: 0.7rem;
}

/* ===== Task Lookup ===== */

.wt-wo-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.wt-wo-search-row .wt-input:first-child {
    flex: 1;
    min-width: 200px;
}

.wt-wo-direct-input {
    width: 130px !important;
    flex: none !important;
}

.wt-task-card-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.wt-task-card-clickable:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #0078d4;
}

.wt-wo-status-inline {
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    display: inline-block;
}

.wt-wo-status-inprogress { background: #fff3e0; color: #ef6c00; }
.wt-wo-status-notstarted { background: #f5f5f5; color: #757575; }
.wt-wo-status-underreview { background: #e0f7fa; color: #00796b; }
.wt-wo-status-complete { background: #e8f5e9; color: #2e7d32; }
.wt-wo-status-cancelled, .wt-wo-status-deleted { background: #fafafa; color: #999; }
.wt-wo-status-returned { background: #fce4ec; color: #c62828; }
.wt-wo-status-accepted { background: #e3f2fd; color: #1565c0; }

.wt-wo-due-late {
    color: #c62828 !important;
    font-weight: 600;
}

.wt-wo-due-ok {
    color: #2e7d32 !important;
    font-weight: 600;
}

.wt-wo-notes {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* --- Task Lookup: Status Bar --- */

.wt-wo-status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.wt-wo-status-lg {
    font-size: 1rem !important;
    padding: 0.3rem 0.75rem !important;
}

.wt-wo-status-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wt-wo-status-btn-inprogress { background: #ef6c00; }
.wt-wo-status-btn-inprogress:hover:not(:disabled) { background: #e65100; }
.wt-wo-status-btn-complete { background: #2e7d32; }
.wt-wo-status-btn-complete:hover:not(:disabled) { background: #1b5e20; }
.wt-wo-status-btn-cancelled { background: #757575; }
.wt-wo-status-btn-cancelled:hover:not(:disabled) { background: #616161; }
.wt-wo-status-btn-deleted { background: #c62828; }
.wt-wo-status-btn-deleted:hover:not(:disabled) { background: #b71c1c; }
.wt-wo-status-btn-returned { background: #6a1b9a; }
.wt-wo-status-btn-returned:hover:not(:disabled) { background: #4a148c; }

/* --- Task Lookup: Save Feedback --- */

.wt-wo-save-ok {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

/* --- Task Lookup: Small Input --- */

.wt-wo-small-input {
    width: 100px !important;
}

/* --- Task Lookup: Wide Field --- */

.wt-proj-field-wide {
    grid-column: 1 / -1;
}

/* ===== Role Management ===== */

.wt-role-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wt-role-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}

.wt-role-item:hover {
    border-color: #0078d4;
    background: #f0f6ff;
}

.wt-role-assigned {
    border-left: 3px solid #4caf50;
    background: #f1f8e9;
}

.wt-role-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    flex: 1;
}

.wt-role-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #0078d4;
}

.wt-role-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.wt-role-badge-active {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background: #e8f5e9;
    color: #2e7d32;
    white-space: nowrap;
}

.wt-role-changes {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    background: #f5f5f5;
    font-size: 0.9rem;
}

.wt-role-change-add {
    color: #2e7d32;
    margin: 0 0 0.25rem;
}

.wt-role-change-remove {
    color: #c62828;
    margin: 0;
}

.wt-role-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

/* ===== Expense Reports ===== */

.wt-er-form-group {
    margin-bottom: 0.75rem;
}

.wt-er-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.25rem;
}

.wt-er-project-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.wt-er-project-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s;
}

.wt-er-project-item:last-child {
    border-bottom: none;
}

.wt-er-project-item:hover {
    background: #e8f0fe;
}

.wt-er-project-selected {
    background: #d0e4ff;
    border-left: 3px solid #0078d4;
}

.wt-er-project-item strong {
    font-size: 0.9rem;
    min-width: 70px;
}

.wt-er-project-item span {
    font-size: 0.85rem;
    color: #555;
}

.wt-er-line-editor {
    border: 2px solid #0078d4;
    background: #f8fbff;
}

.wt-er-line-editor h4 {
    margin: 0 0 0.75rem;
    color: #0078d4;
}

.wt-er-perdiem-group {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.wt-er-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.wt-er-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.wt-er-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0078d4;
}

.wt-er-input-group {
    display: flex;
    align-items: center;
}

.wt-er-input-prefix {
    background: #e0e0e0;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 0.5rem 0.5rem;
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
    line-height: 1;
}

.wt-er-input-group .wt-input {
    border-radius: 0 6px 6px 0;
    flex: 1;
    min-width: 0;
}

.wt-er-amounts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 500px) {
    .wt-er-amounts-grid {
        grid-template-columns: 1fr;
    }
}

.wt-er-line-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* --- Drag & Drop Upload Zone --- */

.wt-er-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.25rem 1rem;
    border: 2px dashed #b0bec5;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    min-height: 90px;
}

.wt-er-dropzone:hover {
    border-color: #0078d4;
    background: #f0f6ff;
}

.wt-er-dropzone-active {
    border-color: #0078d4;
    background: #dbeafe;
    border-style: solid;
}

.wt-er-dropzone-has-file {
    border-color: #4caf50;
    background: #f1f8e9;
}

.wt-er-dropzone-has-file:hover {
    border-color: #388e3c;
    background: #e8f5e9;
}

.wt-er-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wt-er-dropzone-icon {
    font-size: 1.75rem;
}

.wt-er-dropzone-text {
    font-size: 0.85rem;
    color: #666;
}

.wt-er-dropzone-file {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2e7d32;
}

/* --- Receipt Capture Button --- */

.wt-er-capture-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.35rem;
}

.wt-btn-capture {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border: 2px solid #0078d4;
    border-radius: 8px;
    background: #e3f2fd;
    color: #0d47a1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}

.wt-btn-capture:hover:not(:disabled) {
    background: #bbdefb;
    border-color: #0d47a1;
}

.wt-btn-capture:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wt-btn-capture input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* --- Receipt Capture Modal --- */

.wt-receipt-capture-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 95vw;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wt-dialog-in 0.15s ease-out;
}

.wt-receipt-capture-body {
    flex: 1;
    overflow: hidden;
    padding: 0.75rem 1rem;
    min-height: 300px;
}

.wt-receipt-cropper-container {
    position: relative;
    width: 100%;
    height: 55vh;
    height: 55svh;
    min-height: 200px;
    max-height: 60svh;
    overflow: hidden;
    touch-action: none;
}

.wt-receipt-cropper-img {
    display: block;
    max-width: 100%;
}

/* Improve touch hit targets for Cropper.js handles on phones/tablets. */
@media (hover: none), (pointer: coarse) {
    .wt-receipt-cropper-container .cropper-point {
        width: 20px;
        height: 20px;
        opacity: 0.95;
    }

    .wt-receipt-cropper-container .cropper-point.point-n,
    .wt-receipt-cropper-container .cropper-point.point-s {
        margin-left: -10px;
    }

    .wt-receipt-cropper-container .cropper-point.point-e,
    .wt-receipt-cropper-container .cropper-point.point-w {
        margin-top: -10px;
    }

    .wt-receipt-cropper-container .cropper-point.point-ne,
    .wt-receipt-cropper-container .cropper-point.point-nw,
    .wt-receipt-cropper-container .cropper-point.point-sw,
    .wt-receipt-cropper-container .cropper-point.point-se {
        width: 24px;
        height: 24px;
    }

    .wt-receipt-cropper-container .cropper-line {
        background-color: rgba(51, 153, 255, 0.95);
    }
}

/* ===== Confirm Dialog / Input Dialog ===== */

.wt-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.wt-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: wt-dialog-in 0.15s ease-out;
}

@keyframes wt-dialog-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wt-dialog-header {
    padding: 1rem 1.25rem 0.5rem;
}

.wt-dialog-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.wt-dialog-body {
    padding: 0.75rem 1.25rem;
}

.wt-dialog-body p {
    margin: 0;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}

.wt-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1rem;
}

.wt-btn-secondary {
    background: #666;
}

.wt-btn-secondary:hover:not(:disabled) {
    background: #555;
}

/* ===== RichTextEditor Component ===== */

.wt-rte-wrapper {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wt-rte-wrapper:focus-within {
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.15);
}

.wt-rte-wrapper.wt-rte-readonly {
    border-color: #e5e7eb;
    background: #fafafa;
}

.wt-rte-wrapper.wt-rte-readonly:focus-within {
    border-color: #e5e7eb;
    box-shadow: none;
}

/* Toolbar */
.wt-rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #f8f9fa;
    border-bottom: none;
    margin-bottom: 6px;
    user-select: none;
}

.wt-rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #374151;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.wt-rte-btn:hover {
    background: #e5e7eb;
}

.wt-rte-btn:active {
    background: #d1d5db;
}

.wt-rte-btn-ts {
    font-size: 0.9rem;
}

.wt-rte-sep {
    width: 1px;
    height: 20px;
    background: #d1d5db;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Editable content area */
.wt-rte-content {
    min-height: 120px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px 12px;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
    color: #1a1a1a;
    word-wrap: break-word;
}

.wt-rte-content:focus {
    background: transparent;
}

.wt-rte-content:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.wt-rte-content a {
    color: #0078d4;
    text-decoration: underline;
}

.wt-rte-content ul,
.wt-rte-content ol {
    margin: 0.25em 0;
    padding-left: 2em;
    list-style-position: outside;
}

.wt-rte-content ul[style],
.wt-rte-content ol[style] {
    margin-left: 0 !important;
    padding-left: 2em !important;
    text-indent: 0 !important;
}

.wt-rte-content ul {
    list-style-type: disc;
}

.wt-rte-content ol {
    list-style-type: decimal;
}

.wt-rte-content li {
    padding-left: 0.25em;
    margin-bottom: 0.15em;
    margin-left: 0;
    text-indent: 0;
}

.wt-rte-content li[style] {
    margin-left: 0 !important;
    text-indent: 0 !important;
}

.wt-rte-content p {
    margin: 0.25em 0;
}

/* Read-only state */
.wt-rte-readonly .wt-rte-content {
    background: #f5f5f5;
    border-color: #e5e7eb;
    color: #4b5563;
    cursor: default;
}

.wt-rte-mention-suggestions {
    position: fixed;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    max-height: 180px;
    overflow-y: auto;
    min-width: 220px;
    z-index: 5000;
}

.wt-rte-mention-option {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.45rem 0.65rem;
    font-size: 0.88rem;
    cursor: pointer;
    color: #1f2328;
}

.wt-rte-mention-option:hover {
    background: #e7f3ff;
}

.wt-rte-mention-token {
    color: #0969da !important;
    font-weight: 700 !important;
    font-style: normal !important;
    text-decoration: none !important;
}

/* ===== Password Vault ===== */

.wt-vault-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.wt-vault-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.35rem;
    flex-wrap: wrap;
}

.wt-vault-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.wt-vault-reveal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.wt-vault-otp-ring {
    --remaining: 1;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #2563eb;
    background: conic-gradient(#2563eb calc(var(--remaining) * 1turn), #dbeafe 0turn);
    transform: rotate(-90deg);
    display: inline-block;
    flex: 0 0 auto;
}

.wt-vault-revealed {
    margin-top: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.wt-vault-revealed-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.wt-vault-inline-status {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    display: inline-block;
}

.wt-vault-password-input {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.wt-vault-password-input .wt-input {
    flex: 1;
}

.wt-vault-entry-type-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.wt-vault-otp-source-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.wt-vault-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #ffffff !important;
    background: #1f2937 !important;
    border: 1px solid #111827 !important;
    font-weight: 600;
}

.wt-vault-file-label:hover:not(:disabled) {
    background: #111827 !important;
    color: #ffffff !important;
}

.wt-vault-file-label:focus-within {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.wt-vault-file-label input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.wt-vault-gen-options {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.wt-vault-gen-options label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.wt-vault-generated {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 6px;
}

.wt-vault-generated code {
    flex: 1;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.95rem;
    word-break: break-all;
}

.wt-vault-status {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: wt-vault-fadein 0.2s ease;
}

.wt-vault-status.wt-success {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.wt-vault-status.wt-error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.wt-vault-disclaimer {
    margin-top: 1rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.82rem;
}

.wt-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1rem;
    padding-bottom: 1rem;
}

.wt-auth-disclaimer {
    max-width: 860px;
    margin: 0 auto;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
}

.wt-auth-disclaimer h3 {
    margin: 0 0 0.45rem 0;
    text-align: center;
    color: #0f172a;
}

.wt-auth-disclaimer p {
    margin: 0;
    line-height: 1.45;
    text-align: center;
}

@keyframes wt-vault-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.wt-badge-good {
    background: #10b981;
    color: white;
}

.wt-badge-warning {
    background: #f59e0b;
    color: white;
}

.wt-badge-danger {
    background: #ef4444;
    color: white;
}

.wt-btn.wt-btn-danger {
    background: #ef4444;
    color: white;
}

.wt-btn.wt-btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.wt-btn-icon.wt-btn-danger {
    background: transparent;
    color: #ef4444;
}

.wt-vault-admin-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.wt-vault-admin-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.wt-vault-kpi-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 0.75rem;
}

.wt-vault-kpi-label {
    font-size: 0.8rem;
    color: #64748b;
}

.wt-vault-kpi-value {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

/* ===== User/Person Editor ===== */

.wt-editor-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1rem;
    align-items: start;
}

.wt-editor-list {
    min-height: 380px;
}

.wt-editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.wt-inline-warning {
    align-self: center;
    color: #b91c1c;
    font-weight: 600;
}

.wt-editor-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.wt-editor-record-banner {
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: #e8f0fe;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    color: #1e3a8a;
}

.wt-editor-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.55rem;
}

.wt-editor-inline-row {
    display: grid;
    grid-template-columns: 1fr 160px auto auto;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.wt-editor-checks {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.wt-editor-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.wt-editor-status {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.wt-editor-qbo-table td .wt-select,
.wt-editor-qbo-table td .wt-input {
    width: 100%;
}

.wt-editor-qbo-actions-col {
    width: 170px;
}

.wt-editor-qbo-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.wt-editor-qbo-table tfoot td {
    border-top: 2px solid #e0e0e0;
    background: #fafafa;
}

.wt-email-pref-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.wt-email-pref-filter {
    width: auto;
    min-width: 180px;
}

.wt-email-pref-count {
    margin-bottom: 0.5rem;
}

.wt-email-pref-template-meta {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: #4b5563;
}

@media (max-width: 980px) {
    .wt-editor-layout {
        grid-template-columns: 1fr;
    }
}

/* ===== Procure-to-Pay ===== */

.wt-p2p-toolbar {
    flex-wrap: wrap;
}

.wt-p2p-toolbar .wt-input {
    min-width: 220px;
    flex: 1;
}

.wt-p2p-detail-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.wt-p2p-detail-header h3 {
    margin: 0;
}

.wt-p2p-view-switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}

.wt-p2p-view-label {
    font-size: 0.82rem;
    color: #4b5563;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.wt-p2p-tabs,
.wt-p2p-workflow,
.wt-p2p-line-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.wt-p2p-view-switch .wt-p2p-tabs {
    margin-bottom: 0;
    align-items: center;
}

.wt-p2p-header-details {
    margin-bottom: 0.75rem;
}

.wt-p2p-header-details h4 {
    margin: 0 0 0.5rem 0;
}

.wt-p2p-workflow label.wt-btn {
    position: relative;
    overflow: hidden;
}

.wt-p2p-workflow label.wt-btn input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wt-row-selected {
    background: rgba(73, 134, 255, 0.08);
}

.wt-p2p-line-controls .wt-input {
    min-width: 220px;
    flex: 1;
}

.wt-p2p-line-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.5rem;
}

.wt-p2p-date-input-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wt-p2p-date-input-group .wt-date-input {
    flex: 1;
    min-width: 0;
}

.wt-p2p-date-picker-btn {
    flex: 0 0 auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    font-size: 1rem;
    line-height: 1;
}

.wt-po-line-removed td {
    text-decoration: line-through;
    color: #6b7280;
}

.wt-po-line-new td,
.wt-po-line-edited td {
    font-weight: 600;
}

.wt-line-history-note {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.72rem;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.06rem 0.42rem;
}

@media (max-width: 700px) {
    .wt-p2p-line-grid {
        grid-template-columns: 1fr;
    }
}

.wt-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 2100;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: wt-vault-fadein 0.2s ease;
}

.wt-toast-success {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.wt-toast-error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.wt-kb-page {
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.wt-kb-upload,
.wt-kb-detail {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
}

.wt-kb-form-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    margin-bottom: 0.75rem;
}

.wt-kb-form-grid label {
    display: grid;
    gap: 0.3rem;
}

.wt-kb-form-grid input,
.wt-kb-form-grid select,
.wt-kb-form-grid textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
}

.wt-kb-full {
    grid-column: 1 / -1;
}

.wt-kb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.wt-kb-filters label {
    display: grid;
    gap: 0.2rem;
}

.wt-kb-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.wt-kb-table th,
.wt-kb-table td {
    border: 1px solid #e2e8f0;
    padding: 0.45rem;
    text-align: left;
    vertical-align: top;
}

.wt-kb-table th {
    background: #f8fafc;
}

.wt-kb-table-small td,
.wt-kb-table-small th {
    font-size: 0.85rem;
}

.wt-kb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.wt-kb-status {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.wt-kb-ok {
    background: #dcfce7;
    color: #166534;
}

.wt-kb-fail {
    background: #fee2e2;
    color: #991b1b;
}

.wt-kb-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.wt-kb-pending {
    background: #fef9c3;
    color: #854d0e;
}

.wt-kb-tags {
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.wt-kb-error {
    color: #b91c1c;
    font-weight: 600;
}

/* ===== Knowledge Base Ask (RAG query UI) ===== */

.wt-kb-ask-page {
    padding: 1rem;
    display: grid;
    gap: 1rem;
    max-width: 960px;
}

.wt-kb-ask-form {
    display: grid;
    gap: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
}

.wt-kb-ask-scope select,
.wt-kb-ask-question textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    font: inherit;
}

.wt-kb-ask-question textarea {
    resize: vertical;
    min-height: 4rem;
}

.wt-kb-ask-scope,
.wt-kb-ask-question {
    display: grid;
    gap: 0.3rem;
}

.wt-kb-ask-actions {
    display: flex;
    gap: 0.5rem;
}

.wt-kb-ask-error {
    color: #b91c1c;
    font-weight: 600;
    border-left: 3px solid #b91c1c;
    padding-left: 0.5rem;
}

.wt-kb-ask-turn {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    background: #fff;
    display: grid;
    gap: 0.5rem;
}

.wt-kb-ask-q {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: baseline;
    color: #1e293b;
}

.wt-kb-ask-meta {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-left: auto;
}

.wt-kb-ask-a strong {
    color: #0f172a;
}

.wt-kb-ask-answer {
    white-space: pre-wrap;
    word-wrap: break-word;
    font: inherit;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    margin: 0.25rem 0 0 0;
}

.wt-kb-ask-citations summary {
    cursor: pointer;
    font-weight: 600;
    color: #1e3a8a;
}

.wt-kb-ask-citations ol {
    margin: 0.5rem 0 0 1.25rem;
    display: grid;
    gap: 0.6rem;
}

.wt-kb-ask-cite-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.85rem;
}

.wt-kb-ask-cite-version,
.wt-kb-ask-cite-page,
.wt-kb-ask-cite-type,
.wt-kb-ask-cite-score {
    color: #64748b;
}

.wt-kb-ask-cite-score {
    margin-left: auto;
}

.wt-kb-ask-cite-snippet {
    color: #334155;
    font-size: 0.9rem;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0.45rem 0.6rem;
    white-space: pre-wrap;
}

.wt-kb-ask-cite-tags {
    color: #64748b;
    font-size: 0.75rem;
}

/* ===== Bug Reporting ===== */

.wt-bug-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1100;
    background: #d97706;
    border: none;
    color: #fff;
    border-radius: 999px;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

.wt-bug-fab:hover {
    background: #b45309;
}

.wt-bug-queued-files {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.wt-bug-file-list,
.wt-bug-timeline {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
}

.wt-bug-file-list li,
.wt-bug-timeline li {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.wt-badge-new {
    background: #e3f2fd;
    color: #1565c0;
}

.wt-badge-inprogress {
    background: #fff3e0;
    color: #ef6c00;
}

/* ===== Customer Data ===== */

.wt-cd-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1rem;
    align-items: start;
}

.wt-cd-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.wt-cd-customer-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    padding: 0.6rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
    cursor: pointer;
}

.wt-cd-customer-card-selected {
    border-color: #0078d4;
    background: #eef6ff;
}

.wt-cd-customer-name {
    font-weight: 700;
    color: #1f2937;
}

.wt-cd-customer-meta {
    font-size: 0.78rem;
    color: #64748b;
}

.wt-cd-customer-flags {
    display: flex;
    gap: 0.35rem;
}

.wt-cd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.55rem;
}

.wt-cd-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: #4b5563;
}

.wt-cd-wide-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: #4b5563;
}

.wt-cd-checks {
    display: flex;
    gap: 1rem;
    margin-top: 0.65rem;
    font-size: 0.9rem;
}

.wt-cd-map-wrap {
    margin-top: 0.75rem;
}

.wt-cd-map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: #64748b;
}

.wt-cd-map {
    width: 100%;
    height: 280px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
}

.wt-cd-project-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.6rem;
}

@media (max-width: 980px) {
    .wt-cd-layout {
        grid-template-columns: 1fr;
    }
}
