/* ==========================================================================
   TEST MASTER — SINGLE VIEWPORT MODERN THEME
   Strict Single-Viewport Layout (No Outer Scroll, Internal Scroll Only)
   Theme Palette: Dark Navy (#0f172a, #1e293b), Slate (#f8fafc, #f1f5f9, #64748b), Accent Blue (#2563eb, #eff6ff)
   ========================================================================== */

/* ── 1. Page Root & Main Layout Wrapper ────────────────────── */
.tm-elite-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    background-color: #f8fafc;
    color: #1e293b;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    width: 100%;
}

.tm-elite-container form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.tm-list-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding: 10px 14px;
    gap: 8px;
    box-sizing: border-box;
}

/* ── 2. Top Header & Navigation Bar (List View) ────────────── */
.tm-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
    gap: 12px;
}

.tm-title-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tm-title-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #dbeafe;
}

.tm-title-icon-wrap .material-symbols-outlined {
    font-size: 20px;
}

.tm-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 1px;
}

.tm-breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}

.tm-breadcrumb-sep {
    font-size: 11px;
}

.tm-page-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tm-badge-directory {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 1px 7px;
    border-radius: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tm-live-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.tm-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tm-filter-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    height: 32px;
    cursor: pointer;
    min-width: 170px;
    transition: all 0.15s ease;
}

.tm-filter-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.tm-search-wrap {
    position: relative;
    width: 240px;
}

.tm-search-wrap .material-symbols-outlined {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.tm-search-input {
    width: 100%;
    height: 32px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px 0 32px;
    font-size: 12px;
    color: #1e293b;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.tm-btn-primary {
    height: 32px;
    padding: 0 14px;
    border-radius: 6px;
    background: #0f172a !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tm-btn-primary:hover {
    background: #1e293b !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.15);
}

.tm-btn-icon {
    font-size: 16px;
}

/* ── 3. KPI / Stat Cards Grid ───────────────────────────────── */
.tm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex-shrink: 0;
}

.tm-stat-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 7px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.tm-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.tm-card-total::before    { background: #2563eb; }
.tm-card-active::before   { background: #10b981; }
.tm-card-dept::before     { background: #6366f1; }
.tm-card-filtered::before { background: #f59e0b; }

.tm-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.tm-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tm-stat-icon-wrap {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-stat-icon-wrap .material-symbols-outlined {
    font-size: 15px;
}

.tm-stat-tag {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.tm-stat-tag .material-symbols-outlined {
    font-size: 13px;
}

.tm-card-total .tm-stat-icon-wrap    { background: #eff6ff; color: #2563eb; }
.tm-card-total .tm-stat-tag          { background: #eff6ff; color: #2563eb; }

.tm-card-active .tm-stat-icon-wrap   { background: #ecfdf5; color: #059669; }
.tm-card-active .tm-stat-tag         { background: #ecfdf5; color: #047857; }

.tm-card-dept .tm-stat-icon-wrap     { background: #eef2ff; color: #6366f1; }
.tm-card-dept .tm-stat-tag           { background: #eef2ff; color: #4f46e5; }

.tm-card-filtered .tm-stat-icon-wrap { background: #fffbeb; color: #d97706; }
.tm-card-filtered .tm-stat-tag       { background: #fffbeb; color: #b45309; }

.tm-stat-mid {
    margin-top: 1px;
}

.tm-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tm-stat-bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 1px;
}

.tm-stat-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.tm-stat-subtext {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

/* ── 4. Table Card Container (List View Table) ─────────────── */
.tm-table-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.tm-table-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

.tm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    text-align: left;
}

/* Light Slate Header */
.tm-thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tm-th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 9px 12px;
    border-bottom: 1px solid #e2e8f0;
    border-top: none;
    white-space: nowrap;
    user-select: none;
}

.tm-tbody tr {
    background-color: #ffffff;
    transition: background-color 0.12s ease;
}

.tm-tbody tr:hover {
    background-color: #f8fafc;
}

.tm-td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
    font-size: 12px;
}

.td-order-no {
    font-weight: 700;
    color: #64748b;
    font-size: 11px;
}

.tm-badge-code {
    display: inline-block;
    padding: 2px 7px;
    background: #eff6ff;
    color: #2563eb;
    font-family: monospace;
    font-weight: 800;
    font-size: 11.5px;
    border-radius: 5px;
    border: 1px solid #bfdbfe;
}

.tm-group-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-inline-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 3px 6px;
    font-family: inherit;
    font-size: 12px;
    color: inherit;
    box-sizing: border-box;
    transition: all 0.15s ease-in-out;
}

.tm-inline-input:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.tm-inline-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* Action Buttons */
.tm-actions-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.tm-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
}

.tm-action-btn .material-symbols-outlined {
    font-size: 15px;
}

.tm-btn-edit:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.tm-btn-download:hover {
    background: #f5f3ff;
    color: #6366f1;
    border-color: #c7d2fe;
}

.tm-btn-delete:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* ── 5. Table Footer & Pagination ─────────────────────────── */
.tm-table-footer {
    padding: 6px 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 10px;
    background: #ffffff;
    font-size: 12px;
}

.tm-page-info {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.tm-page-info strong {
    color: #0f172a;
    font-weight: 700;
}

.tm-pagination-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tm-page-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tm-page-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.tm-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tm-page-indicator {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    padding: 0 8px;
}

/* ── 6. Test Construction / Editor Header ─────────────────── */
.tm-elite-header {
    background: #ffffff;
    padding: 8px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.tm-header-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tm-btn-back {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-btn-back:hover {
    background: #2563eb;
    color: #ffffff;
}

.tm-header-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.tm-header-subtitle {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.tm-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tm-btn-collapse {
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-btn-collapse:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.tm-btn-delete {
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    color: #e11d48 !important;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-btn-delete:hover {
    background: #ffe4e6 !important;
}

.tm-btn-outline {
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-btn-outline:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.tm-btn-save {
    height: 32px;
    padding: 0 16px;
    border-radius: 6px;
    background: #0f172a !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.tm-btn-save:hover {
    background: #1e293b !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(15, 23, 42, 0.2);
}

/* ── 7. Editor Workspace & Details Cards ──────────────────── */
.tm-elite-content {
    flex: 1 1 0;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Hero Summary Bar (Collapsed) */
.tm-hero-summary-bar {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.tm-hero-left, .tm-hero-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tm-hero-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tm-hero-title {
    font-weight: 800;
    font-size: 13px;
    color: #0f172a;
}

.tm-hero-code-pill {
    padding: 1px 6px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    font-family: monospace;
    border: 1px solid #bfdbfe;
}

.tm-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.tm-hero-chip.price {
    background: #ecfdf5;
    color: #059669;
    font-weight: 700;
    border-color: #a7f3d0;
}

.tm-hero-chip.status-active {
    background: #ecfdf5;
    color: #059669;
    font-weight: 600;
    border-color: #a7f3d0;
}

.tm-hero-btn-edit {
    height: 26px;
    padding: 0 10px;
    border-radius: 5px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.tm-hero-btn-edit:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Expanded Top Details Cards */
.tm-elite-grid-top {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 8px;
    flex-shrink: 0;
}

.tm-white-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.tm-form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.tm-form-row:last-child {
    margin-bottom: 0;
}

.tm-field-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tm-input-icon-box {
    position: relative;
    width: 100%;
}

.tm-input-icon-box .material-symbols-outlined {
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #64748b;
    pointer-events: none;
}

.tm-input-icon-box .tm-icon-purple { color: #2563eb; }
.tm-input-icon-box .tm-icon-blue   { color: #2563eb; }
.tm-input-icon-box .tm-icon-gray   { color: #64748b; }

.tm-input-field {
    width: 100%;
    height: 30px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 11.5px;
    color: #1e293b;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s;
    font-family: inherit;
}

.tm-input-field.has-icon {
    padding-left: 28px;
}

.tm-input-field:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* Reporting Time */
.tm-reporting-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tm-time-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    height: 30px;
    padding: 0 4px;
}

.tm-time-box input {
    width: 22px;
    border: none;
    outline: none;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    background: transparent;
    padding: 0;
}

.tm-time-box span {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    margin-left: 1px;
}

.tm-time-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    height: 30px;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Options Checkboxes */
.tm-options-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tm-chk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 8px;
    height: 28px;
    box-sizing: border-box;
    transition: all 0.12s;
}

.tm-chk:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.tm-chk.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    font-weight: 700;
}

.tm-chk .box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1.5px solid #94a3b8;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 10px;
}

.tm-chk.active .box {
    background: #2563eb;
    border-color: #2563eb;
}

/* ── 8. Split Workspace (Sub Tests & Normal Values) ────────── */
.tm-workspace-split {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 8px;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

/* Left Column: Sub Tests Card */
.tm-left-subtests-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.tm-subtests-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.tm-subtests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.tm-subtests-title {
    font-size: 11px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tm-subtests-pill {
    font-size: 10px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid #dbeafe;
}

.tm-subtests-search-row {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.tm-search-input-wrap {
    position: relative;
    flex: 1;
}

.tm-search-input-wrap .tm-search-icon {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.tm-subtest-search-input {
    width: 100%;
    height: 28px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 6px 0 24px;
    font-size: 11px;
    color: #1e293b;
    outline: none;
    box-sizing: border-box;
}

.tm-subtest-search-input:focus {
    background: #ffffff;
    border-color: #2563eb;
}

.tm-subtest-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #0f172a !important;
    border: none !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.tm-subtest-add-btn:hover {
    background: #1e293b !important;
}

.tm-subtests-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 2px;
}

.tm-subtest-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
}

.tm-subtest-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.tm-subtest-card.active {
    background: #eff6ff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 1px #2563eb !important;
}

.tm-subtest-card-top {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tm-drag-dots {
    font-size: 13px;
    color: #94a3b8;
    cursor: grab;
}

.tm-subtest-index {
    font-size: 10.5px;
    font-weight: 800;
    color: #2563eb;
    font-family: monospace;
}

.tm-subtest-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-subtest-del {
    font-size: 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.12s;
}

.tm-subtest-del:hover {
    color: #dc2626;
}

.tm-subtest-card-badges {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    padding-left: 18px;
}

.tm-badge-type {
    font-size: 9px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    padding: 1px 5px;
    border-radius: 3px;
}

.tm-badge-unit {
    font-size: 9px;
    font-weight: 600;
    background: #eff6ff;
    color: #2563eb;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #dbeafe;
}

.tm-subtest-more-dots {
    text-align: center;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 8px;
    padding: 2px 0;
}

.tm-btn-add-parameter {
    width: 100%;
    height: 28px;
    border-radius: 6px;
    background: #ffffff;
    border: 1.5px dashed #93c5fd;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.12s;
    margin-top: 4px;
}

.tm-btn-add-parameter:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

/* Test Footer Message Drawer */
.tm-footer-message-box {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    position: relative;
    flex-shrink: 0;
}

.tm-footer-msg-title {
    font-size: 9.5px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
}

.tm-footer-msg-ta {
    width: 100%;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 4px 6px;
    font-size: 11px;
    color: #1e293b;
    outline: none;
    resize: none;
    box-sizing: border-box;
    font-family: inherit;
}

.tm-footer-msg-ta:focus {
    border-color: #2563eb;
}

.tm-char-count {
    font-size: 9px;
    color: #94a3b8;
    position: absolute;
    right: 12px;
    bottom: 8px;
}

/* ── 9. Right Column: Normal Values & Settings Card ───────── */
.tm-elite-red-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Slate / Navy Header Bar */
.tm-elite-red-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
}

.tm-card-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 12.5px;
}

/* Header Machine & Specimen Pills */
.tm-header-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.14);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    height: 30px;
    box-sizing: border-box;
}

.tm-header-pill-label {
    font-size: 10.5px;
    white-space: nowrap;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.04em;
}

.tm-header-select {
    background: #ffffff;
    border: none;
    border-radius: 4px;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 6px;
    outline: none;
    cursor: pointer;
    height: 24px;
}

.tm-header-icon-btn {
    padding: 0 6px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.tm-header-btn-update {
    background: #10b981 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 14px;
    height: 30px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.18);
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.tm-header-btn-update:hover {
    background: #059669 !important;
    transform: translateY(-1px);
}

.normal-values-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

/* Tabs */
.tm-elite-tab-row {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    padding: 0 4px;
    gap: 4px;
}

.tm-elite-tab {
    padding: 8px 16px;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    user-select: none;
}

.tm-elite-tab:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.tm-elite-tab.active {
    color: #2563eb !important;
    border-bottom-color: #2563eb !important;
    background: #ffffff !important;
    font-weight: 800;
}

.tm-tab-white-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 14px;
    background: #ffffff;
}

/* Inner 2-column Settings */
.tm-settings-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tm-inner-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.tm-inner-card-title {
    font-size: 10.5px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.tm-inner-field {
    margin-bottom: 6px;
}

.tm-inner-field:last-child {
    margin-bottom: 0;
}

/* Addon Buttons for Methods / Units */
.tm-btn-addon {
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.15s ease;
}

.tm-btn-addon:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Normal Range & Critical Values Card */
.tm-crit-lbl-orange {
    font-size: 10.5px;
    font-weight: 800;
    color: #ea580c;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tm-crit-select-orange, .tm-crit-input-orange {
    height: 30px;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    background: #fff7ed;
    color: #c2410c;
    outline: none;
    box-sizing: border-box;
}

.tm-crit-select-orange:focus, .tm-crit-input-orange:focus {
    border-color: #f97316;
    background: #ffffff;
}

.tm-crit-lbl-red {
    font-size: 10.5px;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tm-crit-select, .tm-crit-input, .tm-crit-select-red, .tm-crit-input-red {
    height: 30px;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    background: #fff1f2;
    color: #991b1b;
    outline: none;
    box-sizing: border-box;
}

.tm-crit-select:focus, .tm-crit-input:focus, .tm-crit-select-red:focus, .tm-crit-input-red:focus {
    border-color: #f43f5e;
    background: #ffffff;
}

/* Age Matrix Table */
.tm-age-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11.5px;
}

.tm-age-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tm-age-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
    box-shadow: 0 1px 0 #e2e8f0;
    white-space: nowrap;
}

.tm-age-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.tm-age-cell-input {
    width: 100%;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 0 6px;
    font-size: 11px;
    background: #ffffff;
    box-sizing: border-box;
    outline: none;
}

.tm-age-cell-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Matrix Table */
.tm-matrix-section-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.tm-matrix-alert-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 11.5px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.tm-matrix-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tm-btn-add-mapping {
    height: 30px;
    padding: 0 14px;
    border-radius: 6px;
    background: #0f172a !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.tm-btn-add-mapping:hover {
    background: #1e293b !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(15, 23, 42, 0.18);
}

.tm-matrix-table-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    max-height: 330px;
    overflow-y: auto !important;
    overflow-x: auto !important;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.tm-specimen-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
}

.tm-specimen-matrix-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tm-specimen-matrix-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 10.5px;
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
    box-shadow: 0 1px 0 #e2e8f0;
    white-space: nowrap;
}

.tm-specimen-matrix-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.tm-toggle-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.tm-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tm-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 18px;
}

.tm-toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

.tm-toggle-switch input:checked + .tm-toggle-slider {
    background-color: #10b981;
}

.tm-toggle-switch input:checked + .tm-toggle-slider:before {
    transform: translateX(14px);
}

.tm-btn-delete-row {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #e11d48;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-btn-delete-row:hover {
    background: #ffe4e6;
}

/* ── 10. Modals & Search Dropdowns ────────────────────────── */
.tm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.tm-modal-content {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px;
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
}

.tm-modal-header {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tm-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
}

.tm-modal-close:hover {
    color: #0f172a;
}

.master-search-dropdown {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    top: 100% !important;
    bottom: auto !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
}

.master-search-item {
    padding: 6px 10px;
    font-size: 11.5px;
    cursor: pointer;
    transition: background 0.12s;
}

.master-search-item:hover, .master-search-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* ── 11. Utilities & Animation ────────────────────────────── */
.tm-empty-state-cell {
    padding: 40px 20px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.tm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.tm-empty-icon {
    font-size: 32px !important;
    color: #cbd5e1;
}

.tm-spinner-icon {
    font-size: 28px !important;
    color: #2563eb;
    animation: tmSpin 1s linear infinite;
}

@keyframes tmSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tm-spin-animate {
    animation: tmSpin 1s linear infinite;
}

.cursor-pointer { cursor: pointer; }
.font-12 { font-size: 12px; }
.font-13 { font-size: 13px; }
.font-14 { font-size: 14px; }
.font-15 { font-size: 15px; }
.font-16 { font-size: 16px; }
.font-18 { font-size: 18px; }
.font-20 { font-size: 20px; }
.text-indigo-600 { color: #4f46e5; }
.text-red-500 { color: #ef4444; }
.display-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.flex-1 { flex: 1; }
.mt-2px { margin-top: 2px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.ml-12 { margin-left: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ── 11. Custom Sleek Scrollbars ──────────────────────────── */
.tm-matrix-table-container::-webkit-scrollbar,
.tm-subtests-list::-webkit-scrollbar,
.tm-tab-white-body::-webkit-scrollbar,
.lc-overflow-auto::-webkit-scrollbar,
.tm-table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.tm-matrix-table-container::-webkit-scrollbar-track,
.tm-subtests-list::-webkit-scrollbar-track,
.tm-tab-white-body::-webkit-scrollbar-track,
.lc-overflow-auto::-webkit-scrollbar-track,
.tm-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.tm-matrix-table-container::-webkit-scrollbar-thumb,
.tm-subtests-list::-webkit-scrollbar-thumb,
.tm-tab-white-body::-webkit-scrollbar-thumb,
.lc-overflow-auto::-webkit-scrollbar-thumb,
.tm-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.tm-matrix-table-container::-webkit-scrollbar-thumb:hover,
.tm-subtests-list::-webkit-scrollbar-thumb:hover,
.tm-tab-white-body::-webkit-scrollbar-thumb:hover,
.lc-overflow-auto::-webkit-scrollbar-thumb:hover,
.tm-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
