*{box-sizing:border-box}body{margin:0;background:#f4f7fb;color:#172033;font-family:Inter,Segoe UI,Arial,sans-serif}.app-shell{display:flex;min-height:100vh}.sidebar{width:255px;background:#111a2e;color:#dce5f5;padding:24px 16px;position:fixed;inset:0 auto 0 0;z-index:100}.sidebar-brand{display:flex;gap:12px;align-items:center;padding:0 10px 24px}.sidebar-brand small,.user-name small{display:block;color:#8ea0bd;font-size:12px}.brand-mini,.brand-mark{display:grid;place-items:center;background:linear-gradient(135deg,#5b7cfa,#8b5cf6);color:white;font-weight:800;border-radius:13px}.brand-mini{width:42px;height:42px}.sidebar-nav a{display:flex;align-items:center;gap:12px;color:#aebbd0;text-decoration:none;padding:12px 14px;border-radius:10px;margin:3px 0}.sidebar-nav a:hover,.sidebar-nav a.active{background:#233153;color:white}.nav-label{font-size:11px;text-transform:uppercase;letter-spacing:1.4px;color:#657694;padding:22px 14px 8px}.main-area{margin-left:255px;width:calc(100% - 255px)}.topbar{height:72px;background:white;border-bottom:1px solid #e4e9f2;display:flex;align-items:center;padding:0 28px;position:sticky;top:0;z-index:50}.menu-button{display:none;border:0;background:transparent;font-size:24px}.content-area{padding:28px}.role-pill{background:#edf1ff;color:#465cca;border-radius:999px;padding:6px 11px;font-size:12px;font-weight:700}.user-name{line-height:1.2}.page-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.page-heading h1{font-size:28px;margin:0}.page-heading p{color:#718096;margin:5px 0 0}.metric-card,.panel,.project-card{background:white;border:1px solid #e6eaf1;border-radius:16px;box-shadow:0 5px 18px rgba(26,39,68,.05)}.metric-card{padding:20px;display:flex;gap:16px;align-items:center}.metric-card strong{display:block;font-size:28px}.metric-card span{color:#758198}.metric-icon{width:48px;height:48px;border-radius:13px;background:#edf1ff;color:#4f67da;display:grid;place-items:center;font-size:22px}.panel{padding:22px}.panel-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.panel-title h3,.panel h3{font-size:18px;margin:0}.panel-title span{color:#8190a8}.progress-row{margin:16px 0}.progress{height:8px;background:#eef1f6}.progress-bar{background:linear-gradient(90deg,#5272e5,#8267df)}.quality-score{text-align:center;padding:30px}.quality-score strong{font-size:52px;display:block;color:#4d66d7}.quality-score span{color:#7b879a}.project-card{padding:22px;height:100%}.project-card h3{margin:5px 0 10px}.project-card p{color:#69778d;min-height:42px}.eyebrow{font-size:11px;font-weight:800;color:#7787a2;letter-spacing:1px}.status-chip{display:inline-block;padding:5px 10px;background:#eef2ff;color:#475cc5;border-radius:999px;font-size:12px;font-weight:700}.tester-chip{display:inline-flex;align-items:center;gap:5px;background:#effaf5;color:#187a51;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700}.project-meta{display:flex;flex-wrap:wrap;gap:14px;color:#718096;font-size:13px}.table>:not(caption)>*>*{padding:14px 12px;border-color:#edf0f5}.table thead th{color:#778399;font-size:12px;text-transform:uppercase;letter-spacing:.5px}.modal-content{border:0;border-radius:16px}.form-control,.form-select{border-color:#dce2ec;padding:.7rem .85rem}.btn{border-radius:9px}.auth-page{min-height:100vh;background:#10182b}.auth-shell{display:grid;grid-template-columns:1.1fr .9fr;min-height:100vh}.auth-brand-panel{padding:10%;display:flex;flex-direction:column;justify-content:center;background:radial-gradient(circle at top left,#334d9d,#111a2e 55%);color:white}.auth-brand-panel h1{font-size:48px;max-width:650px}.auth-brand-panel p{font-size:18px;color:#bcc8dd;max-width:600px}.brand-mark{width:64px;height:64px;font-size:22px;margin-bottom:30px}.auth-form-panel{background:#f5f7fb;display:grid;place-items:center;padding:30px}.auth-card{background:white;width:min(440px,100%);padding:38px;border-radius:20px;box-shadow:0 20px 60px rgba(24,34,57,.14)}@media(max-width:900px){.sidebar{transform:translateX(-100%);transition:.2s}.sidebar.open{transform:translateX(0)}.main-area{margin-left:0;width:100%}.menu-button{display:block}.auth-shell{grid-template-columns:1fr}.auth-brand-panel{display:none}.content-area{padding:18px}.page-heading{align-items:flex-start;gap:15px;flex-direction:column}}
.notification-item{display:flex;justify-content:space-between;gap:20px;padding:18px;border-bottom:1px solid #edf0f5}.notification-item.unread{background:#f4f6ff;border-left:4px solid #5269da}.notification-item p{margin:5px 0;color:#66748b}.review-box{white-space:pre-wrap;background:#f7f8fc;border:1px solid #e5e9f2;border-radius:10px;padding:14px;max-height:280px;overflow:auto}


/* Equal action button boxes */
.action-cell {
    min-width: 290px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    gap: 8px;
    align-items: stretch;
}

.action-grid .btn,
.action-grid form,
.review-action-grid .btn,
.review-action-grid form {
    width: 100%;
}

.action-grid .btn,
.review-action-grid .btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 9px;
}

.action-placeholder {
    min-height: 38px;
    border: 1px dashed #d9dfea;
    border-radius: 9px;
    background: #f8f9fc;
}

.review-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(115px, 1fr));
    gap: 8px;
    min-width: 250px;
}

.status-chip.status-draft {
    background: #eef1f5;
    color: #596579;
}

.status-chip.status-review {
    background: #fff4df;
    color: #a46308;
}

.status-chip.status-revision {
    background: #fdeaea;
    color: #b42318;
}

.status-chip.status-approved {
    background: #e9f8ef;
    color: #18794e;
}

.status-chip.status-archived {
    background: #e8ebf0;
    color: #465267;
}

@media (max-width: 1100px) {
    .action-cell {
        min-width: 210px;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .review-action-grid {
        grid-template-columns: 1fr;
        min-width: 150px;
    }
}


/* Modal layout repair */
.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1050;
}

.modal-dialog {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.modal-content {
    width: 100%;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}

.modal-header,
.modal-footer {
    background: #ffffff;
    border-color: #e7ebf2;
    padding: 18px 24px;
}

.modal-body {
    background: #ffffff;
    padding: 24px;
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 4rem);
}

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

.review-summary-card {
    padding: 20px;
    border: 1px solid #e2e7ef;
    border-radius: 14px;
    background: #f8faff;
}

.review-summary-card h4 {
    margin: 0;
    font-size: 20px;
}

.review-content-box {
    min-height: 70px;
    padding: 16px;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    background: #f9fafc;
    line-height: 1.65;
    white-space: normal;
    overflow-wrap: anywhere;
}

.review-open-button {
    min-width: 110px;
}

@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-body,
    .modal-header,
    .modal-footer {
        padding: 16px;
    }
}


/* Clickable review decision cards */
.decision-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.decision-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 92px;
    padding: 16px;
    border: 2px solid #dfe5ee;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
    position: relative;
    z-index: 1;
}

.decision-card:hover {
    border-color: #8798d9;
    background: #f8faff;
    transform: translateY(-1px);
}

.decision-card .form-check-input {
    flex: 0 0 auto;
    margin: 3px 0 0;
    cursor: pointer;
}

.decision-card span {
    display: block;
}

.decision-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.decision-card small {
    display: block;
    color: #738096;
    line-height: 1.45;
}

.decision-card:has(input:checked) {
    border-color: #4f67da;
    background: #eef2ff;
}

.decision-revision:has(input:checked) {
    border-color: #d64b4b;
    background: #fff1f1;
}

#reviewModal .modal-content,
#reviewModal .modal-body,
#reviewModal .decision-options,
#reviewModal .decision-card,
#reviewModal select,
#reviewModal input,
#reviewModal textarea,
#reviewModal button {
    pointer-events: auto;
}

@media (max-width: 768px) {
    .decision-options {
        grid-template-columns: 1fr;
    }
}


/* Shared search and filter layout */
.filter-grid {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(150px, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-search {
    min-width: 240px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.result-count {
    color: #718096;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .btn {
        width: 100%;
    }
}


/* Detailed test cycle presentation */
.cycle-card {
    background: #fff;
    border: 1px solid #e3e8f1;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(30, 45, 75, .06);
}

.cycle-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.cycle-header h3 {
    margin: 6px 0;
}

.cycle-header p {
    color: #718096;
    margin: 0;
}

.cycle-objective {
    background: #f8faff;
    border: 1px solid #e5eafe;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
}

.cycle-objective p {
    margin: 6px 0 0;
    color: #58667d;
}

.cycle-detail-grid,
.cycle-metrics {
    display: grid;
    gap: 12px;
}

.cycle-detail-grid {
    grid-template-columns: repeat(4, minmax(0,1fr));
}

.cycle-metrics {
    grid-template-columns: repeat(7, minmax(90px,1fr));
    margin-top: 18px;
}

.cycle-detail-grid > div,
.cycle-metrics > div {
    background: #f7f9fc;
    border: 1px solid #e8ecf3;
    border-radius: 11px;
    padding: 13px;
}

.cycle-detail-grid span,
.cycle-metrics span {
    display: block;
    color: #7a879b;
    font-size: 12px;
    margin-bottom: 5px;
}

.cycle-detail-grid strong,
.cycle-metrics strong {
    display: block;
}

.cycle-metrics strong {
    font-size: 22px;
}

.cycle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

@media (max-width: 1050px) {
    .cycle-detail-grid { grid-template-columns: repeat(2,1fr); }
    .cycle-metrics { grid-template-columns: repeat(4,1fr); }
}

@media (max-width: 650px) {
    .cycle-header { flex-direction: column; }
    .cycle-detail-grid,
    .cycle-metrics { grid-template-columns: 1fr 1fr; }
    .cycle-actions .btn { width: 100%; }
}


/* Test Plan cards */
.plan-card {
    background: #ffffff;
    border: 1px solid #e3e8f1;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(30,45,75,.06);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.plan-header h3 {
    margin: 6px 0;
}

.plan-header p {
    color: #718096;
    margin: 0;
}

.plan-objective {
    background: #f8faff;
    border: 1px solid #e5eafe;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
}

.plan-objective p {
    margin: 6px 0 0;
    color: #58667d;
}


/* Audit log identity display */
.audit-table td {
    vertical-align: middle;
}

.audit-table td:nth-child(2) {
    min-width: 180px;
}

.audit-table td:nth-child(3) {
    min-width: 210px;
}

.audit-table td:nth-child(7) {
    min-width: 280px;
    white-space: normal;
}


/* User Account filter layout */
.user-filter-grid {
    grid-template-columns: minmax(230px, 2fr) repeat(4, minmax(150px, 1fr));
}

@media (max-width: 1250px) {
    .user-filter-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .user-filter-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   QATrack UI Modernization Pack
   ========================================================== */
:root {
    --qt-bg: #f3f6fb;
    --qt-surface: #ffffff;
    --qt-surface-soft: #f8faff;
    --qt-border: #e3e8f1;
    --qt-border-strong: #d3dbea;
    --qt-text: #14213d;
    --qt-muted: #697891;
    --qt-primary: #3767e8;
    --qt-primary-dark: #254fc5;
    --qt-primary-soft: #edf2ff;
    --qt-success: #138a5b;
    --qt-success-soft: #e8f8f0;
    --qt-warning: #b66b08;
    --qt-warning-soft: #fff4dc;
    --qt-danger: #cf3f4f;
    --qt-danger-soft: #ffebee;
    --qt-sidebar: #0d172a;
    --qt-sidebar-hover: #182641;
    --qt-shadow-sm: 0 4px 14px rgba(21, 40, 78, .05);
    --qt-shadow-md: 0 12px 34px rgba(21, 40, 78, .08);
    --qt-shadow-lg: 0 24px 70px rgba(7, 18, 43, .22);
    --qt-sidebar-width: 264px;
    --qt-sidebar-collapsed-width: 82px;
    --qt-radius-sm: 10px;
    --qt-radius-md: 15px;
    --qt-radius-lg: 20px;
    --qt-transition: 180ms ease;
}

body {
    background:
        radial-gradient(circle at 95% 0%, rgba(75, 110, 230, .08), transparent 22rem),
        var(--qt-bg);
    color: var(--qt-text);
    line-height: 1.55;
}

.sidebar {
    width: var(--qt-sidebar-width);
    padding: 22px 14px;
    background:
        radial-gradient(circle at 20% 0%, rgba(91, 124, 250, .20), transparent 16rem),
        var(--qt-sidebar);
    border-right: 1px solid rgba(255,255,255,.06);
    transition: width var(--qt-transition), transform var(--qt-transition);
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-brand {
    min-height: 52px;
    padding: 0 8px 22px;
    position: relative;
}

.brand-copy {
    min-width: 135px;
    transition: opacity var(--qt-transition), width var(--qt-transition);
}

.sidebar-collapse-button {
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 9px;
    background: rgba(255,255,255,.05);
    color: #b9c7dd;
    display: grid;
    place-items: center;
    transition: var(--qt-transition);
}

.sidebar-collapse-button:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.sidebar-nav a {
    position: relative;
    min-height: 46px;
    margin: 4px 0;
    padding: 11px 13px;
    font-weight: 550;
    transition: background var(--qt-transition), color var(--qt-transition), transform var(--qt-transition);
}

.sidebar-nav a i {
    width: 22px;
    flex: 0 0 22px;
    text-align: center;
    font-size: 17px;
}

.sidebar-nav a:hover {
    background: var(--qt-sidebar-hover);
    transform: translateX(2px);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(72,105,219,.36), rgba(64,87,168,.24));
    box-shadow: inset 3px 0 0 #7994ff;
}

.nav-text {
    white-space: nowrap;
}

.nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #ff5470;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.main-area {
    margin-left: var(--qt-sidebar-width);
    width: calc(100% - var(--qt-sidebar-width));
    transition: margin-left var(--qt-transition), width var(--qt-transition);
}

body.sidebar-collapsed .sidebar {
    width: var(--qt-sidebar-collapsed-width);
}

body.sidebar-collapsed .main-area {
    margin-left: var(--qt-sidebar-collapsed-width);
    width: calc(100% - var(--qt-sidebar-collapsed-width));
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-collapse-button {
    position: absolute;
    right: -3px;
    bottom: 1px;
    width: 27px;
    height: 27px;
}

body.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-nav a i {
    width: auto;
    flex-basis: auto;
    font-size: 19px;
}

.topbar {
    height: 76px;
    padding: 0 26px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--qt-border);
    z-index: 1040;
}

.topbar-left,
.topbar-actions,
.user-menu {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 14px;
}

.topbar-actions {
    margin-left: auto;
    gap: 10px;
}

.page-context {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.page-context small {
    color: var(--qt-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .9px;
    font-weight: 700;
}

.page-context strong {
    font-size: 16px;
}

.topbar-icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface);
    color: #53637b;
    text-decoration: none;
    position: relative;
    transition: var(--qt-transition);
}

.topbar-icon-button:hover {
    color: var(--qt-primary);
    border-color: #bdcafa;
    background: var(--qt-primary-soft);
    transform: translateY(-1px);
}

.topbar-notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ff4e6a;
}

.user-menu {
    gap: 10px;
    margin: 0 5px;
    padding: 5px 10px 5px 6px;
    border: 1px solid var(--qt-border);
    border-radius: 14px;
    background: var(--qt-surface);
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #4e72e9, #7a5ce2);
    color: #fff;
    font-weight: 800;
}

.content-area {
    max-width: 1800px;
    margin: 0 auto;
    padding: 30px 32px 50px;
}

.page-heading {
    gap: 18px;
    padding: 4px 2px;
}

.page-heading h1 {
    font-size: clamp(24px, 2vw, 31px);
    font-weight: 750;
    letter-spacing: -.5px;
}

.page-heading p {
    max-width: 760px;
}

.panel,
.metric-card,
.project-card,
.cycle-card,
.plan-card {
    border-color: var(--qt-border);
    border-radius: var(--qt-radius-lg);
    box-shadow: var(--qt-shadow-sm);
    transition: box-shadow var(--qt-transition), transform var(--qt-transition), border-color var(--qt-transition);
}

.panel {
    padding: 24px;
}

.metric-card:hover,
.project-card:hover,
.cycle-card:hover,
.plan-card:hover {
    border-color: #cfdaef;
    box-shadow: var(--qt-shadow-md);
    transform: translateY(-2px);
}

.metric-card {
    min-height: 110px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    right: -38px;
    top: -38px;
    background: rgba(76, 108, 226, .07);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
}

.metric-card strong {
    font-size: 30px;
    letter-spacing: -.8px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 15px;
    margin: 26px 2px 16px;
}

.section-heading h2 {
    margin: 3px 0 0;
    font-size: 21px;
    font-weight: 750;
}

.section-eyebrow,
.dashboard-kicker {
    color: var(--qt-primary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.1px;
}

.section-note {
    color: var(--qt-muted);
    font-size: 13px;
}

.dashboard-hero {
    min-height: 205px;
    padding: 34px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 92% 15%, rgba(255,255,255,.18), transparent 12rem),
        linear-gradient(135deg, #173782, #355fda 58%, #6c55d9);
    box-shadow: 0 20px 45px rgba(45, 76, 178, .22);
    overflow: hidden;
    position: relative;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 270px;
    height: 270px;
    right: -80px;
    bottom: -150px;
    border: 45px solid rgba(255,255,255,.08);
    border-radius: 50%;
}

.dashboard-hero h1 {
    margin: 7px 0 8px;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 780;
    letter-spacing: -1px;
}

.dashboard-hero p {
    max-width: 720px;
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: 16px;
}

.dashboard-kicker {
    color: #ced9ff;
}

.dashboard-hero-actions {
    min-width: 220px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 1;
}

.dashboard-hero .btn-light {
    border-color: rgba(255,255,255,.75);
    background: rgba(255,255,255,.93);
    color: #244aa7;
}

.dashboard-hero .btn-primary {
    border-color: rgba(255,255,255,.28);
    background: rgba(10,31,88,.35);
    backdrop-filter: blur(10px);
}

.table-responsive {
    border-radius: 14px;
}

.table {
    margin-bottom: 0;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}

.table thead th {
    padding-top: 15px;
    padding-bottom: 15px;
    background: #f8faff;
    color: #65738c;
    border-bottom: 1px solid var(--qt-border-strong);
    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--qt-transition), transform var(--qt-transition);
}

.table tbody tr:nth-child(even) {
    background: rgba(248,250,255,.55);
}

.table tbody tr:hover {
    background: #f1f5ff;
}

.table td {
    vertical-align: middle;
}

.table-empty-state {
    padding: 55px 20px !important;
    text-align: center;
    color: var(--qt-muted);
}

.table-empty-state i {
    display: block;
    margin-bottom: 8px;
    font-size: 32px;
    color: #9aa8bd;
}

.table-empty-state strong,
.table-empty-state span {
    display: block;
}

.table-empty-state strong {
    color: var(--qt-text);
    font-size: 15px;
}

.btn {
    min-height: 40px;
    padding: .55rem .9rem;
    font-weight: 650;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform var(--qt-transition), box-shadow var(--qt-transition), background var(--qt-transition);
}

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

.btn-primary {
    background: linear-gradient(135deg, #3d6dec, #3159cf);
    border-color: #3159cf;
    box-shadow: 0 6px 15px rgba(49,89,207,.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #315fdc, #264cb7);
    border-color: #264cb7;
}

.btn-outline-primary {
    color: var(--qt-primary);
    border-color: #91a8ee;
}

.btn-outline-danger {
    color: var(--qt-danger);
    border-color: #e5a0aa;
}

.btn-sm {
    min-height: 34px;
    padding: .38rem .65rem;
    border-radius: 9px;
    font-size: 12px;
}

.form-label {
    color: #34425a;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-control,
.form-select {
    min-height: 46px;
    padding: .68rem .82rem;
    border: 1px solid var(--qt-border-strong);
    border-radius: 11px;
    background-color: #fff;
    transition: border-color var(--qt-transition), box-shadow var(--qt-transition), background var(--qt-transition);
}

textarea.form-control {
    min-height: 96px;
}

.form-control:focus,
.form-select:focus {
    border-color: #7390ec;
    box-shadow: 0 0 0 .22rem rgba(73,108,224,.13);
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f1f4f9;
    color: #78869b;
}

.filter-grid {
    gap: 12px;
}

.filter-actions {
    min-width: max-content;
}

.active-filter-summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--qt-primary-soft);
    color: var(--qt-primary);
    font-size: 12px;
    font-weight: 700;
}

.result-count {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f3f6fb;
}

.status-chip,
.role-pill,
.tester-chip {
    line-height: 1.2;
    border: 1px solid transparent;
}

.status-chip {
    text-transform: capitalize;
}

.status-chip.status-draft,
.status-chip:where(:not(.status-review):not(.status-revision):not(.status-approved):not(.status-archived)) {
    box-shadow: inset 0 0 0 1px rgba(71,92,197,.08);
}

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

.modal-dialog {
    padding: 10px;
}

.modal-content {
    border-radius: 20px;
    box-shadow: var(--qt-shadow-lg);
}

.modal-header {
    min-height: 70px;
    padding: 20px 26px;
}

.modal-header h5,
.modal-title {
    font-size: 20px;
    font-weight: 760;
}

.modal-body {
    padding: 26px;
}

.modal-footer {
    min-height: 72px;
    padding: 15px 26px;
    gap: 8px;
    background: #fbfcff;
}

.modal-footer .btn {
    min-width: 112px;
}

.toast-container {
    z-index: 2000;
    margin-top: 72px;
}

.app-toast {
    min-width: 330px;
    border: 1px solid var(--qt-border);
    border-radius: 14px;
    box-shadow: var(--qt-shadow-lg);
    overflow: hidden;
}

.app-toast .toast-header {
    padding: 11px 13px;
}

.app-toast .toast-body {
    padding: 13px 16px;
    color: var(--qt-muted);
}

.toast-status-icon {
    width: 26px;
    height: 26px;
    margin-right: 9px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.toast-status-icon.success {
    color: var(--qt-success);
    background: var(--qt-success-soft);
}

.toast-status-icon.error {
    color: var(--qt-danger);
    background: var(--qt-danger-soft);
}

.toast-status-icon.warning {
    color: var(--qt-warning);
    background: var(--qt-warning-soft);
}

.progress {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    border-radius: inherit;
}

.cycle-card,
.plan-card {
    padding: 26px;
}

.cycle-header,
.plan-header {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--qt-border);
}

.cycle-objective,
.plan-objective,
.review-summary-card,
.review-content-box {
    border-color: var(--qt-border);
    background: var(--qt-surface-soft);
}

.cycle-detail-grid > div,
.cycle-metrics > div {
    border-color: var(--qt-border);
    background: var(--qt-surface-soft);
}

.cycle-actions {
    padding-top: 18px;
    border-top: 1px solid var(--qt-border);
}

.sidebar-overlay {
    display: none;
}

/* Dark mode */
body[data-theme="dark"] {
    --qt-bg: #0d1422;
    --qt-surface: #151f31;
    --qt-surface-soft: #192539;
    --qt-border: #26344b;
    --qt-border-strong: #33435e;
    --qt-text: #e8eef9;
    --qt-muted: #9aaac1;
    --qt-primary-soft: #1c2d58;
    background: var(--qt-bg);
    color: var(--qt-text);
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .project-card,
body[data-theme="dark"] .cycle-card,
body[data-theme="dark"] .plan-card,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-body,
body[data-theme="dark"] .modal-footer,
body[data-theme="dark"] .topbar-icon-button,
body[data-theme="dark"] .user-menu,
body[data-theme="dark"] .app-toast {
    background-color: var(--qt-surface);
    color: var(--qt-text);
    border-color: var(--qt-border);
}

body[data-theme="dark"] .modal-footer,
body[data-theme="dark"] .table thead th,
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] .cycle-detail-grid > div,
body[data-theme="dark"] .cycle-metrics > div,
body[data-theme="dark"] .review-content-box,
body[data-theme="dark"] .review-summary-card,
body[data-theme="dark"] .cycle-objective,
body[data-theme="dark"] .plan-objective {
    background-color: var(--qt-surface-soft);
    color: var(--qt-text);
    border-color: var(--qt-border);
}

body[data-theme="dark"] .table tbody tr:nth-child(even) {
    background: rgba(255,255,255,.018);
}

body[data-theme="dark"] .table tbody tr:hover {
    background: #1b2a42;
}

body[data-theme="dark"] .table > :not(caption) > * > * {
    color: var(--qt-text);
    border-color: var(--qt-border);
}

body[data-theme="dark"] .form-label,
body[data-theme="dark"] .panel-title h3,
body[data-theme="dark"] .section-heading h2 {
    color: var(--qt-text);
}

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

body[data-theme="dark"] .text-muted,
body[data-theme="dark"] small {
    color: var(--qt-muted) !important;
}

body[data-theme="dark"] .result-count {
    background: #202e44;
}

/* Responsive modernization */
@media (max-width: 1200px) {
    .content-area {
        padding-left: 22px;
        padding-right: 22px;
    }

    .user-menu .role-pill {
        display: none;
    }

    .cycle-metrics {
        grid-template-columns: repeat(4, minmax(100px,1fr));
    }
}

@media (max-width: 900px) {
    body.sidebar-collapsed .sidebar {
        width: var(--qt-sidebar-width);
    }

    .sidebar {
        width: min(290px, 86vw);
        transform: translateX(-105%);
        box-shadow: 20px 0 60px rgba(0,0,0,.28);
        z-index: 1100;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-collapse-button {
        display: none;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1090;
        background: rgba(5,12,27,.58);
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-area,
    body.sidebar-collapsed .main-area {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        padding: 0 16px;
    }

    .menu-button {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--qt-border);
        border-radius: 11px;
        background: var(--qt-surface);
        color: var(--qt-text);
    }

    .page-context small,
    .user-name,
    .logout-button {
        display: none;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 27px;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
    }

    .dashboard-hero-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 680px) {
    .content-area {
        padding: 20px 13px 40px;
    }

    .topbar-actions {
        gap: 6px;
    }

    .user-menu {
        padding: 4px;
        border: 0;
        background: transparent;
    }

    .role-pill {
        display: none;
    }

    .page-heading .btn {
        width: 100%;
    }

    .panel {
        padding: 17px;
        border-radius: 16px;
    }

    .metric-card {
        min-height: 92px;
    }

    .modal-dialog {
        margin: 4px;
        padding: 0;
    }

    .modal-content {
        border-radius: 16px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 17px;
        padding-right: 17px;
    }

    .modal-footer {
        flex-wrap: nowrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 0;
    }

    .dashboard-hero {
        min-height: auto;
        border-radius: 18px;
    }

    .dashboard-hero h1 {
        font-size: 28px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-responsive {
        margin-left: -4px;
        margin-right: -4px;
    }

    .action-cell {
        min-width: 160px;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .app-toast {
        min-width: min(330px, calc(100vw - 30px));
    }

    .toast-container {
        left: 0;
        right: 0 !important;
        padding: 10px !important;
    }
}


/* Temporary toast notification repair */
.toast-container {
    pointer-events: none;
}

.app-toast {
    position: relative;
    pointer-events: auto;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-12px) scale(.98);
    transition: opacity .22s ease, transform .22s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast.hide {
    opacity: 0;
    transform: translateY(-10px) scale(.98);
}

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--qt-success);
    transform-origin: left center;
    animation: qatrack-toast-progress var(--toast-duration, 3200ms) linear forwards;
}

.app-toast:has(.toast-status-icon.error) .toast-progress {
    background: var(--qt-danger);
}

.app-toast:has(.toast-status-icon.warning) .toast-progress {
    background: var(--qt-warning);
}

@keyframes qatrack-toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Informational guidance stays as a normal page message */
.alert-info {
    position: relative;
    display: block;
    border: 1px solid #8ddbea;
    border-radius: 13px;
    background: #dcf7fc;
    color: #176274;
    box-shadow: none;
}

body[data-theme="dark"] .alert-info {
    border-color: #276377;
    background: #153643;
    color: #b9e8f3;
}


/* Professional Test Case listing */
.test-case-row td {
    padding-top: 20px;
    padding-bottom: 20px;
}

.test-case-primary {
    min-width: 190px;
}

.test-case-code,
.test-case-title,
.test-case-primary small {
    display: block;
}

.test-case-code {
    margin-bottom: 5px;
    color: var(--qt-primary);
    font-size: 13px;
}

.test-case-title {
    max-width: 240px;
    font-weight: 800;
    line-height: 1.35;
}

.test-case-primary small {
    margin-top: 6px;
    color: var(--qt-muted);
    font-size: 10px;
}

.coverage-stack,
.activity-stack {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 7px;
    color: var(--qt-muted);
    font-size: 12px;
}

.coverage-stack i,
.activity-stack i {
    width: 16px;
    color: #8291a8;
}

.review-inline-note {
    max-width: 260px;
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    background: #fff0f2;
    color: #b73d4d;
    font-size: 11px;
}

.tester-profile {
    min-width: 155px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.tester-avatar {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #e8f8ef;
    color: #108254;
    font-weight: 800;
}

.tester-profile strong,
.tester-profile small {
    display: block;
}

.tester-profile small {
    color: var(--qt-muted);
    font-size: 10px;
}

.priority-pill,
.workflow-pill,
.action-complete-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 800;
}

.priority-low { background: #e9f8ef; color: #138356; }
.priority-medium { background: #fff4dc; color: #a56208; }
.priority-high { background: #ffeadc; color: #c45811; }
.priority-critical { background: #ffe8ec; color: #c63d4d; }

.workflow-draft { background: #edf0f5; color: #66758a; }
.workflow-for-review { background: #fff2d8; color: #a46608; }
.workflow-revision-required { background: #ffe7eb; color: #c43b4b; }
.workflow-approved { background: #e4f8ed; color: #0c8151; }
.workflow-archived { background: #e8ebef; color: #556176; }

.workflow-caption {
    display: block;
    margin-top: 6px;
    color: var(--qt-muted);
    font-size: 10px;
}

.activity-stack {
    min-width: 135px;
}

.latest-result {
    color: var(--qt-text);
}

.test-case-actions {
    min-width: 165px;
}

.action-complete-badge {
    background: #f1f4f8;
    color: #65748a;
    border: 1px solid #dce2ec;
}

.testcase-action-menu {
    min-width: 215px;
    padding: 7px;
    border-radius: 12px;
    border-color: var(--qt-border);
    box-shadow: var(--qt-shadow-md);
}

.testcase-action-menu .dropdown-item {
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 8px;
    font-size: 13px;
}

.testcase-action-menu form {
    margin: 0;
}

.testcase-action-menu form .dropdown-item {
    width: 100%;
}

body[data-theme="dark"] .review-inline-note {
    background: #3c2028;
    color: #ffb2bd;
}

body[data-theme="dark"] .action-complete-badge {
    background: #202d42;
    color: #a9b7ca;
    border-color: #33435b;
}


/* Audit Log role badge and column repair */
.audit-table {
    table-layout: auto;
    min-width: 1180px;
}

.audit-table .audit-date-column {
    width: 125px;
    min-width: 125px;
}

.audit-table .audit-user-column {
    width: 205px;
    min-width: 205px;
}

.audit-table .audit-email-column {
    width: 235px;
    min-width: 235px;
}

.audit-table .audit-role-column {
    width: 160px;
    min-width: 160px;
}

.audit-table .audit-action-column {
    width: 175px;
    min-width: 175px;
}

.audit-table .audit-ip-column {
    width: 100px;
    min-width: 100px;
    white-space: nowrap;
}

.audit-role-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 116px;
    max-width: none !important;
    padding: 7px 13px !important;
    border-radius: 999px;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    line-height: 1.15;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.audit-role-badge.role-admin {
    color: #7a4a00;
    background: #fff2cc;
    border-color: #f4d37a;
}

.audit-role-badge.role-manager {
    color: #3c4eb8;
    background: #ecefff;
    border-color: #cfd6ff;
}

.audit-role-badge.role-qa {
    color: #087a50;
    background: #e5f8ee;
    border-color: #c4ecd8;
}

.audit-role-badge.role-developer {
    color: #8d3a98;
    background: #f7e9fa;
    border-color: #ebc9f0;
}

.audit-role-badge.role-default {
    color: #59677c;
    background: #edf1f6;
    border-color: #dbe2ec;
}

.audit-action-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 92px;
    max-width: 165px;
    padding: 7px 11px !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
}

.audit-date,
.audit-date-column small {
    display: block;
}

.audit-date-column small {
    margin-top: 3px;
    color: var(--qt-muted);
    font-size: 11px;
}

.audit-user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.audit-user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #315bcf;
    background: #edf2ff;
    font-size: 12px;
    font-weight: 800;
}

body[data-theme="dark"] .audit-role-badge.role-admin {
    color: #ffd67c;
    background: #433516;
    border-color: #66501e;
}

body[data-theme="dark"] .audit-role-badge.role-manager {
    color: #bec8ff;
    background: #26305c;
    border-color: #384475;
}

body[data-theme="dark"] .audit-role-badge.role-qa {
    color: #9de8c8;
    background: #183c31;
    border-color: #255446;
}

body[data-theme="dark"] .audit-role-badge.role-developer {
    color: #e7b6ed;
    background: #442848;
    border-color: #603965;
}

body[data-theme="dark"] .audit-user-avatar {
    color: #b8c8ff;
    background: #22325b;
}

@media (max-width: 900px) {
    .audit-table {
        min-width: 1080px;
    }
}


/* User Account assigned manager states */
.assigned-manager-cell {
    min-width: 175px;
}

.manager-na-badge,
.manager-unassigned-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 750;
}

.manager-na-badge {
    color: #66758a;
    background: #eef1f5;
    border: 1px solid #dce2eb;
}

.manager-unassigned-badge {
    color: #a26108;
    background: #fff3dc;
    border: 1px solid #f0d59b;
}

.assigned-manager-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.manager-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #3c4eb8;
    background: #ecefff;
    font-size: 11px;
    font-weight: 800;
}

body[data-theme="dark"] .manager-na-badge {
    color: #a9b7ca;
    background: #202d42;
    border-color: #33435b;
}

body[data-theme="dark"] .manager-unassigned-badge {
    color: #ffd17a;
    background: #453516;
    border-color: #66501e;
}

body[data-theme="dark"] .manager-avatar {
    color: #bec8ff;
    background: #26305c;
}


/* Enterprise analytics and version history pack */
.analytics-panel { min-height: 430px; }
.chart-shell { position: relative; width:100%; min-height:310px; }
.chart-shell canvas { width:100%; height:300px; display:block; }
.chart-shell-donut { min-height:300px; }
.donut-center-label { position:absolute; inset:0; display:grid; place-content:center; text-align:center; pointer-events:none; }
.donut-center-label strong { font-size:32px; }
.donut-center-label span { color:var(--qt-muted); font-size:11px; }
.severity-legend { display:flex; justify-content:center; flex-wrap:wrap; gap:14px; margin-top:5px; font-size:12px; }
.severity-legend span { display:inline-flex; align-items:center; gap:6px; }
.severity-dot { width:9px; height:9px; border-radius:50%; }
.severity-dot-critical{background:#d23f52}.severity-dot-high{background:#e87922}.severity-dot-medium{background:#d6a20a}.severity-dot-low{background:#249a70}

.readiness-panel { text-align:center; }
.readiness-gauge { width:210px;height:210px;margin:15px auto 22px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--qt-primary) calc(var(--readiness) * 3.6),#e8edf5 0);position:relative; }
.readiness-gauge::after { content:"";position:absolute;inset:22px;border-radius:50%;background:var(--qt-surface); }
.readiness-gauge div { position:relative;z-index:1; }
.readiness-gauge strong,.readiness-gauge span{display:block}.readiness-gauge strong{font-size:38px}.readiness-gauge span{font-size:11px;color:var(--qt-muted)}
.readiness-breakdown { display:grid;gap:9px;text-align:left;font-size:12px;color:var(--qt-muted); }
.readiness-breakdown span { display:flex;gap:8px;align-items:center; }

.activity-timeline { position:relative;display:grid;gap:0; }
.timeline-item { display:grid;grid-template-columns:36px 1fr;gap:12px;position:relative;padding-bottom:18px; }
.timeline-item:not(:last-child)::before { content:"";position:absolute;left:17px;top:32px;bottom:0;width:2px;background:var(--qt-border); }
.timeline-marker { width:35px;height:35px;display:grid;place-items:center;border-radius:11px;background:var(--qt-primary-soft);color:var(--qt-primary);z-index:1; }
.timeline-content { padding:10px 13px;border:1px solid var(--qt-border);border-radius:12px;background:var(--qt-surface-soft); }
.timeline-content div { display:flex;flex-wrap:wrap;gap:5px;font-size:13px; }
.timeline-content p { margin:5px 0;color:var(--qt-muted);font-size:12px; }
.timeline-content small { color:var(--qt-muted);font-size:10px; }

.version-current-card { display:flex;align-items:center;gap:12px;padding:15px;border:1px solid var(--qt-border);border-radius:12px;background:var(--qt-surface-soft);margin-bottom:20px; }
.version-current-card span,.version-current-card small{color:var(--qt-muted)}.version-current-card strong{margin-left:auto}
.version-timeline { display:grid;gap:16px; }
.version-entry { display:grid;grid-template-columns:58px 1fr;gap:13px; }
.version-number { width:52px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--qt-primary-soft);color:var(--qt-primary);font-weight:800; }
.version-entry-content { border:1px solid var(--qt-border);border-radius:13px;padding:16px;background:var(--qt-surface); }
.version-entry-content p { margin:8px 0;color:var(--qt-muted);font-size:13px; }
.version-entry-content small { color:var(--qt-muted); }
.version-entry details { border-top:1px solid var(--qt-border);padding-top:12px; }
.version-entry summary { cursor:pointer;color:var(--qt-primary);font-weight:700;font-size:12px; }
.version-snapshot-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px; }
.version-snapshot-grid>div { padding:12px;border-radius:10px;background:var(--qt-surface-soft); }
.version-snapshot-grid span { display:block;color:var(--qt-muted);font-size:10px;margin-bottom:5px; }
.version-snapshot-grid p { white-space:pre-wrap;color:var(--qt-text); }
.version-snapshot-grid .span-2 { grid-column:span 2; }

.report-toolbar { display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:22px; }
.report-toolbar h1 { margin:4px 0; }.report-toolbar p{margin:0;color:var(--qt-muted)}
.report-toolbar-actions { display:flex;align-items:end;gap:10px;flex-wrap:wrap; }
.executive-report { background:#fff;color:#13213a;border-radius:22px;box-shadow:var(--qt-shadow-md);overflow:hidden; }
.report-cover { min-height:220px;padding:38px;display:flex;justify-content:space-between;align-items:center;color:#fff;background:linear-gradient(135deg,#18367e,#3766dc 58%,#6c52d8); }
.report-cover span { text-transform:uppercase;letter-spacing:1.2px;font-size:12px;font-weight:800; }
.report-cover h2 { margin:8px 0;font-size:34px; }.report-cover p{margin:0;color:#dce5ff}
.report-score { width:150px;height:150px;border-radius:50%;display:grid;place-content:center;text-align:center;background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.32); }
.report-score strong,.report-score span{display:block}.report-score strong{font-size:40px}
.report-kpi-grid { display:grid;grid-template-columns:repeat(7,1fr);gap:12px;padding:24px 30px; }
.report-kpi-grid>div { padding:16px;border:1px solid #e4e9f2;border-radius:12px;background:#f8faff; }
.report-kpi-grid span,.report-kpi-grid strong{display:block}.report-kpi-grid span{font-size:10px;color:#6d7a91}.report-kpi-grid strong{font-size:25px;margin-top:4px}
.report-section { padding:10px 30px 28px; }.report-section h3{font-size:18px;margin-bottom:14px}
.executive-assessment { display:flex;gap:16px;align-items:center;padding:18px;border:1px solid #e4e9f2;border-radius:14px;background:#f8faff; }
.assessment-icon { width:54px;height:54px;display:grid;place-items:center;border-radius:15px;font-size:23px; }
.assessment-ready{background:#e4f8ed;color:#108257}.assessment-watch{background:#fff2d8;color:#aa680a}.assessment-risk{background:#ffe7eb;color:#c33d4d}
.executive-assessment p { margin:4px 0 0;color:#68768b; }
.severity-report-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:12px; }
.severity-report-card { padding:18px;border-radius:13px;display:flex;justify-content:space-between;align-items:center; }
.severity-report-card strong{font-size:26px}.severity-report-critical{background:#ffe9ed;color:#bd3547}.severity-report-high{background:#fff0e4;color:#bf5d16}.severity-report-medium{background:#fff5d9;color:#9f7305}.severity-report-low{background:#e7f8ef;color:#128256}
.report-footer { display:flex;justify-content:space-between;padding:20px 30px;border-top:1px solid #e4e9f2;color:#748096;font-size:11px; }
.report-card-featured { background:linear-gradient(145deg,#eff3ff,#fff);border-color:#cbd7ff; }.report-card-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:14px;background:#e3eaff;color:#3a62d2;font-size:21px;margin-bottom:15px}

@media(max-width:1100px){.report-kpi-grid{grid-template-columns:repeat(4,1fr)}}
@media(max-width:700px){.report-toolbar,.report-cover{align-items:flex-start;flex-direction:column}.report-kpi-grid,.severity-report-grid{grid-template-columns:repeat(2,1fr)}.version-snapshot-grid{grid-template-columns:1fr}.version-snapshot-grid .span-2{grid-column:auto}}
@media print {
    .sidebar,.topbar,.report-toolbar,.toast-container{display:none!important}
    .main-area{margin:0!important;width:100%!important}
    .content-area{padding:0!important;max-width:none}
    body{background:#fff!important}
    .executive-report{box-shadow:none;border-radius:0}
    .report-section{break-inside:avoid}
    .report-cover{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}


/* Test Case View Details */
.modal-record-code {
    display: inline-flex;
    margin-bottom: 5px;
    padding: 5px 9px;
    border-radius: 8px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 11px;
    font-weight: 800;
}

.testcase-detail-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.testcase-detail-summary > div {
    padding: 14px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.testcase-detail-summary span,
.testcase-detail-summary strong {
    display: block;
}

.testcase-detail-summary span {
    margin-bottom: 4px;
    color: var(--qt-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.testcase-detail-section {
    margin-top: 20px;
}

.detail-section-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 9px;
}

.detail-section-heading i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
}

.detail-section-heading h6 {
    margin: 0;
    font-weight: 800;
}

.testcase-detail-content {
    min-height: 70px;
    padding: 16px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
    line-height: 1.7;
}

.testcase-steps-content {
    min-height: 120px;
}

.review-comments-content {
    border-color: #efd49a;
    background: #fff7e7;
}

.testcase-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--qt-border);
}

.testcase-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--qt-muted);
    background: var(--qt-surface-soft);
    font-size: 11px;
}

body[data-theme="dark"] .review-comments-content {
    border-color: #5d4a25;
    background: #332a17;
}

@media (max-width: 1100px) {
    .testcase-detail-summary {
        grid-template-columns: repeat(3, minmax(110px, 1fr));
    }
}

@media (max-width: 650px) {
    .testcase-detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .testcase-detail-meta {
        flex-direction: column;
    }
}


/* Test Case Details four-card summary */
.testcase-detail-summary {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}

@media (max-width: 900px) {
    .testcase-detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .testcase-detail-summary {
        grid-template-columns: 1fr;
    }
}


/* Authentication Security Pack */
.auth-security-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .7px;
}
.auth-security-points { display:grid;gap:9px;margin-top:27px;color:rgba(255,255,255,.82);font-size:13px; }
.auth-security-points span { display:flex;align-items:center;gap:8px; }
.auth-card-heading { display:flex;align-items:center;gap:13px;margin-bottom:22px; }
.auth-card-heading h2,.auth-card-heading p { margin:0; }
.auth-lock-icon { width:45px;height:45px;display:grid;place-items:center;border-radius:13px;background:var(--qt-primary-soft);color:var(--qt-primary);font-size:19px; }
.input-icon-group { position:relative; }
.input-icon-group>i { position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#8795aa;z-index:2; }
.input-icon-group .form-control { padding-left:42px;padding-right:45px; }
.password-toggle { position:absolute;right:7px;top:50%;transform:translateY(-50%);width:35px;height:35px;border:0;border-radius:9px;background:transparent;color:#78869b; }
.auth-help { display:flex;gap:8px;margin-top:20px;padding:12px;border-radius:10px;background:#f5f7fb;color:#6c7990;font-size:11px; }

.mfa-page { min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top right,#e7edff,transparent 28rem),#f3f6fb; }
.mfa-card { width:min(480px,100%);padding:34px;border:1px solid #e1e7f0;border-radius:22px;background:#fff;box-shadow:0 24px 65px rgba(23,43,86,.16);text-align:center; }
.mfa-shield { width:68px;height:68px;margin:0 auto 18px;display:grid;place-items:center;border-radius:20px;background:#e9f7ef;color:#128154;font-size:30px; }
.mfa-card h1 { font-size:27px;margin-bottom:9px; }.mfa-card>p{color:#69778e}
.otp-input { height:62px;text-align:center;font-size:27px;font-weight:800;letter-spacing:8px;margin-bottom:17px; }
.trusted-device-option { display:flex;gap:10px;text-align:left;padding:13px;margin-bottom:18px;border:1px solid #e0e6ef;border-radius:11px;background:#f8faff;cursor:pointer; }
.trusted-device-option input { margin-top:4px; }.trusted-device-option strong,.trusted-device-option small{display:block}.trusted-device-option small{color:#76849a;font-size:10px}
.mfa-back-link { display:inline-flex;align-items:center;gap:6px;margin-top:20px;color:#68768b;text-decoration:none;font-size:12px; }

.security-score-badge { display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border-radius:999px;background:#e5f8ee;color:#0d8051;font-size:12px;font-weight:800; }
.security-overview-grid { display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:14px;margin-bottom:24px; }
.security-overview-card { display:flex;align-items:center;gap:13px;padding:17px;border:1px solid var(--qt-border);border-radius:15px;background:var(--qt-surface);box-shadow:var(--qt-shadow-sm); }
.security-overview-card>span { width:43px;height:43px;display:grid;place-items:center;border-radius:12px;background:var(--qt-primary-soft);color:var(--qt-primary);font-size:18px; }
.security-overview-card small,.security-overview-card strong{display:block}.security-overview-card small{color:var(--qt-muted);font-size:10px}.security-overview-card strong{margin-top:3px;font-size:15px}
.mfa-option-card { display:grid;grid-template-columns:48px 1fr auto;gap:13px;align-items:center;padding:17px;margin-top:13px;border:1px solid var(--qt-border);border-radius:14px;background:var(--qt-surface-soft); }
.mfa-option-card.recommended { border-color:#aebfff;background:#f1f4ff; }.mfa-option-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:13px;background:var(--qt-primary-soft);color:var(--qt-primary);font-size:20px}
.mfa-option-card h4,.mfa-option-card p{margin:0}.mfa-option-card h4{font-size:14px}.mfa-option-card h4 small{color:var(--qt-primary);font-size:9px;text-transform:uppercase}.mfa-option-card p{margin-top:4px;color:var(--qt-muted);font-size:11px}
.mfa-enabled-card { display:flex;align-items:center;gap:14px;padding:18px;border-radius:14px;background:#e7f8ef;color:#116f4c; }.mfa-enabled-card>span{font-size:30px}.mfa-enabled-card h4,.mfa-enabled-card p{margin:0}
.mfa-setup-box { padding:18px;border:1px solid var(--qt-border);border-radius:14px;background:var(--qt-surface-soft); }.mfa-setup-box h4{font-size:15px}.mfa-setup-box li{margin-bottom:6px;font-size:12px;color:var(--qt-muted)}
.otp-inline-input { max-width:220px;text-align:center;letter-spacing:5px;font-weight:800; }
.totp-secret-box { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px;border:1px dashed #9eb1df;border-radius:11px;background:#fff; }.totp-secret-box code{font-size:16px;letter-spacing:2px;word-break:break-all}
.otpauth-uri { display:block;margin-top:9px;padding:10px;white-space:normal;word-break:break-all;background:#fff;border-radius:9px; }
.trusted-device-list { display:grid;gap:11px; }.trusted-device-item{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:11px;padding:13px;border:1px solid var(--qt-border);border-radius:12px;background:var(--qt-surface-soft)}
.device-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:11px;background:var(--qt-primary-soft);color:var(--qt-primary)}.trusted-device-item strong,.trusted-device-item small{display:block}.trusted-device-item small{color:var(--qt-muted);font-size:10px}
.login-result,.security-state { display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;white-space:nowrap;font-size:10px;font-weight:800; }
.login-success,.security-mfa{background:#e4f8ed;color:#0d8051}.login-failed,.security-locked{background:#ffe8ec;color:#c43d4d}.security-standard{background:#eef1f6;color:#647389}
.recovery-codes-panel { margin-bottom:24px;padding:22px;border:1px solid #a9bafb;border-radius:17px;background:#f1f4ff; }
.recovery-codes-panel>div:first-child { display:flex;gap:13px;align-items:center; }.recovery-codes-panel h3,.recovery-codes-panel p{margin:0}.recovery-codes-panel p{color:#68768d;font-size:12px}
.recovery-icon{width:47px;height:47px;display:grid;place-items:center;border-radius:13px;background:#dce5ff;color:#345ccb;font-size:20px}
.recovery-code-grid{display:grid!important;grid-template-columns:repeat(4,1fr);gap:10px!important;margin:18px 0!important}.recovery-code-grid code{padding:11px;text-align:center;border-radius:9px;background:#fff;border:1px solid #d7dff3;color:#23375f;font-size:13px;font-weight:800}
.security-history-table { min-width:900px; }

body[data-theme="dark"] .auth-help,
body[data-theme="dark"] .trusted-device-option { background:#192539;border-color:#2d3b53;color:#a8b6ca; }
body[data-theme="dark"] .mfa-option-card.recommended { background:#202d52; }
body[data-theme="dark"] .totp-secret-box,
body[data-theme="dark"] .otpauth-uri { background:#101a2b;color:#dbe5f7; }
body[data-theme="dark"] .recovery-codes-panel { background:#202d52;border-color:#445a9a; }
body[data-theme="dark"] .recovery-code-grid code { background:#111b2c;color:#dce5fa;border-color:#33425d; }

@media(max-width:1000px){.security-overview-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.security-overview-grid,.recovery-code-grid{grid-template-columns:1fr}.mfa-option-card{grid-template-columns:42px 1fr}.mfa-option-card .btn{grid-column:span 2}.trusted-device-item{grid-template-columns:38px 1fr}.trusted-device-item form{grid-column:span 2}.mfa-card{padding:24px}}
@media print { .sidebar,.topbar,.page-heading,.security-overview-grid,.row,.panel,.modal,.toast-container{display:none!important}.recovery-codes-panel{display:block!important;border:0}.recovery-codes-panel .btn{display:none}.content-area{padding:20px!important}.main-area{margin:0!important;width:100%!important} }


/* Authenticator QR Code Setup */
.authenticator-setup-panel {
    padding: 22px;
    border: 1px solid var(--qt-border);
    border-radius: 18px;
    background: var(--qt-surface-soft);
}

.authenticator-setup-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 18px;
}

.authenticator-setup-heading > span {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    flex: 0 0 45px;
    border-radius: 13px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 19px;
}

.authenticator-setup-heading h4,
.authenticator-setup-heading p {
    margin: 0;
}

.authenticator-setup-heading p {
    margin-top: 4px;
    color: var(--qt-muted);
    font-size: 12px;
}

.authenticator-step-list {
    display: grid;
    gap: 9px;
    margin-bottom: 22px;
    padding: 15px;
    border-radius: 13px;
    background: var(--qt-surface);
    border: 1px solid var(--qt-border);
}

.authenticator-step-list > div {
    display: grid;
    grid-template-columns: 29px 1fr;
    align-items: center;
    gap: 10px;
}

.authenticator-step-list > div > span {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--qt-primary);
    font-size: 11px;
    font-weight: 800;
}

.authenticator-step-list p {
    margin: 0;
    color: var(--qt-muted);
    font-size: 12px;
}

.authenticator-setup-grid {
    display: grid;
    grid-template-columns: minmax(270px, .9fr) minmax(320px, 1.1fr);
    gap: 22px;
}

.authenticator-qr-section,
.authenticator-manual-section {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--qt-border);
    border-radius: 15px;
    background: var(--qt-surface);
}

.authenticator-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.authenticator-section-title > i {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
}

.authenticator-section-title h5,
.authenticator-section-title p {
    margin: 0;
}

.authenticator-section-title h5 {
    font-size: 14px;
    font-weight: 800;
}

.authenticator-section-title p {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 10px;
}

.authenticator-qr-card {
    min-height: 260px;
    display: grid;
    place-items: center;
    padding: 18px;
    border: 1px solid var(--qt-border);
    border-radius: 14px;
    background: #fff;
}

.authenticator-qr-code {
    width: 220px;
    height: 220px;
    display: grid;
    place-items: center;
}

.authenticator-qr-code img,
.authenticator-qr-code canvas {
    max-width: 100%;
    height: auto !important;
    image-rendering: pixelated;
}

.authenticator-qr-fallback {
    display: grid;
    place-items: center;
    gap: 5px;
    text-align: center;
    color: #69778e;
}

.authenticator-qr-fallback i {
    font-size: 30px;
}

.authenticator-qr-fallback strong,
.authenticator-qr-fallback span {
    display: block;
}

.authenticator-qr-fallback span {
    font-size: 11px;
}

.authenticator-security-note {
    display: flex;
    gap: 9px;
    margin-top: 13px;
    padding: 11px;
    border: 1px solid #f0d49c;
    border-radius: 10px;
    color: #805a10;
    background: #fff7e5;
    font-size: 10px;
    line-height: 1.5;
}

.enhanced-secret-box {
    flex-wrap: wrap;
    min-height: 68px;
}

.enhanced-secret-box code {
    flex: 1 1 220px;
    color: #e33974;
    font-size: 14px;
    letter-spacing: 2px;
    line-height: 1.6;
}

.copy-feedback {
    min-height: 18px;
    margin: 5px 2px 12px;
    color: var(--qt-success);
    font-size: 10px;
}

.authenticator-account-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.authenticator-account-details > div {
    padding: 11px;
    border: 1px solid var(--qt-border);
    border-radius: 10px;
    background: var(--qt-surface-soft);
}

.authenticator-account-details span,
.authenticator-account-details strong {
    display: block;
}

.authenticator-account-details span {
    margin-bottom: 3px;
    color: var(--qt-muted);
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 800;
}

.authenticator-account-details strong {
    font-size: 11px;
    overflow-wrap: anywhere;
}

.authenticator-uri-details {
    margin-top: 14px;
    padding: 11px;
    border: 1px solid var(--qt-border);
    border-radius: 10px;
}

.authenticator-uri-details summary {
    cursor: pointer;
    color: var(--qt-primary);
    font-size: 11px;
    font-weight: 750;
}

.authenticator-verify-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 22px;
    padding: 17px;
    border: 1px solid #b8e5d1;
    border-radius: 14px;
    background: #edf9f3;
}

.authenticator-verify-section > div {
    display: flex;
    align-items: center;
    gap: 11px;
}

.authenticator-verify-section h5,
.authenticator-verify-section p {
    margin: 0;
}

.authenticator-verify-section h5 {
    font-size: 14px;
}

.authenticator-verify-section p {
    margin-top: 3px;
    color: #5e766b;
    font-size: 10px;
}

.verify-shield {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #0d8152;
    background: #d9f3e6;
    font-size: 18px;
}

.authenticator-verify-form {
    display: flex;
    align-items: center;
    gap: 9px;
}

.authenticator-verify-form .otp-inline-input {
    width: 155px;
    max-width: 155px;
    min-height: 44px;
    font-size: 18px;
}

body[data-theme="dark"] .authenticator-qr-card {
    background: #fff;
}

body[data-theme="dark"] .authenticator-security-note {
    border-color: #685222;
    color: #ffd98b;
    background: #372d18;
}

body[data-theme="dark"] .authenticator-verify-section {
    border-color: #285a47;
    background: #18372c;
}

body[data-theme="dark"] .authenticator-verify-section p {
    color: #9fcab8;
}

@media (max-width: 980px) {
    .authenticator-setup-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .authenticator-setup-panel {
        padding: 15px;
    }

    .authenticator-account-details {
        grid-template-columns: 1fr;
    }

    .authenticator-verify-section,
    .authenticator-verify-form {
        align-items: stretch;
        flex-direction: column;
    }

    .authenticator-verify-form .otp-inline-input {
        width: 100%;
        max-width: none;
    }

    .authenticator-verify-form .btn {
        width: 100%;
    }

    .authenticator-qr-code {
        width: 190px;
        height: 190px;
    }
}


/* Authenticator QR local-library and overlap repair */
.authenticator-setup-panel,
.authenticator-setup-panel * {
    box-sizing: border-box;
}

.authenticator-setup-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
}

.authenticator-qr-section,
.authenticator-manual-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.authenticator-qr-card {
    width: 100%;
    min-width: 0;
    min-height: 250px;
    padding: 20px;
}

.authenticator-qr-code {
    width: 210px;
    height: 210px;
    max-width: 100%;
    margin: 0 auto;
}

.authenticator-qr-code img,
.authenticator-qr-code canvas,
.authenticator-qr-code table {
    display: block !important;
    width: 210px !important;
    height: 210px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

.enhanced-secret-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.enhanced-secret-box code {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
}

.enhanced-secret-box .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.authenticator-account-details {
    width: 100%;
}

.authenticator-uri-details {
    width: 100%;
    overflow: hidden;
}

.authenticator-uri-details .otpauth-uri {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.authenticator-verify-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
}

.authenticator-verify-section > div {
    min-width: 0;
}

.authenticator-verify-form {
    display: grid;
    grid-template-columns: 150px minmax(170px, auto);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.authenticator-verify-form .otp-inline-input {
    width: 150px;
    min-width: 0;
    max-width: 150px;
}

.authenticator-verify-form .btn {
    min-width: 170px;
    width: auto;
    max-width: 220px;
    white-space: normal;
    line-height: 1.25;
    padding: 12px 18px;
}

@media (max-width: 1180px) {
    .authenticator-setup-grid {
        grid-template-columns: 1fr;
    }

    .authenticator-verify-section {
        grid-template-columns: 1fr;
        gap: 16px;
        align-items: stretch;
    }

    .authenticator-verify-form {
        grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
        width: 100%;
    }

    .authenticator-verify-form .otp-inline-input {
        width: 100%;
        max-width: none;
    }

    .authenticator-verify-form .btn {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 620px) {
    .authenticator-setup-heading,
    .authenticator-section-title,
    .authenticator-verify-section > div {
        align-items: flex-start;
    }

    .enhanced-secret-box {
        grid-template-columns: 1fr;
    }

    .enhanced-secret-box .btn {
        width: 100%;
    }

    .authenticator-verify-form {
        grid-template-columns: 1fr;
    }

    .authenticator-verify-form .otp-inline-input,
    .authenticator-verify-form .btn {
        width: 100%;
        max-width: none;
    }

    .authenticator-qr-code,
    .authenticator-qr-code img,
    .authenticator-qr-code canvas,
    .authenticator-qr-code table {
        width: 180px !important;
        height: 180px !important;
    }

    .authenticator-account-details {
        grid-template-columns: 1fr;
    }
}


/* FINAL Authenticator QR overlap correction */
.authenticator-setup-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 20px !important;
    align-items: start !important;
}

.authenticator-qr-section,
.authenticator-manual-section {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
}

.authenticator-qr-card {
    position: relative !important;
    width: 100% !important;
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.authenticator-qr-code {
    position: relative !important;
    width: 176px !important;
    height: 176px !important;
    min-width: 176px !important;
    min-height: 176px !important;
    max-width: 176px !important;
    max-height: 176px !important;
    display: block !important;
    overflow: hidden !important;
    flex: 0 0 176px !important;
    margin: 0 auto !important;
}

.authenticator-qr-code > img,
.authenticator-qr-code > canvas {
    display: block !important;
    width: 176px !important;
    height: 176px !important;
    min-width: 176px !important;
    min-height: 176px !important;
    max-width: 176px !important;
    max-height: 176px !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

.authenticator-qr-code > table {
    width: 176px !important;
    height: 176px !important;
    min-width: 176px !important;
    min-height: 176px !important;
    max-width: 176px !important;
    max-height: 176px !important;
    margin: 0 auto !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

.authenticator-qr-code > table td {
    padding: 0 !important;
    border: 0 !important;
    line-height: 0 !important;
    min-width: 0 !important;
    height: auto !important;
}

.authenticator-security-note {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    margin-top: 14px !important;
    clear: both !important;
}

.authenticator-manual-section {
    display: flex !important;
    flex-direction: column !important;
}

.enhanced-secret-box {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 120px !important;
    align-items: center !important;
}

.enhanced-secret-box code {
    font-size: 13px !important;
    line-height: 1.65 !important;
    letter-spacing: 1.7px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.authenticator-verify-section {
    margin-top: 22px !important;
    grid-template-columns: minmax(240px, 1fr) minmax(330px, auto) !important;
    gap: 20px !important;
}

.authenticator-verify-form {
    grid-template-columns: 150px minmax(190px, 230px) !important;
    gap: 12px !important;
}

.authenticator-verify-form .btn {
    min-width: 190px !important;
    max-width: 230px !important;
    white-space: nowrap !important;
}

@media (max-width: 1100px) {
    .authenticator-setup-grid {
        grid-template-columns: 1fr !important;
    }

    .authenticator-verify-section {
        grid-template-columns: 1fr !important;
    }

    .authenticator-verify-form {
        width: 100% !important;
        grid-template-columns: minmax(0, 1fr) minmax(190px, 230px) !important;
    }
}

@media (max-width: 640px) {
    .authenticator-qr-card {
        height: 200px !important;
        min-height: 200px !important;
        max-height: 200px !important;
    }

    .authenticator-qr-code,
    .authenticator-qr-code > img,
    .authenticator-qr-code > canvas,
    .authenticator-qr-code > table {
        width: 160px !important;
        height: 160px !important;
        min-width: 160px !important;
        min-height: 160px !important;
        max-width: 160px !important;
        max-height: 160px !important;
    }

    .enhanced-secret-box {
        grid-template-columns: 1fr !important;
    }

    .authenticator-verify-form {
        grid-template-columns: 1fr !important;
    }

    .authenticator-verify-form .btn,
    .authenticator-verify-form .otp-inline-input {
        width: 100% !important;
        max-width: none !important;
    }
}


/* FINAL Verify and Enable containment fix */
.authenticator-verify-section {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 390px) !important;
    padding: 18px !important;
}

.authenticator-verify-section > div,
.authenticator-verify-form {
    min-width: 0 !important;
    max-width: 100% !important;
}

.authenticator-verify-form {
    width: 100% !important;
    grid-template-columns: minmax(130px, 165px) minmax(160px, 1fr) !important;
    justify-content: stretch !important;
}

.authenticator-verify-form .otp-inline-input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.authenticator-verify-form .btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

@media (max-width: 1050px) {
    .authenticator-verify-section {
        grid-template-columns: 1fr !important;
    }

    .authenticator-verify-form {
        grid-template-columns: minmax(0, 1fr) minmax(180px, 220px) !important;
    }
}

@media (max-width: 620px) {
    .authenticator-verify-section {
        padding: 14px !important;
    }

    .authenticator-verify-form {
        grid-template-columns: 1fr !important;
    }

    .authenticator-verify-form .btn {
        width: 100% !important;
    }
}


/* Activity History redesign */
.activity-history-heading {
    align-items: flex-end;
}

.activity-history-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.activity-history-actions form {
    margin: 0;
}

.activity-history-actions .btn {
    min-height: 42px;
}

.activity-unread-count {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    margin-left: 5px;
    padding: 0 6px;
    border-radius: 999px;
    color: var(--qt-primary);
    background: #fff;
    font-size: 10px;
    font-weight: 800;
}

.activity-history-panel {
    padding: 0;
    overflow: hidden;
}

.activity-timeline-list {
    position: relative;
}

.activity-history-item {
    display: grid;
    grid-template-columns: 102px minmax(0, 1fr) auto;
    min-height: 118px;
    border-bottom: 1px solid var(--qt-border);
    background: var(--qt-surface);
    transition: background .2s ease, opacity .2s ease;
}

.activity-history-item:last-child {
    border-bottom: 0;
}

.activity-history-item.is-unread {
    background: linear-gradient(90deg, rgba(61, 100, 222, .065), transparent 55%);
}

.activity-history-item.is-read {
    opacity: .86;
}

.activity-icon-column {
    position: relative;
    display: grid;
    place-items: center;
    border-right: 1px solid var(--qt-border);
}

.activity-icon-column::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -1px;
    width: 1px;
    background: var(--qt-border);
}

.activity-type-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 21px;
    z-index: 2;
}

.activity-approved {
    color: #128154;
    background: #e5f8ee;
}

.activity-defect {
    color: #c47709;
    background: #fff4dc;
}

.activity-comment {
    color: #bd3d66;
    background: #ffe9f1;
}

.activity-assignment {
    color: #375fce;
    background: #eaf0ff;
}

.activity-revision {
    color: #8f4cb8;
    background: #f3e9fa;
}

.activity-execution {
    color: #1669ad;
    background: #e5f4ff;
}

.activity-default {
    color: #60708a;
    background: #eef1f6;
}

.activity-timeline-dot {
    position: absolute;
    right: -7px;
    width: 13px;
    height: 13px;
    border: 3px solid var(--qt-surface);
    border-radius: 50%;
    background: #c9d1df;
    z-index: 3;
}

.is-unread .activity-timeline-dot {
    background: var(--qt-primary);
}

.activity-main-content {
    align-self: center;
    min-width: 0;
    padding: 22px 28px;
}

.activity-main-content h3 {
    margin: 0 0 7px;
    font-size: 15px;
    font-weight: 800;
}

.activity-main-content p {
    margin: 0;
    color: var(--qt-muted);
    font-size: 13px;
    line-height: 1.55;
}

.activity-main-content time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: #78869b;
    font-size: 11px;
}

.activity-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 210px;
    padding: 20px 24px;
}

.activity-item-actions form {
    margin: 0;
}

.activity-status-badge {
    min-width: 78px;
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 11px;
    border: 0;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 800;
}

button.activity-status-badge {
    cursor: pointer;
}

.unread-badge {
    color: #2e5ed0;
    background: #e8efff;
}

.unread-badge:hover {
    color: #fff;
    background: var(--qt-primary);
}

.unread-badge .bi-circle-fill {
    font-size: 6px;
}

.read-badge {
    color: #65748a;
    background: #eef1f5;
}

.activity-load-more {
    display: flex;
    justify-content: center;
    padding: 18px;
    border-top: 1px solid var(--qt-border);
    background: var(--qt-surface-soft);
}

.activity-empty-state {
    display: grid;
    place-items: center;
    min-height: 360px;
    padding: 40px;
    text-align: center;
}

.activity-empty-state > span {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 28px;
}

.activity-empty-state h3 {
    margin: 18px 0 6px;
}

.activity-empty-state p {
    max-width: 430px;
    margin: 0;
    color: var(--qt-muted);
}

body[data-theme="dark"] .activity-history-item.is-unread {
    background: linear-gradient(90deg, rgba(95, 128, 235, .13), transparent 55%);
}

body[data-theme="dark"] .activity-unread-count {
    color: #fff;
    background: rgba(255,255,255,.2);
}

@media (max-width: 900px) {
    .activity-history-item {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .activity-icon-column {
        grid-row: span 2;
    }

    .activity-item-actions {
        grid-column: 2;
        min-width: 0;
        justify-content: flex-start;
        padding: 0 20px 20px 28px;
    }

    .activity-main-content {
        padding-bottom: 12px;
    }
}

@media (max-width: 620px) {
    .activity-history-heading {
        align-items: stretch;
    }

    .activity-history-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .activity-history-actions .btn,
    .activity-history-actions form {
        width: 100%;
    }

    .activity-history-item {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .activity-type-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 17px;
    }

    .activity-main-content {
        padding: 18px 15px;
    }

    .activity-item-actions {
        flex-wrap: wrap;
        padding: 0 15px 18px;
    }

    .activity-item-actions .btn,
    .activity-item-actions form,
    .activity-status-badge {
        width: 100%;
    }
}


/* User Story and strict-scope enhancement */
.user-story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.user-story-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--qt-border);
    border-radius: 17px;
    background: var(--qt-surface);
    box-shadow: var(--qt-shadow-sm);
}

.user-story-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.story-key {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 8px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 11px;
    font-weight: 800;
}

.user-story-card h3 {
    margin: 15px 0 7px;
    font-size: 18px;
}

.story-project {
    margin: 0 0 13px;
    color: var(--qt-muted);
    font-size: 12px;
}

.story-description {
    min-height: 58px;
    color: var(--qt-muted);
    font-size: 12px;
    line-height: 1.65;
}

.story-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.story-metrics span,
.story-link-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 9px;
    background: var(--qt-surface-soft);
    color: var(--qt-muted);
    font-size: 10px;
}

.story-metrics strong {
    color: var(--qt-text);
}

.story-acceptance {
    margin-top: 14px;
    border-top: 1px solid var(--qt-border);
    padding-top: 12px;
}

.story-acceptance summary {
    cursor: pointer;
    color: var(--qt-primary);
    font-size: 11px;
    font-weight: 750;
}

.story-acceptance p {
    margin: 10px 0 0;
    color: var(--qt-muted);
    font-size: 11px;
    line-height: 1.65;
}

@media (max-width: 1100px) {
    .user-story-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
    .user-story-grid { grid-template-columns: 1fr; }
}


/* User Story form usability enhancement */
.required-asterisk {
    color: #dc3545;
    font-weight: 900;
}

.auto-story-number-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #b9c9fb;
    border-radius: 12px;
    background: #f1f5ff;
}

.auto-story-number-notice > i {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    border-radius: 11px;
    color: var(--qt-primary);
    background: #dfe8ff;
    font-size: 18px;
}

.auto-story-number-notice strong,
.auto-story-number-notice span {
    display: block;
}

.auto-story-number-notice strong {
    font-size: 12px;
}

.auto-story-number-notice span {
    margin-top: 3px;
    color: var(--qt-muted);
    font-size: 10px;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #9aa7ba;
    opacity: 1;
}

body[data-theme="dark"] .auto-story-number-notice {
    border-color: #41568f;
    background: #202d4d;
}


/* Global Priority and Status standardization */
.priority-low,
.priority-badge-low {
    color: #0d8051 !important;
    background: #e5f8ee !important;
}

.priority-medium,
.priority-badge-medium {
    color: #a56700 !important;
    background: #fff4d8 !important;
}

.priority-high,
.priority-badge-high {
    color: #c65b12 !important;
    background: #fff0e4 !important;
}

.priority-critical,
.priority-badge-critical {
    color: #c83849 !important;
    background: #ffe7eb !important;
}

.workflow-draft,
.status-draft {
    color: #65748a !important;
    background: #eef1f5 !important;
}

.workflow-ready,
.status-ready {
    color: #2e5ed0 !important;
    background: #e8efff !important;
}

.workflow-in-progress,
.status-in-progress {
    color: #ba620b !important;
    background: #fff0de !important;
}

.workflow-completed,
.status-completed {
    color: #7442b4 !important;
    background: #f0e7fb !important;
}

.workflow-accepted,
.status-accepted,
.status-approved {
    color: #0d8051 !important;
    background: #e5f8ee !important;
}

.status-rejected,
.status-blocked {
    color: #c83849 !important;
    background: #ffe7eb !important;
}

.status-resolved,
.status-retest {
    color: #116f9d !important;
    background: #e5f5fc !important;
}

.status-closed {
    color: #23634a !important;
    background: #deefe7 !important;
}

.form-select:invalid {
    color: #8a97aa;
}

.form-select option {
    color: var(--qt-text);
}


/* Exact modal required-field correction */
.required-asterisk {
    color: #dc3545;
    font-weight: 900;
}

.modal select.form-select:required:invalid {
    color: #8b97a9;
}

.modal select.form-select option[value=""] {
    color: #8b97a9;
}

.modal select.form-select option:not([value=""]) {
    color: var(--qt-text);
}

.filter-grid .required-asterisk {
    display: none !important;
}

.modal .row.g-3 > [class*="col-"] {
    min-width: 0;
}


/* Project card Test Manager and QA Tester details */
.project-team-section {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 18px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--qt-border);
}

.project-team-column,
.project-manager-chip > span:last-child {
    min-width: 0;
}

.project-team-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: var(--qt-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.project-team-label > i {
    color: var(--qt-primary);
    font-size: 13px;
}

.project-team-count {
    min-width: 21px;
    height: 21px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 9px;
}

.project-manager-list {
    display: grid;
    gap: 8px;
}

.project-manager-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.project-manager-chip strong,
.project-manager-chip small {
    display: block;
}

.project-manager-chip strong {
    overflow: hidden;
    color: var(--qt-text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-manager-chip small {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 9px;
}

.project-person-avatar {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 32px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 850;
}

.manager-avatar {
    color: #fff;
    background: var(--qt-primary);
}

.qa-avatar {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 8px;
    color: #11774e;
    background: #dff6eb;
    font-size: 9px;
}

.project-qa-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-qa-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--qt-border);
    border-radius: 999px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
    font-size: 10px;
    font-weight: 700;
}

.project-team-empty {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px dashed var(--qt-border);
    border-radius: 11px;
    color: var(--qt-muted);
    background: var(--qt-surface-soft);
    font-size: 10px;
}

@media (max-width: 760px) {
    .project-team-section {
        grid-template-columns: 1fr;
    }

    .project-qa-chip {
        width: 100%;
        border-radius: 11px;
    }
}


/* Enhanced Project Team UI */
.project-team-panel {
    margin-top: 22px;
    border: 1px solid var(--qt-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--qt-surface-soft);
}

.project-team-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--qt-border);
    background: var(--qt-surface);
}

.project-team-panel-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.project-team-panel-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 11px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 17px;
}

.project-team-panel-header strong,
.project-team-panel-header small {
    display: block;
}

.project-team-panel-header strong {
    color: var(--qt-text);
    font-size: 13px;
}

.project-team-panel-header small {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 9px;
}

.project-resource-summary {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.project-team-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 14px;
    padding: 14px;
}

.project-role-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--qt-border);
    border-radius: 13px;
    background: var(--qt-surface);
}

.manager-role-card {
    box-shadow: inset 3px 0 0 var(--qt-primary);
}

.qa-role-card {
    box-shadow: inset 3px 0 0 #20a46b;
}

.project-role-heading {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}

.project-role-heading > div {
    min-width: 0;
}

.project-role-heading strong,
.project-role-heading small {
    display: block;
}

.project-role-heading strong {
    color: var(--qt-text);
    font-size: 12px;
}

.project-role-heading small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--qt-muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-role-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 15px;
}

.manager-role-icon {
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
}

.qa-role-icon {
    color: #138258;
    background: #e1f7ed;
}

.project-role-count {
    min-width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--qt-muted);
    background: var(--qt-surface-soft);
    font-size: 9px;
    font-weight: 850;
}

.project-member-list {
    display: grid;
    gap: 8px;
}

.project-qa-member-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
}

.project-member-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--qt-border);
    border-radius: 11px;
    background: var(--qt-surface-soft);
}

.compact-member-item {
    padding: 8px 9px;
}

.project-member-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 850;
}

.manager-member-avatar {
    color: #fff;
    background: var(--qt-primary);
}

.qa-member-avatar {
    color: #0c7650;
    background: #dff6eb;
}

.project-member-info {
    min-width: 0;
}

.project-member-info strong,
.project-member-info span {
    display: block;
}

.project-member-info strong {
    overflow: hidden;
    color: var(--qt-text);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-member-info span {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    color: var(--qt-muted);
    font-size: 8px;
}

.project-role-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 11px;
    border: 1px dashed var(--qt-border);
    border-radius: 11px;
    color: var(--qt-muted);
    background: var(--qt-surface-soft);
}

.project-role-empty > i {
    font-size: 20px;
}

.project-role-empty strong,
.project-role-empty span {
    display: block;
}

.project-role-empty strong {
    color: var(--qt-text);
    font-size: 10px;
}

.project-role-empty span {
    margin-top: 2px;
    font-size: 8px;
}

@media (max-width: 900px) {
    .project-team-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .project-team-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-resource-summary {
        width: 100%;
        justify-content: center;
    }

    .project-qa-member-grid {
        grid-template-columns: 1fr;
    }
}


/* Simplified Project Team names and View Project modal */
.project-team-simple {
    display: grid;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    border: 1px solid var(--qt-border);
    border-radius: 13px;
    background: var(--qt-surface-soft);
}

.project-team-simple-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.project-team-simple-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--qt-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.project-team-simple-label i {
    color: var(--qt-primary);
}

.project-team-simple-row strong {
    min-width: 0;
    color: var(--qt-text);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.project-card-footer-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.project-view-id {
    display: block;
    margin-bottom: 3px;
    color: var(--qt-primary);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .07em;
}

.project-view-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.project-view-summary > div {
    padding: 13px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.project-view-summary span,
.project-view-summary strong {
    display: block;
}

.project-view-summary span {
    color: var(--qt-muted);
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 800;
}

.project-view-summary strong {
    margin-top: 5px;
    color: var(--qt-text);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.project-view-section {
    margin-top: 16px;
    padding: 15px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface);
}

.project-view-section h6 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    font-size: 12px;
}

.project-view-section h6 i {
    color: var(--qt-primary);
}

.project-view-section p {
    margin: 0;
    color: var(--qt-muted);
    font-size: 11px;
    line-height: 1.65;
}

.project-view-name-list {
    margin: 0;
    padding-left: 18px;
    color: var(--qt-text);
    font-size: 11px;
}

.project-view-name-list li + li {
    margin-top: 6px;
}

@media (max-width: 760px) {
    .project-team-simple-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .project-view-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .project-view-summary {
        grid-template-columns: 1fr;
    }

    .project-card-footer-actions .btn {
        width: 100%;
    }
}


/* Project View modal blinking and stacking fix */
.project-view-trigger {
    position: relative;
    z-index: 1;
}

.project-view-modal {
    z-index: 1060;
}

.project-view-modal .modal-dialog {
    transform: none;
    transition: none;
}

.project-view-modal.fade .modal-dialog {
    transform: none;
}

.project-view-modal.show .modal-dialog {
    transform: none;
}

.project-view-modal .modal-content {
    position: relative;
    z-index: 1;
    animation: none !important;
    transition: none !important;
}

.project-view-modal .modal-backdrop,
body.project-view-modal-open .modal-backdrop {
    animation: none !important;
    transition: opacity .12s linear !important;
}

body.project-view-modal-open {
    overflow: hidden;
}

body.project-view-modal-open .project-card,
body.project-view-modal-open .panel {
    transform: none !important;
}

.modal-backdrop {
    z-index: 1055;
}


/* Final Project modal hover/mouse-movement stability fix */
body.project-modal-active .project-card,
body.project-modal-active .project-card:hover,
body.project-modal-active .panel,
body.project-modal-active .panel:hover {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

body.project-modal-active .project-card::before,
body.project-modal-active .project-card::after {
    animation: none !important;
    transition: none !important;
}

.project-view-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    pointer-events: none;
    z-index: 1065 !important;
}

.project-view-modal.show {
    pointer-events: auto;
}

.project-view-modal .modal-dialog {
    position: relative;
    margin: 1.75rem auto;
    pointer-events: none;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
}

.project-view-modal .modal-content {
    pointer-events: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout paint;
}

.project-view-modal.fade,
.project-view-modal.fade .modal-dialog,
.project-view-modal.show,
.project-view-modal.show .modal-dialog {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

body.project-modal-active {
    overflow: hidden !important;
}

body.project-modal-active .modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    transition: none !important;
    animation: none !important;
    z-index: 1060 !important;
}


/* Notification View Message enhancement */
.notification-view-trigger {
    white-space: nowrap;
}

.notification-message-modal {
    z-index: 1065;
}

.notification-message-modal .modal-dialog {
    max-width: 620px;
}

.notification-modal-label {
    display: block;
    margin-bottom: 3px;
    color: var(--qt-primary);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.notification-message-body {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.notification-message-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    font-size: 21px;
}

.notification-message-body p {
    margin: 0;
    color: var(--qt-text);
    font-size: 13px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.notification-message-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    color: var(--qt-muted);
    font-size: 10px;
}

.notification-message-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.message-unread-state {
    color: #2e5ed0;
    font-weight: 800;
}

.message-unread-state .bi-circle-fill {
    font-size: 6px;
}

.message-read-state {
    color: #188157;
    font-weight: 800;
}

@media (max-width: 620px) {
    .notification-message-body {
        grid-template-columns: 1fr;
    }

    .notification-message-icon {
        width: 44px;
        height: 44px;
    }

    .activity-item-actions .btn,
    .activity-item-actions form,
    .activity-item-actions .activity-status-badge {
        width: 100%;
    }
}


/* Defect evidence and lifecycle modal fix */
.defect-lifecycle-modal {
    z-index: 1065 !important;
}

.defect-lifecycle-modal .modal-dialog,
.defect-lifecycle-modal.fade .modal-dialog,
.defect-lifecycle-modal.show .modal-dialog {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

.defect-lifecycle-modal .modal-content,
.defect-lifecycle-modal input,
.defect-lifecycle-modal textarea,
.defect-lifecycle-modal select,
.defect-lifecycle-modal button {
    pointer-events: auto !important;
}

.defect-lifecycle-modal .modal-content {
    transform: translateZ(0);
    backface-visibility: hidden;
}

input[type="file"]:required:invalid {
    border-color: #dc3545;
}


/* Defects modal structure and interaction fix */
.defect-lifecycle-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1065 !important;
}

.defect-lifecycle-modal .modal-dialog,
.defect-lifecycle-modal.fade .modal-dialog,
.defect-lifecycle-modal.show .modal-dialog {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

.defect-lifecycle-modal .modal-content {
    pointer-events: auto !important;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.defect-lifecycle-modal input,
.defect-lifecycle-modal textarea,
.defect-lifecycle-modal select,
.defect-lifecycle-modal button,
.defect-lifecycle-modal label {
    pointer-events: auto !important;
}

input[type="file"]:required:invalid {
    border-color: #dc3545;
}


/* Defect lifecycle modal final working structure */
.defect-lifecycle-modal {
    z-index: 1065;
}

.defect-lifecycle-modal .modal-dialog {
    pointer-events: none;
}

.defect-lifecycle-modal .modal-content {
    pointer-events: auto;
}

.defect-lifecycle-modal .form-select,
.defect-lifecycle-modal .form-control,
.defect-lifecycle-modal .btn {
    pointer-events: auto;
}


/* Enhanced User Story card */
.user-story-card-enhanced {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 20px;
    border: 1px solid var(--qt-border);
    border-radius: 18px;
    background: var(--qt-surface);
    box-shadow: 0 12px 30px rgba(24, 39, 75, .06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.user-story-card-enhanced:hover {
    transform: translateY(-2px);
    border-color: rgba(76, 110, 245, .28);
    box-shadow: 0 16px 36px rgba(24, 39, 75, .1);
}

.user-story-card-top {
    min-width: 0;
}

.user-story-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.user-story-key {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 11px;
    border-radius: 10px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
}

.user-story-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
}

.user-story-title {
    margin: 0;
    color: var(--qt-text);
    font-size: 18px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.user-story-project {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    color: var(--qt-muted);
    font-size: 10px;
}

.user-story-project i {
    color: var(--qt-primary);
}

.user-story-description {
    margin: 16px 0 0;
    color: var(--qt-muted);
    font-size: 11px;
    line-height: 1.7;
}

.user-story-description-empty {
    font-style: italic;
}

.user-story-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-top: 22px;
}

.user-story-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.user-story-metric-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 8px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 12px;
}

.user-story-metric strong,
.user-story-metric small {
    display: block;
}

.user-story-metric strong {
    overflow: hidden;
    color: var(--qt-text);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-story-metric small {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 8px;
}

.user-story-acceptance {
    margin-top: 18px;
    border-top: 1px solid var(--qt-border);
    border-bottom: 1px solid var(--qt-border);
}

.user-story-acceptance summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 0;
    color: var(--qt-primary);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    list-style: none;
}

.user-story-acceptance summary::-webkit-details-marker {
    display: none;
}

.user-story-acceptance summary span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.acceptance-chevron {
    transition: transform .18s ease;
}

.user-story-acceptance[open] .acceptance-chevron {
    transform: rotate(180deg);
}

.user-story-acceptance-content {
    padding: 0 0 14px;
    color: var(--qt-muted);
    font-size: 10px;
    line-height: 1.7;
}

.user-story-actions {
    display: flex;
    gap: 9px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.user-story-actions .btn {
    min-height: 36px;
}

.user-story-modal-key {
    display: block;
    margin-bottom: 3px;
    color: var(--qt-primary);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
}

.user-story-view-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.user-story-view-summary > div {
    padding: 12px;
    border: 1px solid var(--qt-border);
    border-radius: 11px;
    background: var(--qt-surface-soft);
}

.user-story-view-summary span,
.user-story-view-summary strong {
    display: block;
}

.user-story-view-summary span {
    color: var(--qt-muted);
    font-size: 8px;
    text-transform: uppercase;
    font-weight: 800;
}

.user-story-view-summary strong {
    margin-top: 5px;
    color: var(--qt-text);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.user-story-view-section {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface);
}

.user-story-view-section h6 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    font-size: 11px;
}

.user-story-view-section h6 i {
    color: var(--qt-primary);
}

.user-story-view-section p {
    margin: 0;
    color: var(--qt-muted);
    font-size: 10px;
    line-height: 1.75;
}

@media (max-width: 780px) {
    .user-story-metrics,
    .user-story-view-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .user-story-metrics,
    .user-story-view-summary {
        grid-template-columns: 1fr;
    }

    .user-story-actions .btn {
        width: 100%;
    }
}


/* User Story page final layout correction */
.user-story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 22px;
    align-items: start;
    width: 100%;
}

.user-story-grid .user-story-card-enhanced {
    width: 100%;
    min-width: 0;
    min-height: auto;
    height: auto;
    margin: 0;
}

.user-story-card-enhanced {
    justify-content: flex-start;
}

.user-story-card-top {
    flex: 0 0 auto;
}

.user-story-description {
    min-height: 38px;
    max-height: 78px;
    overflow: hidden;
}

.user-story-actions {
    margin-top: 18px;
    padding-top: 2px;
}

.user-story-coverage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

.user-story-coverage-grid > div {
    padding: 14px;
    border: 1px solid var(--qt-border);
    border-radius: 11px;
    background: var(--qt-surface-soft);
}

.user-story-coverage-grid strong,
.user-story-coverage-grid span {
    display: block;
}

.user-story-coverage-grid strong {
    color: var(--qt-text);
    font-size: 18px;
}

.user-story-coverage-grid span {
    margin-top: 4px;
    color: var(--qt-muted);
    font-size: 9px;
}

.user-story-view-modal {
    z-index: 1065;
}

@media (min-width: 1400px) {
    .user-story-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

@media (min-width: 900px) and (max-width: 1399px) {
    .user-story-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 899px) {
    .user-story-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .user-story-grid {
        gap: 14px;
    }

    .user-story-card-enhanced {
        padding: 16px;
        border-radius: 14px;
    }

    .user-story-metrics {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}


/* Final User Story card width and interaction fix */
.user-story-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
}

.user-story-card-enhanced {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.user-story-card-enhanced * {
    box-sizing: border-box;
}

.user-story-identity {
    flex-wrap: wrap;
}

.user-story-title,
.user-story-project,
.user-story-description,
.user-story-metric strong,
.user-story-metric small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.user-story-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.user-story-metric {
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden;
}

.user-story-metric > div {
    min-width: 0;
}

.user-story-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.user-story-actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
}

.user-story-view-modal {
    z-index: 1065 !important;
}

.user-story-view-modal .modal-dialog {
    pointer-events: none;
}

.user-story-view-modal .modal-content {
    pointer-events: auto;
}

@media (max-width: 700px) {
    .user-story-grid {
        grid-template-columns: 1fr !important;
    }

    .user-story-metrics {
        grid-template-columns: 1fr 1fr !important;
    }

    .user-story-actions {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 420px) {
    .user-story-card-enhanced {
        padding: 14px !important;
        border-radius: 14px !important;
    }

    .user-story-metrics {
        grid-template-columns: 1fr !important;
    }

    .user-story-identity {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-story-key,
    .user-story-status {
        max-width: 100%;
    }
}


/* Compact User Story card */
.user-story-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px)) !important;
    justify-content: start !important;
    gap: 16px !important;
}

.user-story-card-enhanced {
    width: 100% !important;
    max-width: 320px !important;
    min-height: 0 !important;
    padding: 16px !important;
    border-radius: 15px !important;
}

.user-story-card-clickable {
    cursor: pointer;
}

.user-story-card-clickable:focus-visible {
    outline: 3px solid rgba(55, 102, 241, .25);
    outline-offset: 3px;
}

.user-story-identity {
    margin-bottom: 12px !important;
}

.user-story-key {
    min-height: 28px !important;
    padding: 5px 9px !important;
    font-size: 9px !important;
}

.user-story-status {
    min-height: 27px !important;
    padding: 5px 9px !important;
    font-size: 8px !important;
}

.user-story-title {
    font-size: 16px !important;
    line-height: 1.3 !important;
}

.user-story-project {
    margin-top: 6px !important;
    font-size: 9px !important;
}

.user-story-description {
    min-height: 0 !important;
    max-height: 54px !important;
    margin-top: 10px !important;
    font-size: 10px !important;
    line-height: 1.55 !important;
}

.user-story-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 16px !important;
}

.user-story-metric {
    min-height: 52px !important;
    padding: 8px !important;
    gap: 7px !important;
}

.user-story-metric-icon {
    width: 25px !important;
    height: 25px !important;
    flex-basis: 25px !important;
    font-size: 10px !important;
}

.user-story-metric strong {
    font-size: 9px !important;
}

.user-story-metric small {
    font-size: 7px !important;
}

.user-story-acceptance {
    margin-top: 14px !important;
}

.user-story-acceptance summary {
    padding: 10px 0 !important;
    font-size: 9px !important;
}

.user-story-acceptance-content {
    padding-bottom: 11px !important;
    font-size: 9px !important;
}

.compact-story-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-top: 14px !important;
}

.compact-story-actions .btn {
    width: auto !important;
    min-height: 34px !important;
    padding: 7px 11px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
}

.user-story-open-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--qt-muted);
    font-size: 8px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .user-story-grid {
        grid-template-columns: minmax(0, 320px) !important;
        justify-content: center !important;
    }
}

@media (max-width: 360px) {
    .user-story-grid {
        grid-template-columns: 1fr !important;
    }

    .user-story-card-enhanced {
        max-width: none !important;
    }

    .compact-story-actions {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .compact-story-actions .btn {
        width: 100% !important;
    }

    .user-story-open-hint {
        justify-content: center;
    }
}


/* User Stories full UI rebuild */
.user-story-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: start !important;
}

.user-story-card-modern {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--qt-border);
    border-radius: 18px;
    background: var(--qt-surface);
    box-shadow: 0 12px 28px rgba(24, 39, 75, .07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.user-story-card-modern:hover {
    transform: translateY(-2px);
    border-color: rgba(64, 105, 255, .30);
    box-shadow: 0 16px 34px rgba(24, 39, 75, .11);
}

.user-story-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.user-story-key-modern {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 11px;
    border-radius: 10px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .03em;
}

.user-story-status-modern {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
}

.user-story-card-main h3 {
    margin: 0;
    color: var(--qt-text);
    font-size: 20px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.user-story-project-modern {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    color: var(--qt-muted);
    font-size: 13px;
    font-weight: 600;
}

.user-story-project-modern i {
    color: var(--qt-primary);
}

.user-story-description-modern {
    min-height: 48px;
    max-height: 86px;
    margin: 14px 0 0;
    overflow: hidden;
    color: var(--qt-muted);
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.user-story-metrics-modern {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.user-story-metric-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--qt-border);
    border-radius: 13px;
    background: var(--qt-surface-soft);
}

.user-story-metric-modern .metric-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border-radius: 10px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 14px;
}

.user-story-metric-modern > div {
    min-width: 0;
}

.user-story-metric-modern strong,
.user-story-metric-modern small {
    display: block;
}

.user-story-metric-modern strong {
    overflow: hidden;
    color: var(--qt-text);
    font-size: 14px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-story-metric-modern small {
    margin-top: 3px;
    color: var(--qt-muted);
    font-size: 11px;
}

.user-story-acceptance-modern {
    margin-top: 18px;
    border-top: 1px solid var(--qt-border);
    border-bottom: 1px solid var(--qt-border);
}

.user-story-acceptance-modern summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 0;
    color: var(--qt-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    list-style: none;
}

.user-story-acceptance-modern summary::-webkit-details-marker {
    display: none;
}

.user-story-acceptance-modern summary span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.user-story-acceptance-modern > div {
    padding: 0 0 14px;
    color: var(--qt-muted);
    font-size: 13px;
    line-height: 1.65;
}

.user-story-card-actions-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.user-story-card-actions-modern .btn {
    min-width: 0;
    min-height: 38px;
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 750;
}

.user-story-view-modal {
    z-index: 1065 !important;
}

@media (min-width: 1400px) {
    .user-story-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 900px) and (max-width: 1399px) {
    .user-story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 899px) {
    .user-story-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 520px) {
    .user-story-card-modern {
        padding: 16px;
        border-radius: 15px;
    }

    .user-story-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-story-metrics-modern {
        grid-template-columns: 1fr;
    }

    .user-story-card-actions-modern {
        align-items: stretch;
        flex-direction: column;
    }

    .user-story-card-actions-modern .btn {
        width: 100%;
    }
}


/* Restored User Story Edit modal */
.user-story-edit-modal {
    z-index: 1065 !important;
}

.user-story-edit-modal .modal-dialog {
    max-width: 760px;
}

.user-story-edit-modal .form-label {
    margin-bottom: 7px;
    color: var(--qt-text);
    font-size: 13px;
    font-weight: 750;
}

.user-story-edit-modal .form-control,
.user-story-edit-modal .form-select {
    min-height: 46px;
    font-size: 14px;
}

.user-story-edit-modal textarea.form-control {
    min-height: 110px;
    line-height: 1.6;
}


/* Test Manager Test Case update */
.test-case-manager-edit-modal {
    z-index: 1065 !important;
}

.test-case-manager-edit-modal .modal-dialog {
    max-width: 1050px;
}

.test-case-edit-key {
    display: block;
    margin-bottom: 3px;
    color: var(--qt-primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
}

.test-case-manager-edit-modal .form-label {
    margin-bottom: 7px;
    color: var(--qt-text);
    font-size: 13px;
    font-weight: 750;
}

.test-case-manager-edit-modal .form-control,
.test-case-manager-edit-modal .form-select {
    min-height: 46px;
    font-size: 14px;
}

.test-case-manager-edit-modal textarea.form-control {
    min-height: 96px;
    line-height: 1.6;
}


/* Test Manager Test Case governance */
.test-case-manager-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.manager-test-case-form .modal-body {
    background: var(--qt-surface-soft);
}

.manager-edit-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #b8e6d1;
    border-radius: 13px;
    color: #0d6b49;
    background: #eaf9f2;
}

.manager-edit-notice > i {
    font-size: 23px;
}

.manager-edit-notice strong,
.manager-edit-notice span {
    display: block;
}

.manager-edit-notice strong {
    font-size: 13px;
}

.manager-edit-notice span {
    margin-top: 2px;
    font-size: 11px;
}

.manager-edit-section {
    padding: 18px;
    margin-top: 14px;
    border: 1px solid var(--qt-border);
    border-radius: 14px;
    background: var(--qt-surface);
}

.manager-edit-section-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
}

.manager-edit-section-title > i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 15px;
}

.manager-edit-section-title strong,
.manager-edit-section-title small {
    display: block;
}

.manager-edit-section-title strong {
    color: var(--qt-text);
    font-size: 14px;
}

.manager-edit-section-title small {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 10px;
}

.manager-edit-footer {
    gap: 8px;
    flex-wrap: wrap;
}

.manager-edit-footer .btn {
    min-height: 40px;
}

@media (max-width: 780px) {
    .test-case-manager-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .test-case-manager-actions .btn {
        width: 100%;
    }

    .manager-edit-footer .btn {
        width: 100%;
    }
}


/* Test Manager update-only modal */
.manager-update-header {
    align-items: flex-start;
}

.manager-update-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.version-chip {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #5d4bb7;
    background: #f0edff;
    font-size: 9px;
    font-weight: 850;
}

.manager-update-body {
    background: var(--qt-surface-soft);
}

.manager-update-layout {
    display: grid;
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.manager-update-readonly {
    position: sticky;
    top: 0;
    padding: 18px;
    border: 1px solid var(--qt-border);
    border-radius: 15px;
    background: var(--qt-surface);
}

.manager-update-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.manager-update-panel-title > i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
}

.manager-update-panel-title strong,
.manager-update-panel-title small {
    display: block;
}

.manager-update-panel-title strong {
    color: var(--qt-text);
    font-size: 13px;
}

.manager-update-panel-title small {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 9px;
}

.manager-readonly-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.manager-readonly-list > div {
    display: grid;
    gap: 4px;
    padding: 11px 0;
    border-bottom: 1px solid var(--qt-border);
}

.manager-readonly-list > div:last-child {
    border-bottom: 0;
}

.manager-readonly-list dt {
    margin: 0;
    color: var(--qt-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.manager-readonly-list dd {
    margin: 0;
    color: var(--qt-text);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.manager-workflow-note {
    display: flex;
    gap: 9px;
    margin-top: 15px;
    padding: 12px;
    border: 1px solid #bcd9ff;
    border-radius: 11px;
    color: #24558f;
    background: #eef6ff;
}

.manager-workflow-note strong,
.manager-workflow-note span {
    display: block;
}

.manager-workflow-note strong {
    font-size: 10px;
}

.manager-workflow-note span {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.5;
}

.manager-update-editable {
    min-width: 0;
}

.manager-change-summary {
    padding: 18px;
    margin-top: 14px;
    border: 1px solid #b8e6d1;
    border-radius: 14px;
    background: #f1fbf6;
}

.manager-change-summary-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.manager-change-item,
.manager-no-changes {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 750;
}

.manager-change-item {
    color: #08744e;
    background: #dcf6e9;
}

.manager-no-changes {
    color: var(--qt-muted);
    background: var(--qt-surface);
}

.manager-update-footer {
    position: sticky;
    bottom: 0;
    justify-content: flex-end;
    gap: 10px;
    background: var(--qt-surface);
}

.manager-update-submit {
    min-width: 170px;
}

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

    .manager-update-readonly {
        position: static;
    }
}

@media (max-width: 560px) {
    .manager-update-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .manager-update-footer .btn {
        width: 100%;
    }
}


/* QA Test Case approval gating */
.qa-test-case-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.qa-under-review-button,
.qa-under-review-button:disabled {
    color: #6b7280;
    border-color: #d8dee9;
    background: #eef1f5;
    opacity: 1;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .qa-test-case-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .qa-test-case-actions .btn {
        width: 100%;
    }
}


/* Disabled Test Manager Under Review action */
.test-case-under-review,
.test-case-under-review:disabled {
    color: #7a5a00;
    border-color: #f0d993;
    background: #fff4d5;
    opacity: 1;
    cursor: not-allowed;
    box-shadow: none;
}


/* QA Tester and Developer Project Assignments */
.assignment-panel-heading,
.assignment-list-heading {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 18px;
}

.assignment-panel-heading h3,
.assignment-list-heading h3 {
    margin: 0;
    color: var(--qt-text);
    font-size: 17px;
}

.assignment-panel-heading p,
.assignment-list-heading p {
    margin: 4px 0 0;
    color: var(--qt-muted);
    font-size: 11px;
}

.assignment-panel-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 11px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 16px;
}

.assignment-role-note {
    display: grid;
    gap: 8px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--qt-border);
    border-radius: 11px;
    background: var(--qt-surface-soft);
}

.assignment-role-note > div {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--qt-muted);
    font-size: 10px;
    line-height: 1.5;
}

.assignment-role-note i {
    color: var(--qt-primary);
    font-size: 13px;
}

.assignment-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
}

.assignment-role-badge.role-qa-tester {
    color: #3158ca;
    background: #eaf0ff;
}

.assignment-role-badge.role-developer {
    color: #6c3db5;
    background: #f1eaff;
}

.assignment-empty-state {
    display: grid;
    place-items: center;
    padding: 42px 20px;
    color: var(--qt-muted);
    text-align: center;
}

.assignment-empty-state i {
    margin-bottom: 9px;
    font-size: 25px;
}

.assignment-empty-state strong {
    color: var(--qt-text);
    font-size: 13px;
}

.assignment-empty-state span {
    margin-top: 4px;
    font-size: 10px;
}


/* Developer self-assignment */
.self-assign-defect-form {
    display: inline-flex;
}

.self-assign-defect-form .btn {
    white-space: nowrap;
}

.developer-assignment-readonly {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 9px;
    color: var(--qt-muted);
    background: var(--qt-surface-soft);
    font-size: 9px;
    font-weight: 750;
}


/* Extended Defect lifecycle statuses */
.status-ready-for-qa-testing,
.badge-ready-for-qa-testing {
    color: #3158ca;
    background: #eaf0ff;
}

.status-completed,
.badge-completed {
    color: #08744e;
    background: #dcf6e9;
}

.status-closed,
.badge-closed {
    color: #374151;
    background: #e5e7eb;
}

.status-reopened,
.badge-reopened {
    color: #a33a00;
    background: #fff0e6;
}


/* Closed Defect read-only view */
.defect-view-key {
    display: block;
    margin-bottom: 4px;
    color: var(--qt-primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
}

.defect-view-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.defect-view-summary > div {
    padding: 13px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.defect-view-summary span,
.defect-view-summary strong {
    display: block;
}

.defect-view-summary span {
    color: var(--qt-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.defect-view-summary strong {
    margin-top: 4px;
    color: var(--qt-text);
    font-size: 12px;
}

.closed-defect-notice {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid #b8e6d1;
    border-radius: 12px;
    color: #08744e;
    background: #eefaf4;
}

.closed-defect-notice > i {
    font-size: 22px;
}

.closed-defect-notice strong,
.closed-defect-notice span {
    display: block;
}

.closed-defect-notice strong {
    font-size: 12px;
}

.closed-defect-notice span {
    margin-top: 3px;
    font-size: 10px;
}

.defect-view-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--qt-border);
}

.defect-view-section:last-child {
    border-bottom: 0;
}

.defect-view-section h6 {
    margin: 0 0 6px;
    color: var(--qt-text);
    font-size: 12px;
}

.defect-view-section p {
    margin: 0;
    color: var(--qt-muted);
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 720px) {
    .defect-view-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Database Upgrade and Backup Manager */
.database-tools-stack {
    display: grid;
    gap: 20px;
}

.database-tool-card {
    padding: 24px;
}

.database-tool-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 16px;
}

.database-tool-heading h3,
.database-tool-heading p {
    margin: 0;
}

.database-tool-heading h3 {
    color: var(--qt-text);
    font-size: 17px;
}

.database-tool-heading p {
    margin-top: 4px;
    color: var(--qt-muted);
    font-size: 11px;
}

.database-tool-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border-radius: 13px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 19px;
}

.database-tool-icon.backup-icon {
    color: #08744e;
    background: #dcf6e9;
}

.database-backup-details {
    display: grid;
    gap: 9px;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.database-backup-details > div {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--qt-muted);
    font-size: 11px;
}

.database-backup-details i {
    color: #0a8a5c;
}

.database-backup-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px;
    margin-top: 14px;
    border: 1px solid #f1d58b;
    border-radius: 10px;
    color: #795800;
    background: #fff8e5;
    font-size: 9px;
    line-height: 1.5;
}


/* Facebook-style topbar notification popover */
.notification-popover-shell {
    position: relative;
}

.notification-button {
    position: relative;
}

.topbar-notification-count {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid var(--qt-surface);
    border-radius: 999px;
    color: #fff;
    background: #e43d57;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
}

.notification-popover {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 12px);
    right: 0;
    width: min(390px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid var(--qt-border);
    border-radius: 16px;
    background: var(--qt-surface);
    box-shadow: 0 18px 46px rgba(22, 34, 61, .20);
}

.notification-popover[hidden] {
    display: none !important;
}

.notification-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px 13px;
    border-bottom: 1px solid var(--qt-border);
}

.notification-popover-header h3 {
    margin: 0;
    color: var(--qt-text);
    font-size: 18px;
}

.notification-popover-header span {
    display: block;
    margin-top: 3px;
    color: var(--qt-muted);
    font-size: 10px;
}

.notification-mark-all-button {
    padding: 0;
    border: 0;
    color: var(--qt-primary);
    background: transparent;
    font-size: 10px;
    font-weight: 800;
}

.notification-mark-all-button:hover {
    text-decoration: underline;
}

.notification-popover-list {
    max-height: 460px;
    overflow-y: auto;
}

.notification-popover-item {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 8px;
    gap: 11px;
    align-items: start;
    padding: 13px 17px;
    border-bottom: 1px solid var(--qt-border);
    color: inherit;
    text-decoration: none;
    transition: background .16s ease;
}

.notification-popover-item:hover {
    background: var(--qt-surface-soft);
}

.notification-popover-item.is-unread {
    background: #eef4ff;
}

.notification-popover-item.is-unread:hover {
    background: #e7efff;
}

.notification-popover-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 16px;
}

.notification-popover-content {
    min-width: 0;
}

.notification-popover-content strong,
.notification-popover-content span,
.notification-popover-content time {
    display: block;
}

.notification-popover-content strong {
    color: var(--qt-text);
    font-size: 12px;
    line-height: 1.35;
}

.notification-popover-content > span {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    color: var(--qt-muted);
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notification-popover-content time {
    margin-top: 5px;
    color: var(--qt-primary);
    font-size: 9px;
    font-weight: 700;
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    align-self: center;
    border-radius: 50%;
    background: var(--qt-primary);
}

.notification-popover-footer {
    padding: 12px;
    text-align: center;
}

.notification-popover-footer a {
    color: var(--qt-primary);
    font-size: 11px;
    font-weight: 850;
    text-decoration: none;
}

.notification-popover-footer a:hover {
    text-decoration: underline;
}

.notification-popover-empty {
    display: grid;
    justify-items: center;
    padding: 42px 20px;
    text-align: center;
}

.notification-popover-empty > span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 11px;
    border-radius: 50%;
    color: var(--qt-muted);
    background: var(--qt-surface-soft);
    font-size: 20px;
}

.notification-popover-empty strong {
    color: var(--qt-text);
    font-size: 13px;
}

.notification-popover-empty p {
    max-width: 250px;
    margin: 5px 0 0;
    color: var(--qt-muted);
    font-size: 10px;
    line-height: 1.5;
}

@media (max-width: 620px) {
    .notification-popover {
        position: fixed;
        top: 70px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}


/* Current trusted-device state */
.current-device-trusted-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #a9dfc5;
    border-radius: 10px;
    color: #08744e;
    background: #eaf8f1;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

.current-device-label {
    display: inline-flex;
    align-items: center;
    margin-left: 7px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #08744e;
    background: #dcf6e9;
    font-size: 8px;
    font-weight: 850;
    vertical-align: middle;
}


/* Enhanced trusted-device panel */
.trusted-device-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.current-device-trusted-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #a7dfc4;
    border-radius: 10px;
    color: #08744e;
    background: #eaf8f1;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

.trusted-device-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--qt-border);
    border-radius: 13px;
    background: var(--qt-surface-soft);
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.trusted-device-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(22, 34, 61, .08);
}

.trusted-device-item.is-current-device {
    border-color: #a7dfc4;
    background: linear-gradient(
        135deg,
        #f5fcf8,
        #eef9f4
    );
}

.trusted-device-item .device-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 17px;
}

.trusted-device-item.is-current-device .device-icon {
    color: #08744e;
    background: #dcf6e9;
}

.trusted-device-info {
    min-width: 0;
}

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

.trusted-device-name-row strong {
    color: var(--qt-text);
    font-size: 12px;
}

.current-device-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #08744e;
    background: #dcf6e9;
    font-size: 8px;
    font-weight: 850;
}

.trusted-device-info small {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: var(--qt-muted);
    font-size: 9px;
}

.trusted-device-info small span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 640px) {
    .trusted-device-item {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .trusted-device-item > form {
        grid-column: 1 / -1;
    }

    .trusted-device-item > form .btn {
        width: 100%;
    }

    .trusted-device-header-actions {
        justify-content: flex-start;
    }
}


/* Email Authentication option */
.active-auth-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.active-auth-method {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.active-auth-method.is-active {
    border-color: #9fd9bd;
    background: #eef9f4;
}

.active-auth-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 18px;
}

.active-auth-method.is-active .active-auth-icon {
    color: #08744e;
    background: #dcf6e9;
}

.active-auth-method strong,
.active-auth-method small {
    display: block;
}

.active-auth-method strong {
    color: var(--qt-text);
    font-size: 11px;
}

.active-auth-method small {
    margin-top: 4px;
    color: var(--qt-muted);
    font-size: 9px;
    line-height: 1.5;
}

.active-auth-method em {
    padding: 4px 8px;
    border-radius: 999px;
    color: #08744e;
    background: #dcf6e9;
    font-size: 8px;
    font-style: normal;
    font-weight: 850;
}

.authentication-action-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.email-auth-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #a7dfc4;
    border-radius: 10px;
    color: #08744e;
    background: #eaf8f1;
    font-size: 10px;
    font-weight: 850;
}

.email-auth-switch-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px;
    margin-top: 14px;
    border: 1px solid #cad8f6;
    border-radius: 10px;
    color: #496087;
    background: #f4f7ff;
    font-size: 10px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .active-auth-methods {
        grid-template-columns: 1fr;
    }
}


/* Consolidated Security Center */
.security-center-auth-summary {
    display: grid;
    gap: 14px;
}

.authentication-method-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.authentication-method-compact > div {
    display: flex;
    align-items: center;
    gap: 11px;
}

.authentication-method-compact-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 18px;
}

.authentication-method-compact strong,
.authentication-method-compact small {
    display: block;
}

.authentication-method-compact strong {
    color: var(--qt-text);
    font-size: 12px;
}

.authentication-method-compact small {
    margin-top: 4px;
    color: var(--qt-muted);
    font-size: 9px;
}

@media (max-width: 700px) {
    .authentication-method-compact {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Dual MFA method support */
.dual-mfa-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid #cbd8f6;
    border-radius: 10px;
    color: #496087;
    background: #f4f7ff;
    font-size: 10px;
    line-height: 1.5;
}


/* ==========================================================
   QATrack Global Dark Mode + Collapsed Sidebar Final Repair
   ========================================================== */

/* Collapsed sidebar: hide every text-bearing element consistently */
body.sidebar-collapsed .sidebar {
    width: var(--qt-sidebar-collapsed-width) !important;
    padding-left: 10px;
    padding-right: 10px;
    overflow-x: hidden;
}

body.sidebar-collapsed .sidebar .brand-copy,
body.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .sidebar .nav-badge {
    display: none !important;
}

body.sidebar-collapsed .sidebar-brand {
    min-height: 66px;
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .brand-mini {
    flex: 0 0 42px;
}

body.sidebar-collapsed .sidebar-collapse-button {
    position: absolute;
    right: -1px;
    bottom: 0;
}

body.sidebar-collapsed .sidebar-nav {
    width: 100%;
}

body.sidebar-collapsed .sidebar-nav a {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    gap: 0;
    padding: 11px 0 !important;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-nav a:hover {
    transform: none;
}

body.sidebar-collapsed .sidebar-nav a i {
    width: 24px !important;
    min-width: 24px;
    flex: 0 0 24px !important;
    margin: 0 !important;
    text-align: center;
    font-size: 19px;
}

/* Global Bootstrap table variables for dark mode */
body[data-theme="dark"] .table {
    --bs-table-color: var(--qt-text);
    --bs-table-bg: var(--qt-surface);
    --bs-table-border-color: var(--qt-border);
    --bs-table-striped-color: var(--qt-text);
    --bs-table-striped-bg: #182438;
    --bs-table-active-color: var(--qt-text);
    --bs-table-active-bg: #20304a;
    --bs-table-hover-color: var(--qt-text);
    --bs-table-hover-bg: #1d2b43;
    color: var(--qt-text) !important;
    border-color: var(--qt-border) !important;
}

/* All table wrappers and cells */
body[data-theme="dark"] .table-responsive {
    background: var(--qt-surface);
    border-color: var(--qt-border);
}

body[data-theme="dark"] .table > :not(caption) > * > * {
    color: var(--qt-text) !important;
    background-color: transparent !important;
    border-color: var(--qt-border) !important;
    box-shadow: none !important;
}

/* Global table header */
body[data-theme="dark"] .table thead,
body[data-theme="dark"] .table thead tr,
body[data-theme="dark"] .table thead th,
body[data-theme="dark"] .table thead td {
    color: #dbe5f5 !important;
    background: #1b2940 !important;
    border-color: var(--qt-border-strong) !important;
}

/* Global table body */
body[data-theme="dark"] .table tbody tr,
body[data-theme="dark"] table tbody tr {
    color: var(--qt-text) !important;
    background: var(--qt-surface) !important;
}

body[data-theme="dark"] .table tbody tr:nth-child(even),
body[data-theme="dark"] table tbody tr:nth-child(even) {
    background: #182438 !important;
}

body[data-theme="dark"] .table tbody tr:hover,
body[data-theme="dark"] table tbody tr:hover {
    background: #1d2b43 !important;
}

body[data-theme="dark"] .table tbody td,
body[data-theme="dark"] table tbody td {
    color: var(--qt-text) !important;
    background: transparent !important;
    border-color: var(--qt-border) !important;
}

/* Text inside all tables */
body[data-theme="dark"] .table td strong,
body[data-theme="dark"] .table td span:not(.badge):not(.status-chip):not(.role-pill),
body[data-theme="dark"] .table td a:not(.btn),
body[data-theme="dark"] .table td p,
body[data-theme="dark"] .table td div,
body[data-theme="dark"] table td strong,
body[data-theme="dark"] table td p {
    color: inherit;
}

body[data-theme="dark"] .table td small,
body[data-theme="dark"] table td small {
    color: var(--qt-muted) !important;
}

/* Cards and panels containing tables */
body[data-theme="dark"] .panel,
body[data-theme="dark"] .table-card,
body[data-theme="dark"] .data-table-card,
body[data-theme="dark"] .card:has(.table),
body[data-theme="dark"] .panel:has(.table) {
    background: var(--qt-surface) !important;
    border-color: var(--qt-border) !important;
}

/* Pagination and dropdown menus used by table pages */
body[data-theme="dark"] .pagination .page-link {
    color: var(--qt-text);
    background: var(--qt-surface);
    border-color: var(--qt-border);
}

body[data-theme="dark"] .pagination .page-link:hover,
body[data-theme="dark"] .pagination .page-item.active .page-link {
    color: #fff;
    background: var(--qt-primary);
    border-color: var(--qt-primary);
}

body[data-theme="dark"] .dropdown-menu {
    color: var(--qt-text);
    background: var(--qt-surface);
    border-color: var(--qt-border);
}

body[data-theme="dark"] .dropdown-item {
    color: var(--qt-text);
}

body[data-theme="dark"] .dropdown-item:hover,
body[data-theme="dark"] .dropdown-item:focus {
    color: var(--qt-text);
    background: var(--qt-surface-soft);
}

/* Inputs and date controls on all table/filter pages */
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] input[type="date"] {
    color: var(--qt-text) !important;
    background-color: var(--qt-surface-soft) !important;
    border-color: var(--qt-border-strong) !important;
    color-scheme: dark;
}

body[data-theme="dark"] .form-control::placeholder {
    color: #8291a8 !important;
}

body[data-theme="dark"] .form-select option {
    color: var(--qt-text);
    background: var(--qt-surface);
}

/* Preserve readable badges in dark tables */
body[data-theme="dark"] .table .badge,
body[data-theme="dark"] .table .status-chip,
body[data-theme="dark"] .table .role-pill,
body[data-theme="dark"] .table .priority-pill,
body[data-theme="dark"] .table .workflow-pill {
    color: inherit;
}

/* Mobile layout must ignore desktop collapsed width */
@media (max-width: 900px) {
    body.sidebar-collapsed .sidebar {
        width: min(290px, 86vw) !important;
        padding-left: 14px;
        padding-right: 14px;
    }

    body.sidebar-collapsed .sidebar .brand-copy,
    body.sidebar-collapsed .sidebar .nav-text,
    body.sidebar-collapsed .sidebar .nav-label,
    body.sidebar-collapsed .sidebar .nav-badge {
        display: initial !important;
    }

    body.sidebar-collapsed .sidebar .brand-copy {
        display: block !important;
    }

    body.sidebar-collapsed .sidebar .nav-label {
        display: block !important;
    }

    body.sidebar-collapsed .sidebar-nav a {
        justify-content: flex-start;
        gap: 12px;
        padding: 11px 13px !important;
    }
}


/* ==========================================================
   QATrack Global Dark Mode Badge Contrast Repair
   ========================================================== */

/* Generic fallback for all pale badges and pills in dark mode */
body[data-theme="dark"] .badge,
body[data-theme="dark"] .status-chip,
body[data-theme="dark"] .role-pill,
body[data-theme="dark"] .priority-pill,
body[data-theme="dark"] .workflow-pill,
body[data-theme="dark"] .tester-chip,
body[data-theme="dark"] .action-complete-badge,
body[data-theme="dark"] .manager-na-badge,
body[data-theme="dark"] .manager-unassigned-badge,
body[data-theme="dark"] .audit-role-badge,
body[data-theme="dark"] .audit-action-badge {
    text-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
}

/* Default readable badge */
body[data-theme="dark"] .badge:not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-primary),
body[data-theme="dark"] .status-chip,
body[data-theme="dark"] .role-pill {
    color: #e8eef9 !important;
    background-color: #273348 !important;
    border-color: #3d4a61 !important;
}

/* Role badges */
body[data-theme="dark"] .role-admin,
body[data-theme="dark"] .audit-role-badge.role-admin {
    color: #ffd67c !important;
    background: #433516 !important;
    border-color: #66501e !important;
}

body[data-theme="dark"] .role-manager,
body[data-theme="dark"] .role-test-manager,
body[data-theme="dark"] .audit-role-badge.role-manager {
    color: #c7d0ff !important;
    background: #26305c !important;
    border-color: #3b4879 !important;
}

body[data-theme="dark"] .role-qa,
body[data-theme="dark"] .role-qa-tester,
body[data-theme="dark"] .audit-role-badge.role-qa {
    color: #aaf0d0 !important;
    background: #173d31 !important;
    border-color: #2c6653 !important;
}

body[data-theme="dark"] .role-developer,
body[data-theme="dark"] .audit-role-badge.role-developer {
    color: #efc0f4 !important;
    background: #442848 !important;
    border-color: #603965 !important;
}

/* Workflow badges */
body[data-theme="dark"] .workflow-draft,
body[data-theme="dark"] .status-draft {
    color: #c7d1df !important;
    background: #273348 !important;
    border-color: #3d4a61 !important;
}

body[data-theme="dark"] .workflow-for-review,
body[data-theme="dark"] .status-review {
    color: #ffe0a0 !important;
    background: #453516 !important;
    border-color: #6b5420 !important;
}

body[data-theme="dark"] .workflow-revision-required,
body[data-theme="dark"] .status-revision {
    color: #ffb6c1 !important;
    background: #4b222a !important;
    border-color: #71333f !important;
}

body[data-theme="dark"] .workflow-approved,
body[data-theme="dark"] .status-approved {
    color: #b7f0d8 !important;
    background: #173d31 !important;
    border-color: #2c6653 !important;
}

body[data-theme="dark"] .workflow-archived,
body[data-theme="dark"] .status-archived {
    color: #c7d1df !important;
    background: #273348 !important;
    border-color: #3d4a61 !important;
}

/* Defect and lifecycle statuses */
body[data-theme="dark"] .status-new,
body[data-theme="dark"] .status-assigned,
body[data-theme="dark"] .status-in-progress,
body[data-theme="dark"] .status-ready-for-qa-testing,
body[data-theme="dark"] .status-ready {
    color: #c4ceff !important;
    background: #26305c !important;
    border-color: #3b4879 !important;
}

body[data-theme="dark"] .status-passed,
body[data-theme="dark"] .status-closed,
body[data-theme="dark"] .status-completed {
    color: #b7f0d8 !important;
    background: #173d31 !important;
    border-color: #2c6653 !important;
}

body[data-theme="dark"] .status-failed,
body[data-theme="dark"] .status-rejected,
body[data-theme="dark"] .status-blocked {
    color: #ffb6c1 !important;
    background: #4b222a !important;
    border-color: #71333f !important;
}

body[data-theme="dark"] .status-planning,
body[data-theme="dark"] .status-pending,
body[data-theme="dark"] .status-on-hold {
    color: #ffe0a0 !important;
    background: #453516 !important;
    border-color: #6b5420 !important;
}

/* Priority badges */
body[data-theme="dark"] .priority-low {
    color: #b7f0d8 !important;
    background: #173d31 !important;
    border-color: #2c6653 !important;
}

body[data-theme="dark"] .priority-medium {
    color: #ffe0a0 !important;
    background: #453516 !important;
    border-color: #6b5420 !important;
}

body[data-theme="dark"] .priority-high {
    color: #ffc49c !important;
    background: #4a2a18 !important;
    border-color: #714126 !important;
}

body[data-theme="dark"] .priority-critical {
    color: #ffb4c0 !important;
    background: #4a2029 !important;
    border-color: #70303d !important;
}

/* Table text and subtext */
body[data-theme="dark"] table td strong,
body[data-theme="dark"] table td b,
body[data-theme="dark"] table td .fw-bold,
body[data-theme="dark"] table td .fw-semibold {
    color: #f4f7ff !important;
}

body[data-theme="dark"] table td small,
body[data-theme="dark"] table td .text-muted,
body[data-theme="dark"] table td .text-secondary,
body[data-theme="dark"] .workflow-caption,
body[data-theme="dark"] .coverage-stack,
body[data-theme="dark"] .activity-stack,
body[data-theme="dark"] .tester-profile small {
    color: #aebbd0 !important;
}

/* Avatars and identity blocks */
body[data-theme="dark"] .tester-avatar,
body[data-theme="dark"] .manager-avatar,
body[data-theme="dark"] .audit-user-avatar {
    color: #c9d5ff !important;
    background: #22325b !important;
    border: 1px solid #3b4d79 !important;
}

/* Outlined and primary action buttons */
body[data-theme="dark"] .btn-outline-primary {
    color: #9eb3ff !important;
    border-color: #6e88dd !important;
    background: transparent !important;
}

body[data-theme="dark"] .btn-outline-primary:hover,
body[data-theme="dark"] .btn-outline-primary:focus {
    color: #ffffff !important;
    background: #3159cf !important;
    border-color: #3159cf !important;
}

body[data-theme="dark"] .btn-primary,
body[data-theme="dark"] .btn-success,
body[data-theme="dark"] .btn-danger,
body[data-theme="dark"] .btn-warning {
    color: #ffffff !important;
}

/* Bootstrap light badges become dark-safe */
body[data-theme="dark"] .bg-light,
body[data-theme="dark"] .text-bg-light,
body[data-theme="dark"] .badge.bg-light,
body[data-theme="dark"] .badge.text-bg-light {
    color: #e8eef9 !important;
    background-color: #273348 !important;
    border-color: #3d4a61 !important;
}

/* Forms and cards on the shown pages */
body[data-theme="dark"] .card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .project-card,
body[data-theme="dark"] .cycle-card,
body[data-theme="dark"] .plan-card {
    color: var(--qt-text) !important;
    background-color: var(--qt-surface) !important;
    border-color: var(--qt-border) !important;
}


/* ==========================================================
   Security Center Active Authentication Method Dark Fix
   Exact markup:
   .active-auth-method.is-active
   Theme selector:
   body[data-theme="dark"]
   ========================================================== */

body[data-theme="dark"] .active-auth-method {
    color: #e8eef9 !important;
    background: #182438 !important;
    border: 1px solid #33435e !important;
}

body[data-theme="dark"] .active-auth-method > div,
body[data-theme="dark"] .active-auth-method > div strong,
body[data-theme="dark"] .active-auth-method strong {
    color: #f4f7ff !important;
    opacity: 1 !important;
}

body[data-theme="dark"] .active-auth-method > div small,
body[data-theme="dark"] .active-auth-method small {
    color: #aebbd0 !important;
    opacity: 1 !important;
}

body[data-theme="dark"] .active-auth-method .active-auth-icon {
    color: #9eb3ff !important;
    background: #22325b !important;
    border: 1px solid #3b4d79 !important;
}

/* Active authenticator/email method */
body[data-theme="dark"] .active-auth-method.is-active {
    color: #d9f8e9 !important;
    background: #173d31 !important;
    border-color: #2c6653 !important;
}

body[data-theme="dark"] .active-auth-method.is-active > div,
body[data-theme="dark"] .active-auth-method.is-active > div strong,
body[data-theme="dark"] .active-auth-method.is-active strong {
    color: #eafff5 !important;
    opacity: 1 !important;
}

body[data-theme="dark"] .active-auth-method.is-active > div small,
body[data-theme="dark"] .active-auth-method.is-active small {
    color: #b7ddcc !important;
    opacity: 1 !important;
}

body[data-theme="dark"] .active-auth-method.is-active .active-auth-icon {
    color: #74e7b2 !important;
    background: #204d3e !important;
    border-color: #34715c !important;
}

/* Active badge */
body[data-theme="dark"] .active-auth-method em,
body[data-theme="dark"] .active-auth-method.is-active em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 24px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #d9f8e9 !important;
    background: #245c48 !important;
    border: 1px solid #34715c !important;
    font-style: normal;
    font-weight: 800;
    opacity: 1 !important;
}

/* Dual MFA note below method cards */
body[data-theme="dark"] .dual-mfa-note {
    color: #c5d2e8 !important;
    background: #1b2940 !important;
    border-color: #3a4a66 !important;
}

body[data-theme="dark"] .dual-mfa-note i,
body[data-theme="dark"] .dual-mfa-note strong,
body[data-theme="dark"] .dual-mfa-note span {
    color: inherit !important;
}


/* ==========================================================
   Security Center Login Result Badge Dark Mode Fix
   Exact classes: .login-result, .login-success, .login-failed
   ========================================================== */
body[data-theme="dark"] .login-result {
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
    border: 1px solid transparent !important;
    font-weight: 800 !important;
}

body[data-theme="dark"] .login-result.login-success,
body[data-theme="dark"] .login-success {
    color: #b7f0d8 !important;
    background: #173d31 !important;
    border-color: #2c6653 !important;
}

body[data-theme="dark"] .login-result.login-failed,
body[data-theme="dark"] .login-failed {
    color: #ffb6c1 !important;
    background: #4b222a !important;
    border-color: #71333f !important;
}

body[data-theme="dark"] .login-result i,
body[data-theme="dark"] .login-success i,
body[data-theme="dark"] .login-failed i {
    color: inherit !important;
    opacity: 1 !important;
}

/* Light mode remains readable as well */
.login-result.login-success,
.login-success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.login-result.login-failed,
.login-failed {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}


/* ==========================================================
   Defect Details Modal - Comment and Timeline UI Repair
   ========================================================== */

/* Scope the repair to defect detail/view modals */
.defect-details-modal .comment-form,
.defect-view-modal .comment-form,
.defect-modal .comment-form,
[id^="viewDefect"] .comment-form,
[id^="defectDetails"] .comment-form {
    padding: 16px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #f8faff;
}

/* Comment editor */
.defect-details-modal .comment-form textarea,
.defect-view-modal .comment-form textarea,
.defect-modal .comment-form textarea,
[id^="viewDefect"] .comment-form textarea,
[id^="defectDetails"] .comment-form textarea,
.defect-details-modal .comment-textarea,
.defect-view-modal .comment-textarea,
.defect-modal .comment-textarea {
    width: 100%;
    min-height: 96px;
    padding: 13px 15px;
    resize: vertical;
    color: #17233c !important;
    background: #ffffff !important;
    border: 1px solid #ccd7e8 !important;
    border-radius: 12px;
    box-shadow: none !important;
    line-height: 1.55;
}

.defect-details-modal .comment-form textarea::placeholder,
.defect-view-modal .comment-form textarea::placeholder,
.defect-modal .comment-form textarea::placeholder,
[id^="viewDefect"] .comment-form textarea::placeholder,
[id^="defectDetails"] .comment-form textarea::placeholder {
    color: #8795aa !important;
    opacity: 1;
}

.defect-details-modal .comment-form textarea:focus,
.defect-view-modal .comment-form textarea:focus,
.defect-modal .comment-form textarea:focus,
[id^="viewDefect"] .comment-form textarea:focus,
[id^="defectDetails"] .comment-form textarea:focus {
    border-color: #7695ef !important;
    box-shadow: 0 0 0 3px rgba(67, 105, 228, .12) !important;
    outline: none;
}

/* Comment form footer */
.defect-details-modal .comment-form-footer,
.defect-view-modal .comment-form-footer,
.defect-modal .comment-form-footer,
[id^="viewDefect"] .comment-form-footer,
[id^="defectDetails"] .comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.defect-details-modal .comment-visibility-note,
.defect-view-modal .comment-visibility-note,
.defect-modal .comment-visibility-note {
    color: #71809a !important;
}

/* Conversation heading */
.defect-details-modal .conversation-heading,
.defect-view-modal .conversation-heading,
.defect-modal .conversation-heading,
.defect-details-modal .comments-heading,
.defect-view-modal .comments-heading,
.defect-modal .comments-heading,
[id^="viewDefect"] .conversation-heading,
[id^="defectDetails"] .conversation-heading {
    color: #17233c !important;
}

.defect-details-modal .conversation-heading small,
.defect-view-modal .conversation-heading small,
.defect-modal .conversation-heading small,
.defect-details-modal .comments-heading small,
.defect-view-modal .comments-heading small,
.defect-modal .comments-heading small {
    color: #71809a !important;
}

/* Timeline cards */
.defect-details-modal .comment-card,
.defect-view-modal .comment-card,
.defect-modal .comment-card,
.defect-details-modal .timeline-card,
.defect-view-modal .timeline-card,
.defect-modal .timeline-card,
[id^="viewDefect"] .comment-card,
[id^="defectDetails"] .comment-card {
    color: #17233c !important;
    background: #ffffff !important;
    border: 1px solid #dbe4f0 !important;
    border-radius: 13px;
    box-shadow: 0 4px 14px rgba(15, 31, 61, .04);
}

.defect-details-modal .comment-card strong,
.defect-view-modal .comment-card strong,
.defect-modal .comment-card strong,
.defect-details-modal .timeline-card strong,
.defect-view-modal .timeline-card strong,
.defect-modal .timeline-card strong {
    color: #10254a !important;
}

.defect-details-modal .comment-card p,
.defect-view-modal .comment-card p,
.defect-modal .comment-card p,
.defect-details-modal .timeline-card p,
.defect-view-modal .timeline-card p,
.defect-modal .timeline-card p {
    color: #40506b !important;
}

/* Author role and timestamps */
.defect-details-modal .comment-role,
.defect-view-modal .comment-role,
.defect-modal .comment-role,
.defect-details-modal .comment-time,
.defect-view-modal .comment-time,
.defect-modal .comment-time,
.defect-details-modal .timeline-time,
.defect-view-modal .timeline-time,
.defect-modal .timeline-time {
    color: #7b899f !important;
    opacity: 1 !important;
}

/* Avatar strip */
.defect-details-modal .comment-avatar,
.defect-view-modal .comment-avatar,
.defect-modal .comment-avatar,
.defect-details-modal .timeline-avatar,
.defect-view-modal .timeline-avatar,
.defect-modal .timeline-avatar {
    color: #ffffff !important;
    background: linear-gradient(135deg, #5f6df0, #7355e8) !important;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 1px #dbe4f0;
}

.defect-details-modal .comment-timeline-item,
.defect-view-modal .comment-timeline-item,
.defect-modal .comment-timeline-item,
.defect-details-modal .timeline-item,
.defect-view-modal .timeline-item,
.defect-modal .timeline-item {
    border-left-color: #dce4f2 !important;
}

/* QA validation cards */
.defect-details-modal .qa-validation-card,
.defect-view-modal .qa-validation-card,
.defect-modal .qa-validation-card,
[id^="viewDefect"] .qa-validation-card,
[id^="defectDetails"] .qa-validation-card {
    color: #17362b !important;
    background: #f1faf6 !important;
    border-color: #c9e7d8 !important;
}

.defect-details-modal .qa-validation-card small,
.defect-view-modal .qa-validation-card small,
.defect-modal .qa-validation-card small {
    color: #5e786d !important;
}

/* ===========================
   Dark Mode
   =========================== */

body[data-theme="dark"] .defect-details-modal .comment-form,
body[data-theme="dark"] .defect-view-modal .comment-form,
body[data-theme="dark"] .defect-modal .comment-form,
body[data-theme="dark"] [id^="viewDefect"] .comment-form,
body[data-theme="dark"] [id^="defectDetails"] .comment-form {
    background: #172238 !important;
    border-color: #34445e !important;
}

body[data-theme="dark"] .defect-details-modal .comment-form textarea,
body[data-theme="dark"] .defect-view-modal .comment-form textarea,
body[data-theme="dark"] .defect-modal .comment-form textarea,
body[data-theme="dark"] [id^="viewDefect"] .comment-form textarea,
body[data-theme="dark"] [id^="defectDetails"] .comment-form textarea,
body[data-theme="dark"] .defect-details-modal .comment-textarea,
body[data-theme="dark"] .defect-view-modal .comment-textarea,
body[data-theme="dark"] .defect-modal .comment-textarea {
    color: #edf3ff !important;
    background: #111c30 !important;
    border-color: #425373 !important;
}

body[data-theme="dark"] .defect-details-modal .comment-form textarea::placeholder,
body[data-theme="dark"] .defect-view-modal .comment-form textarea::placeholder,
body[data-theme="dark"] .defect-modal .comment-form textarea::placeholder,
body[data-theme="dark"] [id^="viewDefect"] .comment-form textarea::placeholder,
body[data-theme="dark"] [id^="defectDetails"] .comment-form textarea::placeholder {
    color: #91a1ba !important;
}

body[data-theme="dark"] .defect-details-modal .conversation-heading,
body[data-theme="dark"] .defect-view-modal .conversation-heading,
body[data-theme="dark"] .defect-modal .conversation-heading,
body[data-theme="dark"] .defect-details-modal .comments-heading,
body[data-theme="dark"] .defect-view-modal .comments-heading,
body[data-theme="dark"] .defect-modal .comments-heading {
    color: #edf3ff !important;
}

body[data-theme="dark"] .defect-details-modal .conversation-heading small,
body[data-theme="dark"] .defect-view-modal .conversation-heading small,
body[data-theme="dark"] .defect-modal .conversation-heading small,
body[data-theme="dark"] .defect-details-modal .comments-heading small,
body[data-theme="dark"] .defect-view-modal .comments-heading small,
body[data-theme="dark"] .defect-modal .comments-heading small,
body[data-theme="dark"] .defect-details-modal .comment-role,
body[data-theme="dark"] .defect-view-modal .comment-role,
body[data-theme="dark"] .defect-modal .comment-role,
body[data-theme="dark"] .defect-details-modal .comment-time,
body[data-theme="dark"] .defect-view-modal .comment-time,
body[data-theme="dark"] .defect-modal .comment-time,
body[data-theme="dark"] .defect-details-modal .timeline-time,
body[data-theme="dark"] .defect-view-modal .timeline-time,
body[data-theme="dark"] .defect-modal .timeline-time {
    color: #a6b5cc !important;
}

body[data-theme="dark"] .defect-details-modal .comment-card,
body[data-theme="dark"] .defect-view-modal .comment-card,
body[data-theme="dark"] .defect-modal .comment-card,
body[data-theme="dark"] .defect-details-modal .timeline-card,
body[data-theme="dark"] .defect-view-modal .timeline-card,
body[data-theme="dark"] .defect-modal .timeline-card,
body[data-theme="dark"] [id^="viewDefect"] .comment-card,
body[data-theme="dark"] [id^="defectDetails"] .comment-card {
    color: #e8eef9 !important;
    background: #182438 !important;
    border-color: #34445e !important;
    box-shadow: none;
}

body[data-theme="dark"] .defect-details-modal .comment-card strong,
body[data-theme="dark"] .defect-view-modal .comment-card strong,
body[data-theme="dark"] .defect-modal .comment-card strong,
body[data-theme="dark"] .defect-details-modal .timeline-card strong,
body[data-theme="dark"] .defect-view-modal .timeline-card strong,
body[data-theme="dark"] .defect-modal .timeline-card strong {
    color: #f4f7ff !important;
}

body[data-theme="dark"] .defect-details-modal .comment-card p,
body[data-theme="dark"] .defect-view-modal .comment-card p,
body[data-theme="dark"] .defect-modal .comment-card p,
body[data-theme="dark"] .defect-details-modal .timeline-card p,
body[data-theme="dark"] .defect-view-modal .timeline-card p,
body[data-theme="dark"] .defect-modal .timeline-card p {
    color: #c5d2e8 !important;
}

body[data-theme="dark"] .defect-details-modal .comment-avatar,
body[data-theme="dark"] .defect-view-modal .comment-avatar,
body[data-theme="dark"] .defect-modal .comment-avatar,
body[data-theme="dark"] .defect-details-modal .timeline-avatar,
body[data-theme="dark"] .defect-view-modal .timeline-avatar,
body[data-theme="dark"] .defect-modal .timeline-avatar {
    border-color: #182438;
    box-shadow: 0 0 0 1px #425373;
}

body[data-theme="dark"] .defect-details-modal .comment-timeline-item,
body[data-theme="dark"] .defect-view-modal .comment-timeline-item,
body[data-theme="dark"] .defect-modal .comment-timeline-item,
body[data-theme="dark"] .defect-details-modal .timeline-item,
body[data-theme="dark"] .defect-view-modal .timeline-item,
body[data-theme="dark"] .defect-modal .timeline-item {
    border-left-color: #3a4a66 !important;
}

body[data-theme="dark"] .defect-details-modal .qa-validation-card,
body[data-theme="dark"] .defect-view-modal .qa-validation-card,
body[data-theme="dark"] .defect-modal .qa-validation-card,
body[data-theme="dark"] [id^="viewDefect"] .qa-validation-card,
body[data-theme="dark"] [id^="defectDetails"] .qa-validation-card {
    color: #d9f8e9 !important;
    background: #173d31 !important;
    border-color: #2c6653 !important;
}

body[data-theme="dark"] .defect-details-modal .qa-validation-card small,
body[data-theme="dark"] .defect-view-modal .qa-validation-card small,
body[data-theme="dark"] .defect-modal .qa-validation-card small {
    color: #acd6c2 !important;
}


/* ==========================================================
   QATrack Final Result Counter Component
   ========================================================== */

.result-count {
    display: inline-flex !important;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 4px !important;
    row-gap: 3px !important;
    width: auto;
    margin-top: 14px;
    padding: 7px 11px !important;
    border: 1px solid transparent;
    border-radius: 9px !important;
    color: var(--qt-muted) !important;
    background: var(--qt-surface-soft) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.25;
    white-space: nowrap;
}

.result-count > span,
.result-count > strong {
    display: inline-block;
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit;
}

.result-count > strong {
    color: var(--qt-text) !important;
    font-weight: 800 !important;
}

body[data-theme="dark"] .result-count {
    color: #aebbd0 !important;
    background: #1b2940 !important;
    border-color: #33435e !important;
}

body[data-theme="dark"] .result-count > strong {
    color: #f4f7ff !important;
}


/* ==========================================================
   QATrack Fresh Widget-Only Support Chat
   ========================================================== */

.support-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1080;
    font-family: inherit;
}

.support-widget-launcher {
    position: relative;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #416be9, #6651df);
    box-shadow: 0 12px 30px rgba(54, 75, 190, .34);
    font-size: 23px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.support-widget-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(54, 75, 190, .4);
}

.support-widget-launcher > span {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #ef405b;
    font-size: 9px;
    font-weight: 800;
}

.support-widget-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(400px, calc(100vw - 30px));
    height: min(620px, calc(100vh - 110px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--qt-border);
    border-radius: 22px;
    background: var(--qt-surface);
    box-shadow: 0 24px 60px rgba(17, 31, 69, .28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.support-widget.open .support-widget-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.support-widget.is-admin .support-widget-panel {
    width: min(470px, calc(100vw - 30px));
}

.support-widget-header {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    padding: 13px 14px;
    color: #fff;
    background: linear-gradient(135deg, #416be9, #6651df);
}

.support-widget-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.support-widget-brand-icon {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.17);
    font-size: 18px;
}

.support-widget-brand-icon b {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid #5d57e1;
    border-radius: 50%;
    background: #36d47d;
}

.support-widget-heading > div {
    min-width: 0;
}

.support-widget-heading strong,
.support-widget-heading small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-widget-heading strong {
    font-size: 14px;
}

.support-widget-heading small {
    margin-top: 2px;
    color: rgba(255,255,255,.82);
    font-size: 9px;
}

.support-widget-header-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.support-widget-header-actions button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: transparent;
}

.support-widget-header-actions button:hover {
    background: rgba(255,255,255,.16);
}

.support-widget-search {
    position: relative;
    flex: 0 0 auto;
    padding: 9px 12px;
    border-bottom: 1px solid var(--qt-border);
}

.support-widget-search i {
    position: absolute;
    top: 50%;
    left: 24px;
    color: var(--qt-muted);
    transform: translateY(-50%);
}

.support-widget-search input {
    width: 100%;
    height: 38px;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--qt-border);
    border-radius: 20px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
    outline: none;
    font-size: 10px;
}

.support-widget-thread-header {
    position: relative;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-bottom: 1px solid var(--qt-border);
}

#supportWidgetConversationButton {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 0;
    border: 0;
    text-align: left;
    background: transparent;
}

#supportWidgetConversationButton > span {
    min-width: 0;
    flex: 1;
}

#supportWidgetConversationButton strong,
#supportWidgetConversationButton small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#supportWidgetConversationButton strong {
    color: var(--qt-text);
    font-size: 11px;
}

#supportWidgetConversationButton small {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 8px;
}

#supportWidgetConversationButton > i {
    color: var(--qt-muted);
}

#supportWidgetStatus {
    max-width: 90px;
    height: 31px;
    padding: 4px 22px 4px 8px;
    border: 1px solid var(--qt-border);
    border-radius: 9px;
    color: var(--qt-text);
    background-color: var(--qt-surface-soft);
    font-size: 8px;
    font-weight: 700;
}

.support-widget-conversation-menu {
    position: absolute;
    top: calc(100% - 3px);
    right: 10px;
    left: 10px;
    z-index: 5;
    max-height: 300px;
    padding: 7px;
    overflow-y: auto;
    border: 1px solid var(--qt-border);
    border-radius: 14px;
    background: var(--qt-surface);
    box-shadow: 0 18px 40px rgba(18,31,62,.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: .16s ease;
}

.support-widget-conversation-menu.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.support-widget-conversation-menu button {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 0;
    border-radius: 10px;
    text-align: left;
    background: transparent;
}

.support-widget-conversation-menu button:hover,
.support-widget-conversation-menu button.active {
    background: var(--qt-primary-soft);
}

.support-widget-menu-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #536fec, #7354e4);
    font-size: 10px;
    font-weight: 800;
}

.support-widget-menu-copy {
    min-width: 0;
    flex: 1;
}

.support-widget-menu-copy strong,
.support-widget-menu-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-widget-menu-copy strong {
    color: var(--qt-text);
    font-size: 10px;
}

.support-widget-menu-copy small {
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 8px;
}

.support-widget-conversation-menu b {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: #ef405b;
    font-size: 8px;
}

.support-widget-conversation-menu time {
    color: var(--qt-muted);
    font-size: 8px;
}

.support-widget-menu-empty {
    padding: 15px;
    color: var(--qt-muted);
    text-align: center;
    font-size: 10px;
}

.support-widget-messages {
    min-height: 0;
    flex: 1 1 auto;
    padding: 14px 12px 10px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top right, rgba(82,95,232,.07), transparent 36%),
        var(--qt-surface-soft);
}

.support-widget-empty {
    min-height: 230px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--qt-muted);
    text-align: center;
}

.support-widget-empty > span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    font-size: 22px;
}

.support-widget-empty strong {
    color: var(--qt-text);
    font-size: 13px;
}

.support-widget-empty p {
    max-width: 240px;
    margin: 0;
    font-size: 9px;
    line-height: 1.55;
}

.support-widget-date {
    display: flex;
    justify-content: center;
    margin: 9px 0;
}

.support-widget-date span {
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--qt-muted);
    background: var(--qt-surface);
    font-size: 8px;
    font-weight: 700;
}

.support-widget-message {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    margin: 6px 0;
}

.support-widget-message.mine {
    justify-content: flex-end;
}

.support-widget-message-avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #536fec, #7354e4);
    font-size: 9px;
    font-weight: 800;
}

.support-widget-bubble-wrap {
    max-width: 80%;
}

.support-widget-message.mine .support-widget-bubble-wrap {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
}

.support-widget-sender {
    display: block;
    margin: 0 0 3px 8px;
    color: var(--qt-muted);
    font-size: 8px;
    font-weight: 700;
}

.support-widget-bubble {
    display: inline-block;
    max-width: 100%;
    padding: 9px 11px;
    border-radius: 16px 16px 16px 5px;
    color: var(--qt-text);
    background: var(--qt-surface);
    box-shadow: 0 2px 8px rgba(18,31,62,.07);
    overflow-wrap: anywhere;
}

.support-widget-message.mine .support-widget-bubble {
    color: #fff;
    background: linear-gradient(135deg, #416be9, #6252df);
    border-radius: 16px 16px 5px 16px;
}

.support-widget-bubble p {
    margin: 0;
    color: inherit !important;
    font-size: 10px;
    line-height: 1.5;
}

.support-widget-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin: 3px 6px 0;
    color: var(--qt-muted);
    font-size: 7px;
}

.support-widget-meta i {
    color: var(--qt-primary);
    font-size: 10px;
}

.support-widget-file {
    min-width: 185px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
    padding: 8px;
    border-radius: 10px;
    color: inherit !important;
    background: rgba(255,255,255,.16);
    text-decoration: none;
}

.support-widget-message.theirs .support-widget-file {
    background: var(--qt-surface-soft);
}

.support-widget-file > span {
    min-width: 0;
}

.support-widget-file strong,
.support-widget-file small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-widget-file strong {
    font-size: 9px;
}

.support-widget-file small {
    margin-top: 2px;
    opacity: .72;
    font-size: 7px;
}

.support-widget-new-subject {
    flex: 0 0 auto;
    padding: 9px 12px 0;
}

.support-widget-new-subject label {
    display: block;
    margin-bottom: 4px;
    color: var(--qt-text);
    font-size: 9px;
    font-weight: 800;
}

.support-widget-new-subject input {
    width: 100%;
    height: 37px;
    padding: 8px 10px;
    border: 1px solid var(--qt-border);
    border-radius: 10px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
    outline: none;
    font-size: 10px;
}

.support-widget-composer {
    display: flex !important;
    align-items: flex-end;
    gap: 7px !important;
    flex: 0 0 auto;
    padding: 10px 12px 11px !important;
    border-top: 1px solid var(--qt-border);
    background: var(--qt-surface);
}

.support-widget-attach,
.support-widget-send {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    border: 0;
    border-radius: 50%;
}

.support-widget-attach {
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    cursor: pointer;
}

.support-widget-input {
    position: relative;
    min-width: 0;
    flex: 1;
}

.support-widget-input textarea {
    width: 100%;
    min-height: 38px;
    max-height: 110px;
    display: block;
    padding: 10px 12px;
    resize: none;
    border: 1px solid var(--qt-border);
    border-radius: 19px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
    outline: none;
    font-size: 10px;
    line-height: 1.4;
}

.support-widget-input textarea:focus {
    border-color: rgba(65,107,233,.55);
    box-shadow: 0 0 0 3px rgba(65,107,233,.1);
}

.support-widget-input > span {
    position: absolute;
    right: 7px;
    bottom: -7px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #fff;
    background: var(--qt-primary);
    font-size: 7px;
    font-weight: 800;
}

.support-widget-send {
    color: #fff;
    background: linear-gradient(135deg, #416be9, #6252df);
    box-shadow: 0 5px 13px rgba(65,107,233,.26);
}

.support-widget-send:disabled {
    opacity: .55;
}

.support-widget-feedback {
    position: absolute;
    right: 15px;
    bottom: 58px;
    z-index: 4;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    font-size: 8px;
}

.support-widget-feedback.success,
.support-widget-feedback.error {
    padding: 5px 9px;
    color: #fff;
    box-shadow: 0 6px 18px rgba(18,31,62,.16);
}

.support-widget-feedback.success {
    background: #14875e;
}

.support-widget-feedback.error {
    background: #c83f55;
}

body[data-theme="dark"] .support-widget-panel,
body[data-theme="dark"] .support-widget-conversation-menu,
body[data-theme="dark"] .support-widget-date span {
    background: #182438;
}

body[data-theme="dark"] .support-widget-messages {
    background:
        radial-gradient(circle at top right, rgba(96,83,225,.1), transparent 38%),
        #111c30;
}

body[data-theme="dark"] .support-widget-bubble {
    background: #1c2940;
    box-shadow: none;
}

body[data-theme="dark"] .support-widget-message.mine .support-widget-bubble {
    background: linear-gradient(135deg, #3159cf, #5a47c9);
}

body[data-theme="dark"] .support-widget-search input,
body[data-theme="dark"] #supportWidgetStatus,
body[data-theme="dark"] .support-widget-new-subject input,
body[data-theme="dark"] .support-widget-input textarea {
    color: #e8eef9;
    background: #111c30;
    border-color: #425373;
}

@media (max-width: 560px) {
    .support-widget {
        right: 12px;
        bottom: 14px;
    }

    .support-widget-panel,
    .support-widget.is-admin .support-widget-panel {
        right: 0;
        bottom: 70px;
        width: calc(100vw - 24px);
        height: min(640px, calc(100vh - 92px));
    }

    .support-widget-bubble-wrap {
        max-width: 85%;
    }
}


/* ==========================================================
   QATrack Support Inbox and Ticket Management
   ========================================================== */

.support-widget-header-actions a {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff !important;
    text-decoration: none;
}

.support-widget-header-actions a:hover {
    background: rgba(255,255,255,.16);
}

.support-inbox-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.support-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 13px 15px;
    border: 1px solid var(--qt-border);
    border-radius: 14px;
    color: var(--qt-text);
    background: var(--qt-surface);
    box-shadow: var(--qt-shadow-sm);
}

.support-summary-card span {
    color: var(--qt-muted);
    font-size: 12px;
    font-weight: 700;
}

.support-summary-card strong {
    font-size: 22px;
}

.support-summary-card.active {
    border-color: var(--qt-primary);
    box-shadow: 0 0 0 3px var(--qt-primary-soft);
}

.support-inbox-workspace {
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 18px;
}

.support-ticket-list-panel,
.support-ticket-thread {
    min-height: 650px;
    overflow: hidden;
}

.support-ticket-list-toolbar {
    display: flex;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--qt-border);
}

.support-ticket-search {
    position: relative;
    min-width: 0;
    flex: 1;
}

.support-ticket-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--qt-muted);
    transform: translateY(-50%);
}

.support-ticket-search input {
    width: 100%;
    height: 40px;
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--qt-border);
    border-radius: 10px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
}

.support-ticket-list {
    max-height: 540px;
    overflow-y: auto;
}

.support-ticket-list-item {
    width: 100%;
    display: block;
    padding: 14px 2px;
    border: 0;
    border-bottom: 1px solid var(--qt-border);
    text-align: left;
    background: transparent;
}

.support-ticket-list-item:hover,
.support-ticket-list-item.active {
    background: var(--qt-primary-soft);
}

.support-ticket-list-top,
.support-ticket-list-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.support-ticket-list-top > strong {
    color: var(--qt-primary);
    font-size: 11px;
}

.support-ticket-list-status,
.support-ticket-status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
}

.status-open {
    color: #176346;
    background: #dff8ec;
}

.status-pending {
    color: #7c5610;
    background: #fff1c8;
}

.status-resolved {
    color: #2457a6;
    background: #e4edff;
}

.status-closed,
.status-terminated {
    color: #75343d;
    background: #fde5e9;
}

.support-ticket-list-item h4 {
    margin: 7px 0 4px;
    color: var(--qt-text);
    font-size: 13px;
}

.support-ticket-list-item p {
    margin: 0 0 7px;
    color: var(--qt-muted);
    font-size: 10px;
}

.support-ticket-list-bottom span {
    min-width: 0;
    overflow: hidden;
    color: var(--qt-muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-ticket-list-bottom b {
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: #ef405b;
    font-size: 9px;
}

.support-ticket-list-bottom time {
    color: var(--qt-muted);
    font-size: 8px;
}

.support-ticket-list-empty,
.support-ticket-empty {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    color: var(--qt-muted);
    text-align: center;
}

.support-ticket-list-empty i,
.support-ticket-empty > span {
    font-size: 28px;
}

.support-ticket-empty > span {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
}

.support-ticket-empty h3,
.support-ticket-list-empty strong {
    color: var(--qt-text);
}

.support-inbox-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 13px;
}

.support-inbox-pagination button {
    padding: 7px 10px;
    border: 1px solid var(--qt-border);
    border-radius: 8px;
    color: var(--qt-text);
    background: var(--qt-surface);
}

.support-inbox-pagination button:disabled {
    opacity: .45;
}

.support-ticket-active {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.support-ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--qt-border);
}

.support-ticket-number {
    color: var(--qt-primary);
    font-size: 11px;
    font-weight: 850;
}

.support-ticket-header h2 {
    margin: 4px 0;
    font-size: 18px;
}

.support-ticket-header p {
    margin: 0;
    color: var(--qt-muted);
    font-size: 10px;
}

.support-ticket-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-ticket-header-actions .form-select {
    width: 115px;
}

.support-ticket-termination {
    display: flex;
    gap: 10px;
    margin-top: 13px;
    padding: 12px;
    border: 1px solid #efb9c1;
    border-radius: 12px;
    color: #75343d;
    background: #fff1f3;
}

.support-ticket-termination p {
    margin: 3px 0 0;
    font-size: 10px;
}

.support-ticket-messages {
    min-height: 0;
    flex: 1;
    padding: 18px 6px;
    overflow-y: auto;
}

.support-ticket-message {
    display: flex;
    margin: 8px 0;
}

.support-ticket-message.mine {
    justify-content: flex-end;
}

.support-ticket-message-copy {
    max-width: 76%;
}

.support-ticket-message.mine .support-ticket-message-copy {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
}

.support-ticket-message-copy > small {
    display: block;
    margin: 0 0 4px 7px;
    color: var(--qt-muted);
    font-size: 9px;
}

.support-ticket-message-bubble {
    padding: 10px 12px;
    border-radius: 16px 16px 16px 5px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
}

.support-ticket-message.mine .support-ticket-message-bubble {
    color: #fff;
    background: linear-gradient(135deg, #416be9, #6252df);
    border-radius: 16px 16px 5px 16px;
}

.support-ticket-message-bubble p {
    margin: 0;
    color: inherit !important;
    font-size: 11px;
    line-height: 1.5;
}

.support-ticket-message-meta {
    display: flex;
    gap: 5px;
    margin: 4px 6px 0;
    color: var(--qt-muted);
    font-size: 8px;
}

.support-ticket-system-message {
    display: flex;
    gap: 10px;
    margin: 12px auto;
    padding: 12px;
    border: 1px dashed var(--qt-border);
    border-radius: 12px;
    color: var(--qt-muted);
    background: var(--qt-surface-soft);
}

.support-ticket-system-message strong {
    color: var(--qt-text);
}

.support-ticket-system-message p {
    margin: 4px 0;
    font-size: 10px;
}

.support-ticket-system-message time {
    font-size: 8px;
}

.support-ticket-file {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
    border-radius: 9px;
    color: inherit !important;
    background: rgba(255,255,255,.15);
    text-decoration: none;
}

.support-ticket-file strong,
.support-ticket-file small {
    display: block;
}

.support-ticket-composer {
    padding-top: 12px;
    border-top: 1px solid var(--qt-border);
}

.support-ticket-new-subject {
    margin-bottom: 10px;
}

.support-ticket-new-subject label {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 800;
}

.support-ticket-new-subject input {
    width: 100%;
    height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--qt-border);
    border-radius: 10px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
}

.support-ticket-compose-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.support-ticket-attach {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    border-radius: 50%;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
    cursor: pointer;
}

.support-ticket-compose-row textarea {
    min-height: 44px;
    max-height: 120px;
    flex: 1;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    color: var(--qt-text);
    background: var(--qt-surface-soft);
}

.support-ticket-file-summary {
    display: block;
    margin-top: 5px;
    color: var(--qt-muted);
}

.support-ticket-empty-message {
    min-height: 280px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: var(--qt-muted);
    text-align: center;
}

body[data-theme="dark"] .status-open {
    color: #b7f0d8;
    background: #173d31;
}

body[data-theme="dark"] .status-pending {
    color: #ffe0a0;
    background: #453516;
}

body[data-theme="dark"] .status-resolved {
    color: #c4ceff;
    background: #26305c;
}

body[data-theme="dark"] .status-closed,
body[data-theme="dark"] .status-terminated {
    color: #ffb6c1;
    background: #4b222a;
}

body[data-theme="dark"] .support-ticket-termination {
    color: #ffb6c1;
    background: #4b222a;
    border-color: #71333f;
}

@media (max-width: 1000px) {
    .support-inbox-summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .support-inbox-workspace {
        grid-template-columns: 1fr;
    }

    .support-ticket-list-panel,
    .support-ticket-thread {
        min-height: 520px;
    }
}

@media (max-width: 600px) {
    .support-inbox-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .support-ticket-header {
        flex-direction: column;
    }

    .support-ticket-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .support-ticket-message-copy {
        max-width: 88%;
    }
}


/* ==========================================================
   Closed / Terminated Support Ticket Read-Only State
   ========================================================== */

.support-ticket-composer.is-read-only {
    display: none !important;
}

.support-ticket-termination-copy {
    min-width: 0;
    flex: 1;
}

.support-composer-locked {
    opacity: .58;
    pointer-events: none;
}

.support-ticket-attach.is-disabled,
.support-widget-attach.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

.support-widget-composer.is-read-only {
    opacity: .62;
    pointer-events: none;
}

.support-widget-composer.is-read-only textarea {
    cursor: not-allowed;
}

body[data-theme="dark"] .support-ticket-termination {
    color: #ffc0ca;
    background: #4b222a;
    border-color: #763744;
}


/* ==========================================================
   Support Widget Send Button Layout Fix
   ========================================================== */

.support-widget-composer {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: end;
    column-gap: 7px !important;
    width: 100%;
    box-sizing: border-box;
}

.support-widget-input {
    width: 100%;
    min-width: 0;
}

.support-widget-input textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.support-widget-send {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    line-height: 1;
    flex: 0 0 36px !important;
}

.support-widget-send > i,
.support-widget-send .spinner-border {
    font-size: 14px;
}

.support-widget-send.is-loading,
.support-widget-send[disabled] {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    pointer-events: none;
}

@media (max-width: 560px) {
    .support-widget-composer {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        padding-right: 10px !important;
        padding-left: 10px !important;
    }
}


/* ==========================================================
   Trusted Devices Current Device Dark Mode Readability Fix
   ========================================================== */

.trusted-device-item.is-current-device {
    background: linear-gradient(
        135deg,
        #f5fcf8,
        #eef9f4
    ) !important;
    border-color: #a7dfc4 !important;
}

.trusted-device-item.is-current-device .trusted-device-title,
.trusted-device-item.is-current-device .trusted-device-name-row strong {
    color: #153a2d !important;
}

.trusted-device-item.is-current-device .trusted-device-info small,
.trusted-device-item.is-current-device .trusted-device-info small span {
    color: #557468 !important;
}

.trusted-device-item.is-current-device .device-icon {
    color: #08744e !important;
    background: #dcf6e9 !important;
}

.trusted-device-item.is-current-device .current-device-label {
    color: #08744e !important;
    background: #dcf6e9 !important;
    border: 1px solid #a7dfc4;
}

.trusted-device-item.is-current-device .btn-outline-danger {
    color: #cf3f4f !important;
    border-color: #e58d99 !important;
    background: transparent !important;
}

/* Dark mode must keep the highlighted current-device card readable. */
body[data-theme="dark"] .trusted-device-item.is-current-device {
    background: linear-gradient(
        135deg,
        #f5fcf8,
        #eef9f4
    ) !important;
    border-color: #a7dfc4 !important;
}

body[data-theme="dark"] .trusted-device-item.is-current-device
.trusted-device-title,
body[data-theme="dark"] .trusted-device-item.is-current-device
.trusted-device-name-row strong {
    color: #153a2d !important;
}

body[data-theme="dark"] .trusted-device-item.is-current-device
.trusted-device-info small,
body[data-theme="dark"] .trusted-device-item.is-current-device
.trusted-device-info small span {
    color: #557468 !important;
}

body[data-theme="dark"] .trusted-device-item.is-current-device
.device-icon {
    color: #08744e !important;
    background: #dcf6e9 !important;
}

body[data-theme="dark"] .trusted-device-item.is-current-device
.current-device-label {
    color: #08744e !important;
    background: #dcf6e9 !important;
    border-color: #a7dfc4 !important;
}

body[data-theme="dark"] .trusted-device-item.is-current-device
.btn-outline-danger {
    color: #cf3f4f !important;
    border-color: #e58d99 !important;
    background: transparent !important;
}

body[data-theme="dark"] .current-device-trusted-badge {
    color: #08744e !important;
    background: #eaf8f1 !important;
    border-color: #a7dfc4 !important;
}


/* ==========================================================
   QATrack Global Responsive Layout Enhancement
   ========================================================== */

/* Prevent common horizontal overflow sources. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.main-area,
.content-area,
.panel,
.modal-content,
.table-responsive {
    min-width: 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
    margin-bottom: 0;
}

.table th,
.table td {
    vertical-align: middle;
}

.page-heading > div,
.panel-title > div,
.trusted-device-info,
.support-ticket-header > div {
    min-width: 0;
}

.page-heading h1,
.panel-title h3,
.project-card h3,
.modal-title {
    overflow-wrap: anywhere;
}

.filter-grid,
.form-grid,
.security-overview-grid,
.metrics-grid,
.metric-grid {
    min-width: 0;
}

/* Large tablet / smaller laptop */
@media (max-width: 1100px) {
    .content-area {
        padding: 22px;
    }

    .page-heading {
        gap: 16px;
    }

    .panel {
        padding: 18px;
    }

    .security-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .filter-search,
    .filter-actions {
        grid-column: 1 / -1;
    }

    .modal-xl {
        --bs-modal-width: calc(100vw - 48px);
    }
}

/* Tablet and mobile navigation */
@media (max-width: 899px) {
    .sidebar {
        width: min(290px, 86vw);
        transform: translateX(-105%);
        transition: transform .24s ease;
        box-shadow: 12px 0 32px rgba(15, 23, 42, .18);
    }

    .sidebar.open,
    .sidebar.is-open,
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-area {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .menu-button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .topbar {
        min-height: 64px;
        height: auto;
        padding: 10px 18px;
        gap: 12px;
    }

    .content-area {
        padding: 18px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .page-heading > button,
    .page-heading > a,
    .page-heading > .btn,
    .page-heading > form,
    .page-heading .page-actions {
        max-width: 100%;
    }

    .panel-title {
        align-items: flex-start;
        gap: 12px;
        flex-wrap: wrap;
    }

    .security-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .row > [class*="col-"] {
        min-width: 0;
    }

    .modal-dialog {
        margin: 14px auto;
        width: calc(100% - 28px);
        max-width: calc(100% - 28px);
    }

    .modal-lg,
    .modal-xl {
        --bs-modal-width: calc(100vw - 28px);
    }

    .modal-body {
        overflow-x: hidden;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    .filter-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-actions .btn {
        flex: 1 1 150px;
    }

    .result-count {
        flex-wrap: wrap;
    }

    .trusted-device-header-actions,
    .authentication-action-row,
    .support-ticket-header-actions {
        flex-wrap: wrap;
    }

    .trusted-device-item {
        align-items: flex-start;
    }

    .support-widget-panel {
        max-width: calc(100vw - 24px) !important;
    }
}

/* Phones */
@media (max-width: 640px) {
    .topbar {
        padding: 8px 12px;
    }

    .content-area {
        padding: 12px;
    }

    .page-heading {
        margin-bottom: 16px;
    }

    .page-heading h1 {
        font-size: 22px;
        line-height: 1.2;
    }

    .page-heading p {
        font-size: 13px;
    }

    .panel {
        padding: 14px;
        border-radius: 13px;
    }

    .panel-title {
        margin-bottom: 14px;
    }

    .panel-title h3,
    .panel h3 {
        font-size: 16px;
    }

    .security-overview-grid,
    .filter-grid,
    .ai-generator-options,
    .support-inbox-summary {
        grid-template-columns: 1fr !important;
    }

    .security-overview-card,
    .metric-card {
        min-width: 0;
    }

    .filter-search,
    .filter-actions {
        grid-column: auto;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn,
    .filter-actions > a {
        width: 100%;
        flex: 1 1 100%;
    }

    .form-control,
    .form-select,
    .btn {
        min-height: 40px;
    }

    .btn-sm {
        min-height: 34px;
    }

    .table {
        font-size: 12px;
        white-space: nowrap;
    }

    .table th,
    .table td {
        padding: 9px 10px;
    }

    .table td small,
    .table th small {
        white-space: normal;
    }

    .table .btn {
        white-space: nowrap;
    }

    .modal-dialog {
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        margin: 8px auto;
    }

    .modal-content {
        max-height: calc(100dvh - 16px);
        border-radius: 14px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .modal-footer {
        gap: 8px;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1 1 140px;
    }

    .testcase-detail-summary {
        grid-template-columns: 1fr !important;
    }

    .trusted-device-item {
        display: grid !important;
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
    }

    .trusted-device-item > form {
        grid-column: 1 / -1;
        width: 100%;
    }

    .trusted-device-item > form .btn {
        width: 100%;
    }

    .trusted-device-name-row {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 7px;
    }

    .trusted-device-header-actions {
        width: 100%;
    }

    .trusted-device-header-actions form,
    .trusted-device-header-actions .btn,
    .current-device-trusted-badge {
        width: 100%;
    }

    .current-device-trusted-badge {
        justify-content: center;
    }

    .authentication-action-row {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .authentication-action-row .btn,
    .authentication-action-row > span {
        width: 100%;
    }

    .support-inbox-workspace {
        min-width: 0;
    }

    .support-ticket-list-panel,
    .support-ticket-thread {
        min-height: 440px;
    }

    .support-ticket-message-copy {
        max-width: 92%;
    }

    .support-ticket-compose-row {
        align-items: end;
    }

    .support-widget {
        right: 10px !important;
        bottom: 10px !important;
        left: auto !important;
        max-width: calc(100vw - 20px);
    }

    .support-widget-panel,
    .support-widget-window {
        width: min(390px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;
    }

    .support-widget-composer {
        grid-template-columns: 34px minmax(0, 1fr) 34px !important;
        gap: 6px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .support-widget-send,
    .support-widget-attach {
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        height: 34px !important;
    }

    .notification-popover {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: 64px !important;
        width: auto !important;
        max-width: none !important;
    }

    .role-pill {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-name {
        min-width: 0;
    }

    .user-name strong,
    .user-name small {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Very small phones */
@media (max-width: 420px) {
    .content-area {
        padding: 9px;
    }

    .panel {
        padding: 12px;
    }

    .page-heading h1 {
        font-size: 20px;
    }

    .topbar {
        gap: 8px;
    }

    .role-pill {
        display: none;
    }

    .security-overview-grid {
        gap: 10px;
    }

    .metric-card {
        padding: 14px;
    }

    .modal-dialog {
        width: calc(100% - 8px);
        max-width: calc(100% - 8px);
        margin: 4px auto;
    }

    .modal-content {
        max-height: calc(100dvh - 8px);
    }

    .modal-footer .btn {
        width: 100%;
        flex-basis: 100%;
    }

    .support-widget-panel,
    .support-widget-window {
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px) !important;
    }

    .table {
        font-size: 11px;
    }
}


/* Test Cycle cards aligned with User Story design */
.test-cycle-story-grid {
    align-items: stretch;
}

.test-cycle-card-modern {
    min-height: 100%;
}

.test-cycle-card-modern .user-story-card-main h3 {
    margin-bottom: 10px;
}

.test-cycle-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.test-cycle-info-grid > div {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--qt-border);
    border-radius: 11px;
    background: var(--qt-surface-soft);
}

.test-cycle-info-grid span,
.test-cycle-info-grid strong {
    display: block;
}

.test-cycle-info-grid span {
    margin-bottom: 3px;
    color: var(--qt-muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.test-cycle-info-grid strong {
    color: var(--qt-text);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.test-cycle-progress-modern {
    margin-top: 14px;
}

.test-cycle-progress-modern .progress {
    height: 8px;
}

.test-cycle-result-row {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.test-cycle-result-row > span {
    padding: 6px 9px;
    border: 1px solid var(--qt-border);
    border-radius: 999px;
    color: var(--qt-muted);
    background: var(--qt-surface);
    font-size: 10px;
}

.test-cycle-result-row strong {
    color: var(--qt-text);
}

@media (max-width: 620px) {
    .test-cycle-info-grid {
        grid-template-columns: 1fr;
    }
}


/* Header profile dropdown */
.profile-dropdown {
    position: relative;
}

.profile-dropdown .user-menu {
    appearance: none;
    border: 1px solid var(--qt-border);
    cursor: pointer;
    text-align: left;
}

.profile-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--qt-surface);
}

.profile-dropdown-toggle:hover,
.profile-dropdown-toggle.is-open {
    border-color: rgba(59, 99, 246, .35);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.profile-dropdown-chevron {
    margin-left: 2px;
    color: var(--qt-muted);
    font-size: 11px;
    transition: transform .18s ease;
}

.profile-dropdown-toggle.is-open .profile-dropdown-chevron {
    transform: rotate(180deg);
}

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1080;
    width: 250px;
    padding: 8px;
    border: 1px solid var(--qt-border);
    border-radius: 14px;
    background: var(--qt-surface);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}

.profile-dropdown-menu[hidden] {
    display: none !important;
}

.profile-dropdown-summary {
    padding: 10px 11px 12px;
}

.profile-dropdown-summary strong,
.profile-dropdown-summary small {
    display: block;
}

.profile-dropdown-summary strong {
    color: var(--qt-text);
    font-size: 13px;
    font-weight: 800;
}

.profile-dropdown-summary small {
    margin-top: 3px;
    color: var(--qt-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.profile-dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background: var(--qt-border);
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--qt-text);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.profile-dropdown-item:hover {
    background: var(--qt-surface-soft);
    color: var(--qt-primary);
}

.profile-dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.profile-dropdown-logout {
    color: #c93545;
}

.profile-dropdown-logout:hover {
    color: #b42333;
    background: #fff1f3;
}

@media (max-width: 720px) {
    .profile-dropdown-menu {
        width: min(250px, calc(100vw - 24px));
    }
}

/* QA Track official logo */
.sidebar-brand-logo {
    display: block;
    width: 92px;
    max-width: calc(100% - 42px);
    height: 46px;
    object-fit: contain;
    object-position: left center;
    border-radius: 6px;
}

.sidebar.collapsed .sidebar-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    object-position: left top;
}

.auth-brand-logo {
    display: block;
    width: min(310px, 88%);
    height: auto;
    max-height: 210px;
    margin: 0 0 22px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
}


/* Compact sidebar branding */
.sidebar-brand {
    min-height: 66px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.sidebar:not(.collapsed) .sidebar-brand-logo {
    width: 92px !important;
    height: 46px !important;
}


/* FINAL sidebar logo sizing override */
.sidebar .sidebar-brand {
    min-height: 62px !important;
    height: 62px !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: visible !important;
}

.sidebar-logo-wrap {
    width: 74px !important;
    height: 46px !important;
    flex: 0 0 74px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    border-radius: 6px !important;
}

.sidebar-logo-wrap .sidebar-brand-logo {
    display: block !important;
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 5px !important;
}

.sidebar.collapsed .sidebar-logo-wrap {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px !important;
}

.sidebar.collapsed .sidebar-logo-wrap .sidebar-brand-logo {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
}

/* Keep collapse control compact beside the logo */
.sidebar .sidebar-collapse-button {
    margin-left: auto !important;
    flex: 0 0 auto !important;
}


/* FINAL compact QA Track sidebar logo */
.sidebar .sidebar-brand {
    min-height: 52px !important;
    height: 52px !important;
    padding: 6px 10px !important;
}

.sidebar .sidebar-logo-wrap {
    width: 58px !important;
    height: 38px !important;
    flex: 0 0 58px !important;
    overflow: hidden !important;
}

.sidebar .sidebar-logo-wrap .sidebar-brand-logo {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    object-fit: contain !important;
    object-position: center !important;
}

.sidebar.collapsed .sidebar-logo-wrap {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
}

.sidebar.collapsed .sidebar-logo-wrap .sidebar-brand-logo {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
}


/* FINAL: small circular sidebar logo */
.sidebar .sidebar-brand {
    min-height: 50px !important;
    height: 50px !important;
    padding: 6px 10px !important;
}

.sidebar .sidebar-logo-wrap {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #ffffff !important;
    display: grid !important;
    place-items: center !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,.12) !important;
}

.sidebar .sidebar-logo-wrap .sidebar-brand-logo {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.sidebar.collapsed .sidebar-logo-wrap {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
}

.sidebar.collapsed .sidebar-logo-wrap .sidebar-brand-logo {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
}


/* QA Track Management label beside circular logo */
.sidebar-brand-label {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    margin-left: 8px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
}

.sidebar-brand-label strong {
    display: block !important;
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: .01em !important;
}

.sidebar-brand-label small {
    display: block !important;
    margin-top: 3px !important;
    color: rgba(255,255,255,.66) !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: .04em !important;
}

.sidebar.collapsed .sidebar-brand-label {
    display: none !important;
}


/* FINAL collapsed sidebar brand fix */
.sidebar.collapsed .sidebar-brand {
    position: relative !important;
    min-height: 76px !important;
    height: 76px !important;
    padding: 8px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    overflow: visible !important;
}

.sidebar.collapsed .sidebar-logo-wrap {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    margin: 0 auto !important;
    border-radius: 50% !important;
    overflow: hidden !important;
}

.sidebar.collapsed .sidebar-logo-wrap .sidebar-brand-logo {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.sidebar.collapsed .sidebar-brand-label {
    display: none !important;
}

.sidebar.collapsed .sidebar-collapse-button {
    position: static !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 30px !important;
    transform: none !important;
}

.sidebar.collapsed .sidebar-collapse-button i {
    margin: 0 !important;
    font-size: 13px !important;
}

/* Prevent any leftover brand text from showing in collapsed mode */
.sidebar.collapsed .brand-copy,
.sidebar.collapsed .brand-mini,
.sidebar.collapsed .sidebar-brand strong:not(.sidebar-brand-label strong),
.sidebar.collapsed .sidebar-brand small:not(.sidebar-brand-label small) {
    display: none !important;
}


/* FINAL: hide logo and QA Track label when sidebar is collapsed */
.sidebar.collapsed .sidebar-logo-wrap,
.sidebar.collapsed .sidebar-brand-logo,
.sidebar.collapsed .sidebar-brand-label {
    display: none !important;
}

/* Keep only the expand/collapse control in the collapsed brand area */
.sidebar.collapsed .sidebar-brand {
    min-height: 48px !important;
    height: 48px !important;
    padding: 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
}

.sidebar.collapsed .sidebar-collapse-button {
    position: static !important;
    display: grid !important;
    place-items: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    transform: none !important;
}


/* TRUE collapsed-state branding rule: app toggles body.sidebar-collapsed */
body.sidebar-collapsed #appSidebar .sidebar-logo-wrap,
body.sidebar-collapsed #appSidebar .sidebar-brand-logo,
body.sidebar-collapsed #appSidebar .sidebar-brand-label {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.sidebar-collapsed #appSidebar .sidebar-brand {
    min-height: 48px !important;
    height: 48px !important;
    padding: 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
}

body.sidebar-collapsed #appSidebar .sidebar-collapse-button {
    position: static !important;
    margin: 0 auto !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    flex: 0 0 32px !important;
}


/* Profile photo avatar */
.user-avatar.has-photo {
    padding: 0 !important;
    overflow: hidden !important;
    background: var(--qt-surface-soft) !important;
}

.user-avatar.has-photo img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: inherit !important;
}


/* FINAL responsive top-right account/profile control */
.profile-dropdown {
    min-width: 0 !important;
    max-width: 100% !important;
}

.profile-dropdown-toggle.user-menu {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    width: auto !important;
    max-width: 290px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.profile-dropdown-toggle .user-avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    flex: 0 0 34px !important;
    border-radius: 50% !important;
}

.profile-dropdown-toggle .user-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.profile-dropdown-toggle .user-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.profile-dropdown-toggle .user-name strong,
.profile-dropdown-toggle .user-name small {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.profile-dropdown-toggle .user-name strong {
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.profile-dropdown-toggle .user-name small {
    margin-top: 2px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
}

.profile-dropdown-toggle .role-pill {
    flex: 0 0 auto !important;
    max-width: 90px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.profile-dropdown-toggle .profile-dropdown-chevron {
    flex: 0 0 auto !important;
    margin-left: 2px !important;
}

/* Tablet */
@media (max-width: 1100px) {
    .profile-dropdown-toggle.user-menu {
        max-width: 220px !important;
    }

    .profile-dropdown-toggle .role-pill {
        max-width: 65px !important;
        font-size: 9px !important;
    }
}

/* Smaller tablet */
@media (max-width: 850px) {
    .profile-dropdown-toggle.user-menu {
        max-width: 170px !important;
    }

    .profile-dropdown-toggle .user-name small {
        display: none !important;
    }

    .profile-dropdown-toggle .user-name strong {
        font-size: 11px !important;
    }
}

/* Mobile: avatar-only trigger, dropdown still works */
@media (max-width: 650px) {
    .profile-dropdown-toggle.user-menu {
        width: 46px !important;
        min-width: 46px !important;
        max-width: 46px !important;
        height: 46px !important;
        padding: 6px !important;
        justify-content: center !important;
        gap: 0 !important;
        border-radius: 14px !important;
    }

    .profile-dropdown-toggle .user-name,
    .profile-dropdown-toggle .role-pill,
    .profile-dropdown-toggle .profile-dropdown-chevron {
        display: none !important;
    }

    .profile-dropdown-toggle .user-avatar {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        flex-basis: 34px !important;
    }

    .profile-dropdown-menu {
        right: 0 !important;
        left: auto !important;
        width: min(245px, calc(100vw - 20px)) !important;
        min-width: 0 !important;
    }
}

/* Very narrow screens */
@media (max-width: 420px) {
    .topbar-actions {
        gap: 6px !important;
    }

    .profile-dropdown-toggle.user-menu {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        padding: 4px !important;
    }

    .profile-dropdown-toggle .user-avatar {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        flex-basis: 32px !important;
    }
}


/* Center avatar inside compact/mobile profile trigger */
@media (max-width: 650px) {
    .profile-dropdown-toggle.user-menu {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        position: relative !important;
    }

    .profile-dropdown-toggle .user-avatar {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        margin: 0 !important;
        transform: translate(-50%, -50%) !important;
    }
}


/* =========================================================
   TEST CASES RESPONSIVE VIEW — AUTHORITATIVE FINAL RULES
   Desktop/tablet: regular table
   Narrow screens: dedicated mobile cards
   ========================================================= */

.test-cases-mobile-only {
    display: none !important;
}

/* Use cards on phones and narrow tablets/WebViews. */
@media screen and (max-width: 1100px) {

    /* Completely remove the desktop table and its container from layout. */
    .test-cases-desktop-panel {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
    }

    .test-cases-desktop-panel .table-responsive,
    .test-cases-desktop-panel .test-cases-responsive-table {
        display: none !important;
    }

    /* Dedicated mobile cards */
    .test-cases-mobile-only {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 14px 0 0 !important;
        padding: 0 !important;
    }

    .test-case-mobile-card {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border: 1px solid var(--qt-border, #dfe6ef) !important;
        border-radius: 16px !important;
        background: var(--qt-surface, #fff) !important;
        overflow: hidden !important;
        box-shadow: 0 5px 16px rgba(15,23,42,.045) !important;
    }

    .test-case-mobile-header {
        display: grid !important;
        grid-template-columns: minmax(0,1fr) auto !important;
        gap: 10px !important;
        align-items: start !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 14px !important;
        background: var(--qt-surface-soft, #f7f9fc) !important;
        border-bottom: 1px solid var(--qt-border, #edf1f5) !important;
    }

    .test-case-mobile-heading {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .test-case-mobile-heading .test-case-code {
        display: block !important;
        margin: 0 0 5px !important;
        color: var(--qt-primary, #3867e8) !important;
        font-size: 12px !important;
        font-weight: 850 !important;
        line-height: 1.25 !important;
    }

    .test-case-mobile-heading h3 {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 0 5px !important;
        color: var(--qt-text, #172033) !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        line-height: 1.4 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    .test-case-mobile-heading small {
        display: block !important;
        color: var(--qt-muted, #64748b) !important;
        font-size: 10px !important;
        white-space: normal !important;
    }

    .test-case-mobile-header .workflow-pill {
        align-self: start !important;
        max-width: 120px !important;
        white-space: normal !important;
        text-align: center !important;
        justify-content: center !important;
    }

    .test-case-mobile-section {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 14px !important;
        border-bottom: 1px solid var(--qt-border, #edf1f5) !important;
        overflow: hidden !important;
        white-space: normal !important;
    }

    .test-case-mobile-label {
        display: block !important;
        margin-bottom: 6px !important;
        color: var(--qt-muted, #64748b) !important;
        font-size: 9px !important;
        font-weight: 850 !important;
        line-height: 1.2 !important;
        letter-spacing: .055em !important;
        text-transform: uppercase !important;
    }

    .test-case-mobile-meta {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 5px !important;
        width: 100% !important;
        min-width: 0 !important;
        margin-top: 7px !important;
    }

    .test-case-mobile-meta span {
        display: flex !important;
        align-items: flex-start !important;
        gap: 5px !important;
        min-width: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    .test-case-mobile-grid {
        display: grid !important;
        grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .test-case-mobile-grid > .test-case-mobile-section:first-child {
        border-right: 1px solid var(--qt-border, #edf1f5) !important;
    }

    .test-case-mobile-card .tester-profile {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .test-case-mobile-card .tester-profile > div {
        min-width: 0 !important;
    }

    .test-case-mobile-card .tester-profile strong,
    .test-case-mobile-card .tester-profile small {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .test-case-mobile-card .activity-stack {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 5px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .test-case-mobile-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 14px 14px !important;
    }

    .test-case-mobile-actions form,
    .test-case-mobile-actions .btn,
    .test-case-mobile-actions form .btn {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* Filter area follows the same single-column mobile pattern. */
    .filter-grid {
        grid-template-columns: minmax(0,1fr) !important;
    }

    .filter-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .filter-actions .btn,
    .filter-actions a {
        width: 100% !important;
    }
}

@media screen and (max-width: 520px) {
    .test-case-mobile-header {
        grid-template-columns: minmax(0,1fr) !important;
    }

    .test-case-mobile-header .workflow-pill {
        width: fit-content !important;
        max-width: 100% !important;
    }

    .test-case-mobile-grid {
        grid-template-columns: minmax(0,1fr) !important;
    }

    .test-case-mobile-grid > .test-case-mobile-section:first-child {
        border-right: 0 !important;
    }
}


/* =========================================================
   TEST CASES RUNTIME MOBILE SWITCH
   JS adds body.qatrack-mobile-testcases on narrow windows.
   This overrides all older table CSS.
   ========================================================= */
body.qatrack-mobile-testcases .test-cases-desktop-panel {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -100000px !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

body.qatrack-mobile-testcases .test-cases-mobile-only {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
}

body:not(.qatrack-mobile-testcases) .test-cases-mobile-only {
    display: none !important;
}

/* Hard guarantees for text inside mobile cards */
body.qatrack-mobile-testcases .test-case-mobile-card,
body.qatrack-mobile-testcases .test-case-mobile-header,
body.qatrack-mobile-testcases .test-case-mobile-heading,
body.qatrack-mobile-testcases .test-case-mobile-section {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.qatrack-mobile-testcases .test-case-mobile-heading h3,
body.qatrack-mobile-testcases .test-case-mobile-heading *,
body.qatrack-mobile-testcases .test-case-mobile-section * {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

body.qatrack-mobile-testcases .test-case-mobile-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
}

body.qatrack-mobile-testcases .test-case-mobile-header .workflow-pill {
    width: fit-content !important;
    max-width: 100% !important;
}

body.qatrack-mobile-testcases .test-case-mobile-grid {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
}

body.qatrack-mobile-testcases .test-case-mobile-grid > .test-case-mobile-section {
    border-right: 0 !important;
}

body.qatrack-mobile-testcases .filter-grid {
    grid-template-columns: minmax(0,1fr) !important;
}

body.qatrack-mobile-testcases .filter-actions {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 8px !important;
}

body.qatrack-mobile-testcases .filter-actions .btn,
body.qatrack-mobile-testcases .filter-actions a {
    width: 100% !important;
}


/* =========================================================
   TEST CASES — RESPONSIVE TABLE FORMAT
   Keep table format on mobile, with controlled column widths
   and horizontal scrolling instead of overlapping text.
   ========================================================= */

.test-cases-mobile-only,
.test-cases-mobile-list {
    display: none !important;
}

.test-cases-desktop-panel {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    margin: initial !important;
    padding: initial !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

.test-cases-desktop-panel .table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
}

.test-cases-desktop-panel .test-cases-responsive-table {
    display: table !important;
    visibility: visible !important;
    width: 100% !important;
    min-width: 1050px !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin-bottom: 0 !important;
}

.test-cases-responsive-table thead {
    display: table-header-group !important;
}

.test-cases-responsive-table tbody {
    display: table-row-group !important;
}

.test-cases-responsive-table tr {
    display: table-row !important;
}

.test-cases-responsive-table th,
.test-cases-responsive-table td {
    display: table-cell !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

/* Explicit widths stop adjacent columns from drawing over each other. */
.test-cases-responsive-table th:nth-child(1),
.test-cases-responsive-table td:nth-child(1) {
    width: 245px !important;
    min-width: 245px !important;
}

.test-cases-responsive-table th:nth-child(2),
.test-cases-responsive-table td:nth-child(2) {
    width: 190px !important;
    min-width: 190px !important;
}

.test-cases-responsive-table th:nth-child(3),
.test-cases-responsive-table td:nth-child(3) {
    width: 145px !important;
    min-width: 145px !important;
}

.test-cases-responsive-table th:nth-child(4),
.test-cases-responsive-table td:nth-child(4) {
    width: 155px !important;
    min-width: 155px !important;
}

.test-cases-responsive-table th:nth-child(5),
.test-cases-responsive-table td:nth-child(5) {
    width: 110px !important;
    min-width: 110px !important;
}

.test-cases-responsive-table th:nth-child(6),
.test-cases-responsive-table td:nth-child(6) {
    width: 145px !important;
    min-width: 145px !important;
}

.test-cases-responsive-table th:nth-child(7),
.test-cases-responsive-table td:nth-child(7) {
    width: 150px !important;
    min-width: 150px !important;
}

.test-cases-responsive-table th:nth-child(8),
.test-cases-responsive-table td:nth-child(8) {
    width: 155px !important;
    min-width: 155px !important;
}

.test-cases-responsive-table .test-case-primary,
.test-cases-responsive-table .test-case-title,
.test-cases-responsive-table .coverage-stack,
.test-cases-responsive-table .coverage-stack span {
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
}

.test-cases-responsive-table .test-case-title {
    display: block !important;
    line-height: 1.35 !important;
}

@media screen and (max-width: 1100px) {
    body.qatrack-mobile-testcases .test-cases-desktop-panel,
    .test-cases-desktop-panel {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: initial !important;
        padding: initial !important;
        border: initial !important;
        overflow: visible !important;
        pointer-events: auto !important;
    }

    body.qatrack-mobile-testcases .test-cases-mobile-only,
    .test-cases-mobile-only,
    .test-cases-mobile-list {
        display: none !important;
    }

    .test-cases-desktop-panel .table-responsive {
        overflow-x: auto !important;
    }

    .test-cases-desktop-panel .test-cases-responsive-table {
        display: table !important;
        visibility: visible !important;
        min-width: 1295px !important;
    }

    .test-cases-responsive-table tr {
        display: table-row !important;
    }

    .test-cases-responsive-table th,
    .test-cases-responsive-table td {
        display: table-cell !important;
        width: auto;
        padding: 12px 10px !important;
    }

    .test-cases-responsive-table td[data-label]::before {
        display: none !important;
        content: none !important;
    }
}


/* =========================================================
   TEST CASE MODAL BUTTON FIX
   Keep Cancel + Update Test Case aligned and usable on mobile.
   ========================================================= */

#editTestCaseModal .modal-footer,
.modal[id^="editTestCase"] .modal-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
}

#editTestCaseModal .modal-footer .btn,
.modal[id^="editTestCase"] .modal-footer .btn {
    width: auto !important;
    min-width: 120px !important;
    min-height: 42px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}

@media screen and (max-width: 767.98px) {
    #editTestCaseModal .modal-footer,
    .modal[id^="editTestCase"] .modal-footer {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 12px 14px !important;
        box-sizing: border-box !important;
    }

    #editTestCaseModal .modal-footer .btn,
    .modal[id^="editTestCase"] .modal-footer .btn,
    #editTestCaseModal .modal-footer button,
    .modal[id^="editTestCase"] .modal-footer button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 12px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        line-height: 1 !important;
    }

    /* Cancel */
    #editTestCaseModal .modal-footer .btn-outline-secondary,
    #editTestCaseModal .modal-footer .btn-secondary,
    .modal[id^="editTestCase"] .modal-footer .btn-outline-secondary,
    .modal[id^="editTestCase"] .modal-footer .btn-secondary {
        background: #fff !important;
    }

    /* Update */
    #editTestCaseModal .modal-footer .btn-primary,
    .modal[id^="editTestCase"] .modal-footer .btn-primary {
        min-height: 44px !important;
        height: 44px !important;
    }
}

@media screen and (max-width: 390px) {
    #editTestCaseModal .modal-footer,
    .modal[id^="editTestCase"] .modal-footer {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   USER STORY MOBILE ACTION BUTTON FIX
   View Details / Change QA / Unassign QA
   ========================================================= */
@media screen and (max-width: 767.98px) {

    /* User Story action/footer areas */
    .story-card .story-actions,
    .user-story-card .story-actions,
    .story-card .card-actions,
    .user-story-card .card-actions,
    .story-card-footer,
    .user-story-card-footer {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* All buttons/forms inside a User Story card use the full available width */
    .story-card .story-actions .btn,
    .story-card .story-actions form,
    .story-card .story-actions form .btn,
    .user-story-card .story-actions .btn,
    .user-story-card .story-actions form,
    .user-story-card .story-actions form .btn,
    .story-card .card-actions .btn,
    .story-card .card-actions form,
    .story-card .card-actions form .btn,
    .user-story-card .card-actions .btn,
    .user-story-card .card-actions form,
    .user-story-card .card-actions form .btn,
    .story-card-footer .btn,
    .story-card-footer form,
    .story-card-footer form .btn,
    .user-story-card-footer .btn,
    .user-story-card-footer form,
    .user-story-card-footer form .btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 42px !important;
        height: 42px !important;
        margin: 0 !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }

    /* Catch assignment buttons even if their parent uses older markup */
    .story-card button,
    .story-card a.btn,
    .user-story-card button,
    .user-story-card a.btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Prevent a destructive action from shrinking to content width */
    .story-card .btn-danger,
    .story-card .btn-outline-danger,
    .user-story-card .btn-danger,
    .user-story-card .btn-outline-danger {
        width: 100% !important;
    }
}


/* =========================================================
   USER STORY ACTIONS - EXACT CURRENT MARKUP
   ========================================================= */
@media screen and (max-width: 767.98px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-card-actions-modern > .user-story-view-button {
        width: 100% !important;
        min-height: 42px !important;
        margin: 0 !important;
    }

    .user-story-card-actions-modern > .d-flex {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-card-actions-modern > .d-flex > button,
    .user-story-card-actions-modern > .d-flex > .btn,
    .user-story-card-actions-modern > .d-flex > form,
    .user-story-card-actions-modern > .d-flex > form > button,
    .user-story-card-actions-modern > .d-flex > form > .btn,
    .user-story-card-actions-modern > .d-flex > div,
    .user-story-card-actions-modern > .d-flex > div > form,
    .user-story-card-actions-modern > .d-flex > div > form > button,
    .user-story-card-actions-modern > .d-flex > div > .btn {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 42px !important;
        height: 42px !important;
        padding: 0 12px !important;
        white-space: nowrap !important;
    }

    .user-story-card-actions-modern form.d-inline {
        display: block !important;
    }

    .user-story-card-actions-modern .d-flex.align-items-center.gap-2.flex-wrap {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }
}


/* =========================================================
   USER STORY ACTION BAR - FINAL DESKTOP + MOBILE FIX
   ========================================================= */

.user-story-card-actions-modern {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
}

.user-story-card-actions-modern > .user-story-view-button {
    min-width: 118px !important;
    height: 38px !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.user-story-assignment-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
}

.user-story-assignment-actions > button,
.user-story-assignment-actions > .btn,
.user-story-assignment-actions > form,
.user-story-assignment-actions > div {
    flex: 0 0 auto !important;
    margin: 0 !important;
}

.user-story-assignment-actions > form {
    display: inline-block !important;
}

.user-story-assignment-actions .btn,
.user-story-assignment-actions button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

/* Keep the destructive action same height/spacing as the others */
.user-story-assignment-actions .btn-outline-danger {
    min-width: 108px !important;
}

/* If the card becomes narrower, use a controlled two-row grid instead
   of letting individual buttons fall randomly to the next line. */
@media screen and (max-width: 1380px) and (min-width: 768px) {
    .user-story-card-actions-modern {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
    }

    .user-story-card-actions-modern > .user-story-view-button {
        width: 100% !important;
    }

    .user-story-assignment-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
    }

    .user-story-assignment-actions > button,
    .user-story-assignment-actions > .btn,
    .user-story-assignment-actions > form,
    .user-story-assignment-actions > form > .btn,
    .user-story-assignment-actions > div {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .user-story-assignment-actions > form {
        display: block !important;
    }

    .user-story-assignment-actions .btn,
    .user-story-assignment-actions button {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Phone layout remains fully stacked */
@media screen and (max-width: 767.98px) {
    .user-story-card-actions-modern {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .user-story-card-actions-modern > .user-story-view-button {
        width: 100% !important;
        min-width: 0 !important;
        height: 42px !important;
    }

    .user-story-assignment-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-assignment-actions > button,
    .user-story-assignment-actions > .btn,
    .user-story-assignment-actions > form,
    .user-story-assignment-actions > form > .btn,
    .user-story-assignment-actions > div,
    .user-story-assignment-actions > div > form,
    .user-story-assignment-actions > div > form > .btn {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .user-story-assignment-actions > form {
        display: block !important;
    }

    .user-story-assignment-actions .btn,
    .user-story-assignment-actions button {
        width: 100% !important;
        min-height: 42px !important;
        height: 42px !important;
    }
}


/* =========================================================
   USER STORY ACTIONS — STRICT ALIGNMENT
   ========================================================= */
@media screen and (min-width: 768px) {
    .user-story-card-actions-modern {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-card-actions-modern > .user-story-view-button {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 116px !important;
        height: 38px !important;
        min-height: 38px !important;
        margin: 0 !important;
    }

    .user-story-assignment-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        margin-left: auto !important;
    }

    .user-story-assignment-actions > form,
    .user-story-assignment-actions > div {
        display: flex !important;
        align-items: center !important;
        width: auto !important;
        margin: 0 !important;
    }

    .user-story-assignment-actions .btn,
    .user-story-assignment-actions button,
    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 0 !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        margin: 0 !important;
        padding: 0 10px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    .user-story-assignment-actions .btn-outline-danger {
        min-width: 104px !important;
    }
}

/* When a card is genuinely too narrow, keep alignment by using
   one button per row rather than allowing random wrapping. */
@media screen and (min-width: 768px) and (max-width: 1180px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .user-story-card-actions-modern > .user-story-view-button {
        width: 100% !important;
    }

    .user-story-assignment-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    .user-story-assignment-actions > form,
    .user-story-assignment-actions > div,
    .user-story-assignment-actions .btn,
    .user-story-assignment-actions button {
        width: 100% !important;
    }
}

@media screen and (max-width: 767.98px) {
    .user-story-card-actions-modern,
    .user-story-assignment-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-assignment-actions > form,
    .user-story-assignment-actions > div,
    .user-story-assignment-actions .btn,
    .user-story-assignment-actions button {
        width: 100% !important;
        margin: 0 !important;
    }
}


/* =========================================================
   USER STORY ACTIONS — EQUAL 4-BUTTON ALIGNMENT
   ========================================================= */

/* Normal desktop/tablet card widths */
@media screen and (min-width: 900px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Flatten the nested assignment wrapper so its children
       participate in the same 4-column grid. */
    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: contents !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions > form {
        display: block !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions > form > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > div > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > div > button,
    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        margin: 0 !important;
        padding: 0 8px !important;
        box-sizing: border-box !important;
        font-size: 12px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    .user-story-card-actions-modern .btn i,
    .user-story-card-actions-modern button i {
        flex: 0 0 auto !important;
        margin-right: 5px !important;
    }
}

/* Medium widths: clean 2 x 2 grid */
@media screen and (min-width: 600px) and (max-width: 899.98px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: contents !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions > form {
        display: block !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        height: 40px !important;
        min-height: 40px !important;
        justify-content: center !important;
    }
}

/* Mobile: one button per row */
@media screen and (max-width: 599.98px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: contents !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions > form {
        display: block !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        height: 42px !important;
        min-height: 42px !important;
        justify-content: center !important;
    }
}


/* =========================================================
   USER STORY ACTIONS — NO TEXT OVERFLOW / FINAL COMPACT ROW
   ========================================================= */
@media screen and (min-width: 900px) {
    .user-story-card-actions-modern {
        display: flex !important;
        align-items: stretch !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: flex !important;
        flex: 1 1 auto !important;
        align-items: stretch !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions > form {
        display: flex !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button,
    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > button {
        display: inline-flex !important;
        flex: 1 1 auto !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 7px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        font-size: 11px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: clip !important;
    }

    .user-story-card-actions-modern .btn i,
    .user-story-card-actions-modern button i {
        flex: 0 0 auto !important;
        margin: 0 !important;
        font-size: 12px !important;
    }
}

/* At card widths where four labels cannot fit cleanly, switch to 2x2
   before any label can touch its neighboring button. */
@media screen and (min-width: 768px) and (max-width: 1050px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: contents !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions > form {
        display: flex !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 12px !important;
    }
}

@media screen and (max-width: 767.98px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: contents !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        height: 42px !important;
        min-height: 42px !important;
        font-size: 12px !important;
    }
}


/* User Story action buttons: text-overlap fix only */
.user-story-card-actions-modern .btn,
.user-story-card-actions-modern button {
    font-size: 10px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    gap: 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

.user-story-card-actions-modern .btn i,
.user-story-card-actions-modern button i {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 11px !important;
}

/* Allow the actual button element to shrink inside its column without
   pushing its text into the neighboring button. */
.user-story-card-actions-modern > .user-story-view-button,
.user-story-assignment-actions > button,
.user-story-assignment-actions > .btn,
.user-story-assignment-actions > form,
.user-story-assignment-actions > div,
.user-story-assignment-actions > form > button,
.user-story-assignment-actions > form > .btn {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}


/* =========================================================
   USER STORY ACTION BAR — PROPORTIONAL WIDTH FIX
   Prevent Change QA / Unassign QA text from being squeezed.
   ========================================================= */
@media screen and (min-width: 900px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: minmax(120px, 1.35fr) minmax(82px, .85fr) minmax(100px, 1fr) minmax(68px, .7fr) !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: contents !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions > form {
        display: flex !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button,
    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 7px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        font-size: 11px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .user-story-card-actions-modern .btn i,
    .user-story-card-actions-modern button i {
        flex: 0 0 auto !important;
        margin: 0 !important;
        font-size: 11px !important;
    }
}

/* If the card itself cannot fit four readable buttons, use 2x2.
   This prevents squeezing rather than hiding/truncating labels. */
@media screen and (min-width: 768px) and (max-width: 899.98px) {
    .user-story-card-actions-modern {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
        gap: 8px !important;
    }

    .user-story-card-actions-modern > .user-story-assignment-actions {
        display: contents !important;
    }

    .user-story-card-actions-modern > .user-story-view-button,
    .user-story-card-actions-modern > .user-story-assignment-actions > button,
    .user-story-card-actions-modern > .user-story-assignment-actions > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form,
    .user-story-card-actions-modern > .user-story-assignment-actions > div,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > .btn,
    .user-story-card-actions-modern > .user-story-assignment-actions > form > button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .user-story-card-actions-modern .btn,
    .user-story-card-actions-modern button {
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }
}


/* =========================================================
   PROJECT CARD ACTIONS — FIX VIEW / UPDATE BUTTON OVERLAP
   ========================================================= */
.project-card-actions-modern {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.project-card-actions-modern > .btn,
.project-card-actions-modern > button,
.project-card-actions-modern > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(50% - 5px) !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 0 1 auto !important;
}

.project-card-actions-modern .project-view-trigger {
    margin-right: auto !important;
}

.project-card-actions-modern .btn-primary {
    margin-left: auto !important;
}

@media screen and (max-width: 560px) {
    .project-card-actions-modern {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .project-card-actions-modern > .btn,
    .project-card-actions-modern > button,
    .project-card-actions-modern > a {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}


/* =========================================================
   PROJECT STATUS BADGES
   Fix plain "In Development" text and keep all statuses consistent.
   ========================================================= */
.project-card .project-status-badge,
.project-card-modern .project-status-badge,
.project-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 170px !important;
    min-height: 34px !important;
    padding: 7px 13px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* In Development */
.project-status-badge.status-in-development,
.project-status-badge[data-status="In Development"] {
    background: #eaf0ff !important;
    color: #315ed8 !important;
    border: 1px solid #dbe5ff !important;
}

/* Completed */
.project-status-badge.status-completed,
.project-status-badge[data-status="Completed"] {
    background: #f1e8ff !important;
    color: #7437c9 !important;
    border: 1px solid #eadcff !important;
}

@media screen and (max-width: 560px) {
    .project-status-badge {
        max-width: 145px !important;
        padding: 7px 10px !important;
        font-size: 11px !important;
    }
}

/* Exact current project card status element */
.project-card-modern .user-story-status-modern.project-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 34px !important;
    padding: 7px 13px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.project-card-modern .user-story-status-modern.status-in-development {
    background: #eaf0ff !important;
    color: #315ed8 !important;
    border: 1px solid #dbe5ff !important;
}


/* =========================================================
   SUPPORT CHAT — SHOW LAUNCHER ONLY ON HOVER
   Keep a small invisible hover target at the bottom-right.
   Once the chat is opened, keep the launcher visible.
   ========================================================= */
.support-widget:not(.open) .support-widget-launcher {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(6px) scale(.92) !important;
    pointer-events: none !important;
}

.support-widget:not(.open)::before {
    content: "";
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: transparent;
    pointer-events: auto;
}

.support-widget:not(.open):hover .support-widget-launcher,
.support-widget:not(.open):focus-within .support-widget-launcher {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
}

.support-widget.open .support-widget-launcher {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Touch devices have no reliable hover, so keep the launcher accessible. */
@media (hover: none), (pointer: coarse) {
    .support-widget:not(.open) .support-widget-launcher {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    .support-widget:not(.open)::before {
        display: none !important;
    }
}


/* =========================================================
   SUPPORT CHAT — ENHANCED READABLE DESIGN
   ========================================================= */

.support-widget {
    right: 26px !important;
    bottom: 26px !important;
}

.support-widget-launcher {
    width: 62px !important;
    height: 62px !important;
    font-size: 25px !important;
    box-shadow: 0 14px 34px rgba(54,75,190,.34) !important;
}

/* Bigger overall panel */
.support-widget-panel {
    width: min(440px, calc(100vw - 28px)) !important;
    height: min(680px, calc(100vh - 100px)) !important;
    border-radius: 24px !important;
    box-shadow: 0 26px 64px rgba(17,31,69,.28) !important;
}

.support-widget.is-admin .support-widget-panel {
    width: min(520px, calc(100vw - 28px)) !important;
}

/* Header */
.support-widget-header {
    min-height: 82px !important;
    padding: 16px 18px !important;
}

.support-widget-heading {
    gap: 12px !important;
}

.support-widget-brand-icon {
    width: 46px !important;
    height: 46px !important;
    flex-basis: 46px !important;
    font-size: 20px !important;
}

.support-widget-heading strong {
    display: block !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
}

.support-widget-heading small {
    display: block !important;
    margin-top: 3px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    opacity: .92 !important;
}

.support-widget-header-actions button {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
}

/* Conversation body */
.support-widget-body,
.support-widget-conversation,
.support-widget-messages {
    font-size: 13px !important;
}

.support-widget-messages {
    padding: 18px !important;
    gap: 12px !important;
}

/* Empty state */
.support-widget-empty {
    padding: 28px 20px !important;
}

.support-widget-empty span {
    width: 56px !important;
    height: 56px !important;
    font-size: 24px !important;
}

.support-widget-empty strong {
    font-size: 15px !important;
}

.support-widget-empty p {
    font-size: 12px !important;
    line-height: 1.5 !important;
}

/* Date separators */
.support-widget-date {
    margin: 8px 0 !important;
}

.support-widget-date span {
    font-size: 10px !important;
    padding: 4px 9px !important;
}

/* Message bubbles */
.support-widget-message,
.support-message,
.support-widget-bubble {
    font-size: 13px !important;
    line-height: 1.55 !important;
}

.support-widget-message-bubble,
.support-widget-message-content,
.support-message-bubble {
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

.support-widget-message small,
.support-message small {
    font-size: 10px !important;
}

/* Attachments */
.support-widget-file {
    font-size: 11px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
}

/* Composer */
.support-widget-composer {
    padding: 14px 16px 16px !important;
    gap: 10px !important;
}

.support-widget-composer textarea,
.support-widget-composer input[type="text"],
.support-widget-composer .form-control {
    min-height: 48px !important;
    max-height: 120px !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    border-radius: 14px !important;
}

.support-widget-composer button,
.support-widget-send {
    min-width: 46px !important;
    height: 46px !important;
    border-radius: 14px !important;
    font-size: 17px !important;
}

/* Ticket/meta rows if present */
.support-widget-ticket-title,
.support-widget-subject {
    font-size: 14px !important;
    font-weight: 800 !important;
}

.support-widget-ticket-meta,
.support-widget-status,
.support-widget-meta {
    font-size: 11px !important;
}

/* Scrollbar */
.support-widget-panel * {
    scrollbar-width: thin;
}

.support-widget-panel *::-webkit-scrollbar {
    width: 8px;
}

.support-widget-panel *::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100,116,139,.28);
}

/* Responsive sizing */
@media (max-width: 520px) {
    .support-widget {
        right: 12px !important;
        bottom: 12px !important;
    }

    .support-widget-panel,
    .support-widget.is-admin .support-widget-panel {
        width: calc(100vw - 24px) !important;
        height: min(76vh, 620px) !important;
        right: 0 !important;
        bottom: 72px !important;
        border-radius: 20px !important;
    }

    .support-widget-header {
        min-height: 74px !important;
        padding: 14px 15px !important;
    }

    .support-widget-heading strong {
        font-size: 15px !important;
    }

    .support-widget-heading small {
        font-size: 11px !important;
    }

    .support-widget-messages {
        padding: 14px !important;
    }

    .support-widget-composer {
        padding: 12px !important;
    }

    .support-widget-composer textarea,
    .support-widget-composer input[type="text"],
    .support-widget-composer .form-control {
        font-size: 14px !important;
    }
}

.support-widget-new-subject .support-required {
    color: #ef405b;
    font-weight: 900;
}
.support-widget-new-subject input.is-invalid {
    border-color: #ef405b !important;
    box-shadow: 0 0 0 3px rgba(239,64,91,.10) !important;
}


/* =========================================================
   SUPPORT CHAT SUBJECT — VALIDATION + SPACING
   ========================================================= */
.support-widget-new-subject {
    padding: 14px 18px 16px !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(148,163,184,.22) !important;
    background: #fff !important;
}

.support-widget-new-subject label {
    display: block !important;
    margin: 0 0 8px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

.support-widget-new-subject input {
    display: block !important;
    width: 100% !important;
    min-height: 46px !important;
    padding: 11px 13px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    font-size: 13px !important;
}

.support-widget-composer {
    margin-top: 10px !important;
    padding-top: 12px !important;
}

@media (max-width: 520px) {
    .support-widget-new-subject {
        padding: 12px 14px 14px !important;
    }

    .support-widget-composer {
        margin-top: 8px !important;
    }
}


/* Support send button: icon-only, never show clipped processing text */
.support-widget-composer button[type="submit"],
.support-widget-send,
#supportWidgetSend {
    flex: 0 0 48px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-indent: 0 !important;
}

.support-widget-composer button[type="submit"] i,
.support-widget-send i,
#supportWidgetSend i {
    margin: 0 !important;
    font-size: 18px !important;
}

/* Keep a clear gap between Subject and composer. */
.support-widget-new-subject {
    padding-bottom: 18px !important;
}
.support-widget-composer {
    margin-top: 14px !important;
}


/* =========================================================
   SUPPORT CHAT SEND BUTTON — FINAL ICON-ONLY FIX
   ========================================================= */
#supportWidgetSend {
    position: relative !important;
    display: inline-grid !important;
    place-items: center !important;
    flex: 0 0 52px !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-indent: 0 !important;
    font-size: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    color: #fff !important;
    background: linear-gradient(135deg,#416be9,#6651df) !important;
    box-shadow: 0 8px 18px rgba(65,107,233,.28) !important;
}

#supportWidgetSend::before,
#supportWidgetSend::after {
    content: none !important;
    display: none !important;
}

#supportWidgetSend i {
    display: block !important;
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: #fff !important;
}

#supportWidgetSend .spinner-border {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    border-width: 2px !important;
    color: #fff !important;
}

#supportWidgetSend.is-sending,
#supportWidgetSend:disabled {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    opacity: .82 !important;
}

/* Prevent generic global-loading text from becoming visible inside support button */
#supportWidgetSend .loading-text,
#supportWidgetSend .button-loading-text,
#supportWidgetSend [data-loading-text] {
    display: none !important;
}

/* Composer geometry */
.support-widget-composer {
    display: grid !important;
    grid-template-columns: 42px minmax(0,1fr) 52px !important;
    align-items: end !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.support-widget-input {
    min-width: 0 !important;
    width: 100% !important;
}

#supportWidgetMessage {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* More breathing room between Subject and Message */
.support-widget-new-subject {
    padding: 16px 18px 20px !important;
}

.support-widget-composer {
    margin-top: 16px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(148,163,184,.20) !important;
}

@media (max-width:520px) {
    .support-widget-composer {
        grid-template-columns: 38px minmax(0,1fr) 48px !important;
        gap: 8px !important;
    }

    #supportWidgetSend,
    #supportWidgetSend.is-sending,
    #supportWidgetSend:disabled {
        flex-basis: 48px !important;
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
    }
}


/* =========================================================
   SUPPORT SUBJECT REQUIRED — STRONG VISUAL HIGHLIGHT
   ========================================================= */
#supportWidgetSubjectInput.is-invalid {
    border: 2px solid #dc3545 !important;
    background: #fff7f8 !important;
    box-shadow: 0 0 0 4px rgba(220,53,69,.14) !important;
    outline: none !important;
}

#supportWidgetSubjectInput.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 4px rgba(220,53,69,.18) !important;
}

.support-widget-new-subject:has(#supportWidgetSubjectInput.is-invalid) label {
    color: #dc3545 !important;
}

.support-widget-new-subject .support-required {
    color: #dc3545 !important;
}


/* =========================================================
   DASHBOARD OPERATIONAL CONTROL CENTER
   ========================================================= */
.metric-card-link {
    position: relative;
    display: flex !important;
    color: inherit !important;
    text-decoration: none !important;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.metric-card-link:hover {
    transform: translateY(-2px);
    border-color: rgba(65,107,233,.32) !important;
    box-shadow: 0 12px 26px rgba(15,23,42,.08);
}
.metric-link-arrow {
    position: absolute;
    top: 14px;
    right: 14px;
    color: var(--qt-primary);
    font-size: 12px;
}

.dashboard-focus-panel {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid var(--qt-border);
    border-radius: 18px;
    background: var(--qt-surface);
    box-shadow: var(--qt-shadow-sm, 0 8px 22px rgba(15,23,42,.04));
}
.dashboard-focus-heading h2 {
    margin: 2px 0 3px;
    font-size: 20px;
    font-weight: 850;
}
.dashboard-focus-heading p {
    margin: 0;
    color: var(--qt-muted);
    font-size: 12px;
}
.dashboard-focus-filters {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr)) auto;
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}
.dashboard-focus-filters label {
    min-width: 0;
}
.dashboard-focus-filters label > span {
    display: block;
    margin-bottom: 6px;
    color: var(--qt-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.dashboard-focus-actions {
    display: flex;
    gap: 8px;
}

.dashboard-operational-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.dashboard-operational-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--qt-border);
    border-radius: 16px;
    background: var(--qt-surface);
    color: inherit;
    text-decoration: none;
}
.dashboard-operational-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border-radius: 12px;
    color: var(--qt-primary);
    background: var(--qt-primary-soft);
}
.dashboard-operational-card > div {
    min-width: 0;
}
.dashboard-operational-card small,
.dashboard-operational-card span {
    display: block;
    color: var(--qt-muted);
    font-size: 10px;
    line-height: 1.35;
}
.dashboard-operational-card strong {
    display: block;
    margin: 2px 0;
    color: var(--qt-text);
    font-size: 21px;
    font-weight: 850;
}
.dashboard-operational-link:hover {
    border-color: rgba(65,107,233,.35);
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.dashboard-operational-link > .bi-arrow-right {
    margin-left: auto;
    color: var(--qt-primary);
}

.dashboard-attention-list {
    display: grid;
    gap: 9px;
}
.dashboard-attention-item {
    display: grid;
    grid-template-columns: 40px minmax(0,1fr) auto 16px;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--qt-border);
    border-radius: 13px;
    color: inherit;
    text-decoration: none;
    background: var(--qt-surface-soft);
}
.dashboard-attention-item:hover {
    border-color: rgba(65,107,233,.30);
}
.dashboard-attention-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eef3ff;
    color: #3867e8;
}
.dashboard-attention-item strong {
    display: block;
    font-size: 12px;
}
.dashboard-attention-item small {
    display: block;
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 10px;
}
.dashboard-attention-item > b {
    min-width: 28px;
    text-align: center;
    font-size: 16px;
}
.dashboard-attention-arrow {
    color: var(--qt-muted);
}
.dashboard-attention-item.tone-danger .dashboard-attention-icon {
    color: #b4232e;
    background: #fff0f1;
}
.dashboard-attention-item.tone-warning .dashboard-attention-icon {
    color: #9a6500;
    background: #fff7df;
}
.dashboard-attention-item.tone-info .dashboard-attention-icon {
    color: #1769aa;
    background: #eaf6ff;
}

.dashboard-automation-run {
    display: grid;
    gap: 14px;
}
.dashboard-automation-run-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.dashboard-automation-run-head strong {
    display: block;
    color: var(--qt-primary);
    font-size: 13px;
}
.dashboard-automation-run-head span {
    display: block;
    margin-top: 2px;
    color: var(--qt-muted);
    font-size: 10px;
}
.dashboard-automation-status {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--qt-primary-soft);
    color: var(--qt-primary) !important;
    font-weight: 800;
}
.dashboard-automation-score {
    text-align: center;
    padding: 12px;
    border-radius: 14px;
    background: var(--qt-surface-soft);
}
.dashboard-automation-score strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}
.dashboard-automation-score span {
    display: block;
    margin-top: 4px;
    color: var(--qt-muted);
    font-size: 10px;
}
.dashboard-automation-stats {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 7px;
}
.dashboard-automation-stats span {
    padding: 9px 6px;
    border: 1px solid var(--qt-border);
    border-radius: 10px;
    color: var(--qt-muted);
    text-align: center;
    font-size: 9px;
}
.dashboard-automation-stats b {
    display: block;
    color: var(--qt-text);
    font-size: 15px;
}
.dashboard-automation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--qt-muted);
    font-size: 10px;
}
.dashboard-empty-state {
    min-height: 210px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 6px;
    text-align: center;
    color: var(--qt-muted);
}
.dashboard-empty-state > i {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--qt-primary-soft);
    color: var(--qt-primary);
    font-size: 20px;
}
.dashboard-empty-state strong {
    color: var(--qt-text);
    font-size: 13px;
}
.dashboard-empty-state span {
    max-width: 260px;
    font-size: 10px;
}

@media (max-width:1199.98px) {
    .dashboard-focus-filters {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .dashboard-operational-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}
@media (max-width:767.98px) {
    .dashboard-focus-filters,
    .dashboard-operational-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-focus-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-focus-actions .btn {
        width: 100%;
    }
    .dashboard-automation-stats {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}


/* =========================================================
   DASHBOARD RECENT ACTIVITY — RESPONSIVE / NO OVERLAP
   ========================================================= */
.activity-timeline,
.timeline-item,
.timeline-content {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.timeline-item {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    width: 100% !important;
}

.timeline-content {
    width: 100% !important;
    overflow: hidden !important;
}

.timeline-content > div {
    min-width: 0 !important;
    max-width: 100% !important;
    align-items: baseline !important;
}

.timeline-content strong,
.timeline-content span,
.timeline-content p,
.timeline-content small {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
}

.timeline-content p {
    line-height: 1.5 !important;
}

/* Keep the Recent Activity panel itself inside its Bootstrap column. */
.panel .activity-timeline {
    width: 100% !important;
    overflow: hidden !important;
}

@media (max-width: 767.98px) {
    .timeline-item {
        grid-template-columns: 32px minmax(0, 1fr) !important;
        gap: 9px !important;
        padding-bottom: 14px !important;
    }

    .timeline-marker {
        width: 32px !important;
        height: 32px !important;
        border-radius: 10px !important;
    }

    .timeline-item:not(:last-child)::before {
        left: 15px !important;
        top: 30px !important;
    }

    .timeline-content {
        padding: 11px 12px !important;
    }

    .timeline-content > div {
        display: block !important;
    }

    .timeline-content > div strong,
    .timeline-content > div span {
        display: block !important;
    }

    .timeline-content > div strong {
        margin-bottom: 3px !important;
        font-size: 12px !important;
    }

    .timeline-content > div span {
        font-size: 11px !important;
    }

    .timeline-content p {
        font-size: 11px !important;
    }
}


/* =========================================================
   DASHBOARD OPERATIONAL CARDS — ICON FIX
   ========================================================= */
.dashboard-operational-icon {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    flex: 0 0 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 14px !important;
    background: var(--qt-primary-soft, #eef3ff) !important;
    color: var(--qt-primary, #3867e8) !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.dashboard-operational-icon > i {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 19px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    color: currentColor !important;
    transform: none !important;
}

.dashboard-operational-card {
    align-items: center !important;
}

.dashboard-operational-link > .bi-arrow-right {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    padding-left: 10px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: var(--qt-primary, #3867e8) !important;
}

/* Keep icon visual balance on narrow screens */
@media (max-width: 767.98px) {
    .dashboard-operational-icon {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        flex-basis: 44px !important;
        border-radius: 12px !important;
    }

    .dashboard-operational-icon > i {
        font-size: 18px !important;
    }

    .dashboard-operational-link > .bi-arrow-right {
        font-size: 17px !important;
    }
}


/* =========================================================
   RELEASE READINESS — REMOVE EXCESS EMPTY SPACE
   ========================================================= */

/* The readiness panel must size to its actual content instead of stretching
   to match the height of the Recent Activity column. */
.release-readiness-panel,
.readiness-panel {
    height: auto !important;
    min-height: 0 !important;
    align-self: flex-start !important;
}

/* Bootstrap row columns: don't force the left readiness card to fill
   the height of the taller Recent Activity card. */
.row:has(.readiness-gauge) {
    align-items: flex-start !important;
}

.row:has(.readiness-gauge) > [class*="col-"] {
    align-self: flex-start !important;
}

.row:has(.readiness-gauge) .panel {
    min-height: 0 !important;
}

/* Keep only useful spacing under the readiness breakdown. */
.readiness-gauge {
    margin-bottom: 18px !important;
}

.readiness-breakdown {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Specifically prevent h-100 from stretching the readiness card. */
.row:has(.readiness-gauge) .panel.h-100 {
    height: auto !important;
}

/* Desktop/tablet: compact card. */
@media (min-width: 768px) {
    .row:has(.readiness-gauge) .panel {
        height: auto !important;
    }
}


/* =========================================================
   EXECUTIVE REPORT — TOOLBAR + PASS RATE RESPONSIVE FIX
   ========================================================= */
.report-toolbar {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 18px !important;
}

.report-toolbar-actions {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.report-project-filter {
    display: grid !important;
    gap: 5px !important;
    min-width: 300px !important;
}

.report-project-filter > label {
    margin: 0 !important;
    color: var(--qt-muted) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}

.report-project-filter-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.report-project-filter-controls .form-select {
    min-width: 150px !important;
    height: 44px !important;
}

.report-project-filter-controls .btn,
.report-toolbar-actions > .btn {
    min-height: 44px !important;
    white-space: nowrap !important;
}

/* Keep report cover content fully visible on browser screens. */
.report-cover {
    min-width: 0 !important;
    overflow: hidden !important;
}

.report-cover > div:first-child {
    min-width: 0 !important;
}

.report-score {
    flex: 0 0 150px !important;
    width: 150px !important;
    height: 150px !important;
    min-width: 150px !important;
    min-height: 150px !important;
    max-width: 150px !important;
    max-height: 150px !important;
    box-sizing: border-box !important;
    display: grid !important;
    place-content: center !important;
    text-align: center !important;
    border-radius: 50% !important;
    overflow: hidden !important;
}

.report-score strong {
    display: block !important;
    font-size: 38px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.report-score span {
    display: block !important;
    margin-top: 8px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

@media (max-width: 991.98px) {
    .report-toolbar {
        align-items: stretch !important;
    }

    .report-toolbar-actions {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .report-project-filter {
        min-width: 0 !important;
        flex: 1 1 420px !important;
    }
}

@media (max-width: 640px) {
    .report-toolbar-actions,
    .report-project-filter-controls {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .report-project-filter,
    .report-project-filter-controls .form-select,
    .report-project-filter-controls .btn,
    .report-toolbar-actions > .btn {
        width: 100% !important;
        min-width: 0 !important;
    }

    .report-cover {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 22px !important;
    }

    .report-score {
        align-self: center !important;
        flex-basis: 136px !important;
        width: 136px !important;
        height: 136px !important;
        min-width: 136px !important;
        min-height: 136px !important;
        max-width: 136px !important;
        max-height: 136px !important;
    }

    .report-score strong {
        font-size: 34px !important;
    }
}


/* =========================================================
   EXECUTIONS TABLE — ACTION BUTTON ALIGNMENT
   ========================================================= */
.execution-action-cell {
    min-width: 150px !important;
    width: 150px !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.execution-action-buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 126px !important;
    margin: 0 auto !important;
}

.execution-action-buttons .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 126px !important;
    min-width: 126px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.execution-action-buttons .btn i {
    flex: 0 0 auto !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Keep the Action header centered over the buttons. */
table th:last-child {
    text-align: center;
}

@media (max-width: 767.98px) {
    .execution-action-cell {
        width: auto !important;
        min-width: 0 !important;
    }

    .execution-action-buttons {
        width: 100% !important;
        max-width: 220px !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    .execution-action-buttons .btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* =========================================================
   TEST CASES TABLE — ACTION BUTTON ALIGNMENT
   ========================================================= */
.test-case-actions {
    width: 150px !important;
    min-width: 150px !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.test-case-manager-actions,
.qa-test-case-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 126px !important;
    margin: 0 auto !important;
}

.test-case-manager-actions > .btn,
.qa-test-case-actions > .btn,
.test-case-manager-actions > form,
.qa-test-case-actions > form {
    width: 126px !important;
    min-width: 126px !important;
    margin: 0 !important;
}

.test-case-manager-actions > form .btn,
.qa-test-case-actions > form .btn {
    width: 100% !important;
}

.test-case-manager-actions .btn,
.qa-test-case-actions .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 38px !important;
    padding: 7px 10px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.test-case-manager-actions .btn i,
.qa-test-case-actions .btn i {
    flex: 0 0 auto !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Center the Action table heading over the controls. */
.test-case-table th:last-child,
.test-cases-table th:last-child {
    text-align: center !important;
}

@media (max-width: 767.98px) {
    .test-case-actions {
        width: auto !important;
        min-width: 0 !important;
    }

    .test-case-manager-actions,
    .qa-test-case-actions {
        width: 100% !important;
        max-width: 220px !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    .test-case-manager-actions > .btn,
    .qa-test-case-actions > .btn,
    .test-case-manager-actions > form,
    .qa-test-case-actions > form {
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* =========================================================
   TEST CYCLES — ACTION BUTTON ALIGNMENT / OVERLAP FIX
   ========================================================= */
.test-cycle-card-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
}

.test-cycle-manager-actions {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.test-cycle-card-actions > .btn,
.test-cycle-manager-actions > .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-width: 138px !important;
    width: 138px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
}

.test-cycle-card-actions .btn i,
.test-cycle-manager-actions .btn i {
    flex: 0 0 auto !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Prevent Change Status from dropping underneath Edit Cycle on desktop. */
@media (min-width: 768px) {
    .test-cycle-card-actions {
        flex-wrap: nowrap !important;
    }

    .test-cycle-manager-actions {
        flex-wrap: nowrap !important;
    }
}

/* On small screens stack cleanly instead of squeezing or overlapping text. */
@media (max-width: 767.98px) {
    .test-cycle-card-actions,
    .test-cycle-manager-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .test-cycle-card-actions > .btn,
    .test-cycle-manager-actions > .btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* =========================================================
   TEST CYCLES — FINAL 3-BUTTON FIT / NO OVERLAP
   ========================================================= */
@media (min-width: 768px) {
    .test-cycle-card-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Let Edit Cycle + Change Status participate in the same grid */
    .test-cycle-card-actions > .test-cycle-manager-actions {
        display: contents !important;
    }

    .test-cycle-card-actions > .btn,
    .test-cycle-card-actions > .test-cycle-manager-actions > .btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        padding: 7px 8px !important;
        box-sizing: border-box !important;
        font-size: 11px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    .test-cycle-card-actions .btn i {
        flex: 0 0 auto !important;
        margin: 0 !important;
        font-size: 12px !important;
    }
}

/* If the card gets narrower, use 2 columns before text can collide. */
@media (min-width: 768px) and (max-width: 1050px) {
    .test-cycle-card-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .test-cycle-card-actions > .btn:first-child {
        grid-column: 1 / -1 !important;
    }
}

/* Mobile stays stacked */
@media (max-width: 767.98px) {
    .test-cycle-card-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .test-cycle-card-actions > .test-cycle-manager-actions {
        display: contents !important;
    }

    .test-cycle-card-actions > .btn,
    .test-cycle-card-actions > .test-cycle-manager-actions > .btn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}


/* =========================================================
   QA TRACK — ENHANCED LOGIN PAGE
   ========================================================= */
.qa-login-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: #10254a;
    background:
        radial-gradient(circle at 8% 10%, rgba(65,107,233,.11), transparent 30%),
        radial-gradient(circle at 92% 88%, rgba(102,81,223,.10), transparent 28%),
        #f5f7fc;
}

.qa-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
}

.qa-login-brand {
    position: relative;
    display: flex;
    align-items: center;
    padding: clamp(38px, 6vw, 84px);
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(15,39,82,.96), rgba(32,64,136,.94)),
        #10254a;
}

.qa-login-brand::before,
.qa-login-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.qa-login-brand::before {
    width: 430px;
    height: 430px;
    right: -180px;
    top: -160px;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow:
        0 0 0 52px rgba(255,255,255,.025),
        0 0 0 104px rgba(255,255,255,.018);
}

.qa-login-brand::after {
    width: 300px;
    height: 300px;
    left: -150px;
    bottom: -120px;
    background: radial-gradient(circle, rgba(65,107,233,.30), transparent 68%);
}

.qa-login-brand-inner {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    margin: 0 auto;
}

.qa-login-logo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: clamp(42px, 8vh, 84px);
}

.qa-login-logo {
    display: block;
    width: 158px;
    max-height: 76px;
    object-fit: contain;
    object-position: left center;
    border-radius: 12px;
}

.qa-login-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.07);
    backdrop-filter: blur(10px);
    font-size: 11px;
    font-weight: 750;
}

.qa-login-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: #99b7ff;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.qa-login-brand-copy h1 {
    max-width: 620px;
    margin: 0;
    color: #fff;
    font-size: clamp(36px, 5vw, 62px);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -.035em;
}

.qa-login-brand-copy p {
    max-width: 610px;
    margin: 22px 0 0;
    color: rgba(230,237,255,.78);
    font-size: 15px;
    line-height: 1.75;
}

.qa-login-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 13px;
    margin-top: 38px;
}

.qa-login-feature {
    display: flex;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 15px;
    background: rgba(255,255,255,.055);
}

.qa-login-feature > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 11px;
    color: #bcd0ff;
    background: rgba(93,134,235,.16);
    font-size: 16px;
}

.qa-login-feature strong,
.qa-login-feature small {
    display: block;
}

.qa-login-feature strong {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.qa-login-feature small {
    margin-top: 3px;
    color: rgba(225,233,252,.68);
    font-size: 10px;
    line-height: 1.45;
}

.qa-login-form-side {
    display: grid;
    place-items: center;
    padding: clamp(26px, 5vw, 70px);
}

.qa-login-card {
    width: min(470px, 100%);
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid rgba(203,213,225,.72);
    border-radius: 24px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 28px 65px rgba(15,39,82,.12);
    backdrop-filter: blur(14px);
}

.qa-login-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.qa-login-card-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex: 0 0 50px;
    border-radius: 15px;
    color: #3867e8;
    background: #edf3ff;
    font-size: 21px;
}

.qa-login-welcome-label {
    display: block;
    margin-bottom: 2px;
    color: #3867e8;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.qa-login-card-header h2 {
    margin: 0;
    color: #10254a;
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -.025em;
}

.qa-login-card-header p {
    margin: 4px 0 0;
    color: #71809a;
    font-size: 12px;
}

.qa-login-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.45;
}

.qa-login-form {
    display: grid;
    gap: 18px;
}

.qa-login-field label {
    display: block;
    margin-bottom: 7px;
    color: #243b63;
    font-size: 11px;
    font-weight: 800;
}

.qa-login-required {
    color: #dc3545;
}

.qa-login-password-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qa-login-password-label a {
    color: #3867e8;
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
}

.qa-login-password-label a:hover {
    text-decoration: underline;
}

.qa-login-input {
    position: relative;
    display: flex;
    align-items: center;
}

.qa-login-input > i {
    position: absolute;
    left: 14px;
    z-index: 2;
    color: #71809a;
    font-size: 15px;
    pointer-events: none;
}

.qa-login-input .form-control {
    width: 100%;
    height: 50px;
    padding: 0 46px 0 42px;
    border: 1px solid #d6deeb;
    border-radius: 13px;
    color: #10254a;
    background: #fbfcff;
    font-size: 13px;
    box-shadow: none;
}

.qa-login-input .form-control::placeholder {
    color: #9aa7bb;
}

.qa-login-input .form-control:focus {
    border-color: #6f93f2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(65,107,233,.10);
}

.qa-login-password-toggle {
    position: absolute;
    right: 8px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    z-index: 3;
    border: 0;
    border-radius: 9px;
    color: #66758a;
    background: transparent;
    font-size: 15px;
}

.qa-login-password-toggle:hover {
    color: #3867e8;
    background: #eef3ff;
}

.qa-login-caps-warning {
    margin-top: 7px;
    color: #a15c00;
    font-size: 10px;
    font-weight: 700;
}

.qa-login-caps-warning i {
    margin-right: 4px;
}

.qa-login-submit {
    min-height: 50px;
    margin-top: 2px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #416be9, #574ee1);
    box-shadow: 0 10px 22px rgba(65,107,233,.24);
    font-size: 13px;
    font-weight: 850;
}

.qa-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 13px 27px rgba(65,107,233,.29);
}

.qa-login-submit:disabled {
    opacity: .82;
    transform: none;
}

.qa-login-submit-normal,
.qa-login-submit-progress {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.qa-login-security-note {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding: 13px 14px;
    border: 1px solid #e0e7f2;
    border-radius: 13px;
    background: #f7f9fd;
}

.qa-login-security-note > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border-radius: 10px;
    color: #3867e8;
    background: #eaf0ff;
}

.qa-login-security-note strong,
.qa-login-security-note small {
    display: block;
}

.qa-login-security-note strong {
    color: #243b63;
    font-size: 10px;
    font-weight: 800;
}

.qa-login-security-note small {
    margin-top: 3px;
    color: #71809a;
    font-size: 9px;
    line-height: 1.45;
}

.qa-login-footer {
    margin-top: 22px;
    color: #93a0b5;
    text-align: center;
    font-size: 9px;
}

/* Prevent the old auth styles from constraining the new login. */
.qa-login-page .auth-shell,
.qa-login-page .auth-card,
.qa-login-page .auth-brand-panel,
.qa-login-page .auth-form-panel {
    all: unset;
}

@media (max-width: 1040px) {
    .qa-login-shell {
        grid-template-columns: minmax(0, .9fr) minmax(400px, 1.1fr);
    }

    .qa-login-brand {
        padding: 44px 34px;
    }

    .qa-login-feature-grid {
        grid-template-columns: 1fr;
    }

    .qa-login-brand-copy h1 {
        font-size: 42px;
    }
}

@media (max-width: 800px) {
    .qa-login-shell {
        display: block;
        min-height: 100vh;
    }

    .qa-login-brand {
        min-height: auto;
        padding: 28px 22px 46px;
    }

    .qa-login-logo-row {
        margin-bottom: 32px;
    }

    .qa-login-logo {
        width: 130px;
    }

    .qa-login-security-badge {
        padding: 7px 9px;
        font-size: 9px;
    }

    .qa-login-brand-copy h1 {
        font-size: 34px;
    }

    .qa-login-brand-copy p {
        font-size: 13px;
    }

    .qa-login-feature-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        margin-top: 28px;
    }

    .qa-login-form-side {
        margin-top: -20px;
        padding: 0 16px 30px;
        position: relative;
        z-index: 3;
    }

    .qa-login-card {
        width: min(560px, 100%);
        border-radius: 21px;
    }
}

@media (max-width: 560px) {
    .qa-login-brand {
        padding: 20px 16px 40px;
    }

    .qa-login-logo-row {
        align-items: flex-start;
        gap: 10px;
    }

    .qa-login-logo {
        width: 112px;
    }

    .qa-login-security-badge {
        max-width: 145px;
        white-space: normal;
        line-height: 1.3;
    }

    .qa-login-brand-copy h1 {
        font-size: 29px;
    }

    .qa-login-feature-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .qa-login-feature {
        padding: 12px;
    }

    .qa-login-form-side {
        padding-left: 10px;
        padding-right: 10px;
    }

    .qa-login-card {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .qa-login-card-header {
        align-items: flex-start;
    }

    .qa-login-card-header h2 {
        font-size: 21px;
    }

    .qa-login-input .form-control {
        height: 48px;
        font-size: 14px;
    }

    .qa-login-submit {
        min-height: 48px;
    }
}


/* =========================================================
   QA TRACK — PROFILE DROPDOWN + LOGOUT MODAL
   ========================================================= */

.profile-dropdown-menu .profile-dropdown-item {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    text-align: left;
    text-decoration: none;
    box-sizing: border-box;
}

.profile-dropdown-menu button.profile-dropdown-item {
    font: inherit;
    cursor: pointer;
}

.profile-dropdown-menu .profile-dropdown-item > i {
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
    font-size: 16px;
}

.profile-dropdown-logout {
    color: #c92a3b !important;
    background: #fff1f3 !important;
    border-radius: 11px !important;
}

.profile-dropdown-logout:hover,
.profile-dropdown-logout:focus {
    color: #a8182a !important;
    background: #ffe7eb !important;
}

.role-pill {
    max-width: 112px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Logout modal */
.qa-logout-modal[hidden] {
    display: none !important;
}

.qa-logout-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, visibility .16s ease;
}

.qa-logout-modal.show {
    opacity: 1;
    visibility: visible;
}

.qa-logout-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(3px);
}

.qa-logout-dialog {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    padding: 28px;
    border: 1px solid rgba(203, 213, 225, .75);
    border-radius: 22px;
    background: var(--qt-surface, #fff);
    box-shadow: 0 26px 70px rgba(15, 23, 42, .24);
    transform: translateY(8px) scale(.985);
    transition: transform .16s ease;
}

.qa-logout-modal.show .qa-logout-dialog {
    transform: none;
}

.qa-logout-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 16px;
    color: #c92a3b;
    background: #fff0f2;
    font-size: 23px;
}

.qa-logout-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #c92a3b;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.qa-logout-copy h2 {
    margin: 0;
    color: var(--qt-text, #10254a);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.02em;
}

.qa-logout-copy p {
    margin: 9px 0 0;
    color: var(--qt-muted, #71809a);
    font-size: 12px;
    line-height: 1.55;
}

.qa-logout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
}

.qa-logout-actions .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
}

.qa-logout-confirm {
    color: #fff !important;
    background: #d6394c !important;
    border-color: #d6394c !important;
}

.qa-logout-confirm:hover,
.qa-logout-confirm:focus {
    background: #bd2639 !important;
    border-color: #bd2639 !important;
}

body.qa-logout-modal-open {
    overflow: hidden !important;
}

@media (max-width: 520px) {
    .qa-logout-modal {
        padding: 14px;
    }

    .qa-logout-dialog {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .qa-logout-actions {
        grid-template-columns: 1fr;
    }

    .qa-logout-copy h2 {
        font-size: 20px;
    }
}


/* =========================================================
   QA TRACK — CHANGE PASSWORD
   ========================================================= */
.qa-password-page {
    min-height: 100vh;
    margin: 0;
    color: #10254a;
    background:
        radial-gradient(circle at 12% 12%, rgba(65,107,233,.12), transparent 30%),
        radial-gradient(circle at 88% 88%, rgba(87,78,225,.10), transparent 28%),
        #f4f7fc;
}

.qa-password-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 34px 18px;
}

.qa-password-card {
    width: min(620px, 100%);
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid #dce4f0;
    border-radius: 24px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 28px 70px rgba(15,39,82,.13);
}

.qa-password-heading {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 26px;
}

.qa-password-heading-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 54px;
    border-radius: 16px;
    color: #3867e8;
    background: #edf3ff;
    font-size: 23px;
}

.qa-password-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #3867e8;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.qa-password-heading h1 {
    margin: 0;
    color: #10254a;
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -.025em;
}

.qa-password-heading p {
    margin: 6px 0 0;
    color: #71809a;
    font-size: 12px;
    line-height: 1.55;
}

.qa-password-alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-bottom: 20px;
    border-radius: 12px;
    font-size: 11px;
}

.qa-password-form {
    display: grid;
    gap: 21px;
}

.qa-password-field > label {
    display: block;
    margin-bottom: 7px;
    color: #243b63;
    font-size: 11px;
    font-weight: 800;
}

.qa-password-field > label span {
    color: #dc3545;
}

.qa-password-input {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 13px;
}

.qa-password-input > i {
    position: absolute;
    left: 14px;
    z-index: 2;
    color: #71809a;
    font-size: 15px;
    pointer-events: none;
}

.qa-password-input .form-control {
    height: 50px;
    padding: 0 48px 0 42px;
    border: 1px solid #d6deeb;
    border-radius: 13px;
    color: #10254a;
    background: #fbfcff;
    font-size: 13px;
    box-shadow: none;
}

.qa-password-input .form-control:focus {
    border-color: #6f93f2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(65,107,233,.10);
}

.qa-password-input.has-error .form-control {
    border-color: #e25a69;
    box-shadow: 0 0 0 3px rgba(226,90,105,.08);
}

.qa-password-input.has-success .form-control {
    border-color: #31a56b;
}

.qa-password-eye {
    position: absolute;
    right: 8px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #66758a;
    background: transparent;
    font-size: 15px;
}

.qa-password-eye:hover {
    color: #3867e8;
    background: #eef3ff;
}

.qa-password-strength {
    margin-top: 11px;
}

.qa-password-strength-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: #71809a;
    font-size: 9px;
    font-weight: 700;
}

.qa-password-strength-head strong {
    color: #465b7c;
}

.qa-password-strength-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eef6;
}

.qa-password-strength-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #d9e0eb;
    transition: width .18s ease;
}

.qa-password-strength-track span.weak {
    background: #df4c5f;
}

.qa-password-strength-track span.fair {
    background: #e4a62b;
}

.qa-password-strength-track span.good {
    background: #4e86e8;
}

.qa-password-strength-track span.strong {
    background: #31a56b;
}

.qa-password-rules {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px 14px;
    margin-top: 12px;
    padding: 13px 14px;
    border: 1px solid #e2e8f2;
    border-radius: 12px;
    background: #f8fafe;
}

.qa-password-rules > div {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #77859a;
    font-size: 9px;
    line-height: 1.35;
}

.qa-password-rules > div i {
    flex: 0 0 auto;
    color: #a8b3c4;
}

.qa-password-rules > div.passed {
    color: #237b50;
    font-weight: 700;
}

.qa-password-rules > div.passed i {
    color: #31a56b;
}

.qa-password-match {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: 10px;
    font-weight: 700;
}

.qa-password-match.success {
    color: #237b50;
}

.qa-password-match.error {
    color: #c92a3b;
}

.qa-password-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 3px;
}

.qa-password-actions .btn {
    min-width: 145px;
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
}

.qa-password-actions .btn-primary {
    background: linear-gradient(135deg,#416be9,#574ee1);
    border: 0;
    box-shadow: 0 9px 20px rgba(65,107,233,.20);
}

.qa-password-actions .btn:disabled {
    opacity: .48;
    box-shadow: none;
}

.qa-password-security-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 24px;
    padding-top: 17px;
    border-top: 1px solid #e6ebf3;
    color: #7b889c;
}

.qa-password-security-note i {
    margin-top: 1px;
    color: #5679d9;
}

.qa-password-security-note p {
    margin: 0;
    font-size: 9px;
    line-height: 1.5;
}

/* Successful change */
.qa-password-success {
    padding: 18px 4px 8px;
    text-align: center;
}

.qa-password-success-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 17px;
    border-radius: 22px;
    color: #237b50;
    background: #e9f8f0;
    font-size: 30px;
}

.qa-password-success > span {
    color: #31a56b;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.qa-password-success h1 {
    margin: 6px 0 0;
    color: #10254a;
    font-size: 26px;
    font-weight: 900;
}

.qa-password-success p {
    max-width: 440px;
    margin: 11px auto 22px;
    color: #71809a;
    font-size: 12px;
    line-height: 1.6;
}

.qa-password-success-btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 22px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg,#416be9,#574ee1);
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 560px) {
    .qa-password-shell {
        padding: 14px 10px;
        align-items: start;
    }

    .qa-password-card {
        margin-top: 12px;
        padding: 22px 17px;
        border-radius: 18px;
    }

    .qa-password-heading h1 {
        font-size: 21px;
    }

    .qa-password-rules {
        grid-template-columns: 1fr;
    }

    .qa-password-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .qa-password-actions .btn {
        width: 100%;
    }
}

.qa-reset-modal[hidden]{display:none!important}
.qa-reset-modal{position:fixed;inset:0;z-index:3100;display:grid;place-items:center;padding:20px;opacity:0;visibility:hidden;transition:.16s}
.qa-reset-modal.show{opacity:1;visibility:visible}
.qa-reset-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(3px)}
.qa-reset-dialog{position:relative;z-index:1;width:min(450px,100%);padding:28px;border:1px solid rgba(203,213,225,.75);border-radius:22px;background:var(--qt-surface,#fff);box-shadow:0 26px 70px rgba(15,23,42,.24);transform:translateY(8px) scale(.985);transition:.16s}
.qa-reset-modal.show .qa-reset-dialog{transform:none}
.qa-reset-icon{width:54px;height:54px;display:grid;place-items:center;margin-bottom:18px;border-radius:16px;color:#c92a3b;background:#fff0f2;font-size:22px}
.qa-reset-eyebrow{display:block;margin-bottom:5px;color:#c92a3b;font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.qa-reset-copy h2{margin:0;color:var(--qt-text,#10254a);font-size:22px;font-weight:900}
.qa-reset-copy p{margin:9px 0 0;color:var(--qt-muted,#71809a);font-size:12px;line-height:1.55}
.qa-reset-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:24px}
.qa-reset-actions .btn{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:11px;font-size:12px;font-weight:800}
.qa-reset-confirm{color:#fff!important;background:#d6394c!important;border-color:#d6394c!important}
.qa-reset-confirm:hover{background:#bd2639!important;border-color:#bd2639!important}
body.qa-reset-modal-open{overflow:hidden!important}
@media(max-width:520px){.qa-reset-actions{grid-template-columns:1fr}.qa-reset-dialog{padding:22px 18px;border-radius:18px}}


/* =========================================================
   TEST CASE EXCEL IMPORT / EXPORT
   ========================================================= */
.testcase-excel-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 12px;
}

.testcase-import-preview-badge {
    padding: 6px 9px;
    border-radius: 999px;
    color: #315ed8;
    background: #eaf0ff;
    font-size: 9px;
    font-weight: 850;
}

.testcase-import-stats {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 10px;
    margin: 14px 0;
}

.testcase-import-stats > div {
    padding: 13px;
    border: 1px solid var(--qt-border);
    border-radius: 12px;
    background: var(--qt-surface-soft);
}

.testcase-import-stats span,
.testcase-import-stats strong {
    display: block;
}

.testcase-import-stats span {
    color: var(--qt-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.testcase-import-stats strong {
    margin-top: 3px;
    font-size: 22px;
}

.testcase-import-stats .valid strong { color: #23835a; }
.testcase-import-stats .warning strong { color: #a56c00; }
.testcase-import-stats .error strong { color: #c92a3b; }

.testcase-import-issues {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.testcase-import-issue {
    display: grid;
    grid-template-columns: 70px minmax(0,1fr);
    gap: 2px 10px;
    padding: 10px 12px;
    border: 1px solid var(--qt-border);
    border-radius: 11px;
    background: var(--qt-surface-soft);
}

.testcase-import-issue strong {
    grid-row: span 2;
    font-size: 11px;
}

.testcase-import-issue span {
    font-size: 11px;
    font-weight: 750;
}

.testcase-import-issue p {
    margin: 1px 0 0;
    color: var(--qt-muted);
    font-size: 10px;
}

.testcase-import-issue.error {
    border-left: 3px solid #d84b5d;
}

.testcase-import-issue.warning {
    border-left: 3px solid #d39a24;
}

.testcase-import-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 16px;
}

.testcase-import-preview-actions form {
    margin: 0;
}

.testcase-import-guidance {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe5ff;
    border-radius: 12px;
    color: #315ed8;
    background: #f4f7ff;
}

.testcase-import-guidance i {
    margin-top: 2px;
}

.testcase-import-guidance strong,
.testcase-import-guidance span {
    display: block;
}

.testcase-import-guidance strong {
    font-size: 11px;
}

.testcase-import-guidance span {
    margin-top: 3px;
    color: #63769a;
    font-size: 10px;
    line-height: 1.45;
}

@media (max-width: 767.98px) {
    .testcase-import-stats {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .testcase-import-preview-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .testcase-import-preview-actions form,
    .testcase-import-preview-actions .btn {
        width: 100%;
    }
}

/* =========================================================
   TEST CASE BULK SUBMIT
   ========================================================= */
.testcase-page-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex-wrap:wrap;
    gap:9px;
}
.testcase-bulk-count{
    min-width:22px;
    height:22px;
    display:inline-grid;
    place-items:center;
    margin-left:4px;
    padding:0 6px;
    border-radius:999px;
    color:#315ed8;
    background:#eaf0ff;
    font-size:9px;
    font-weight:850;
}
.qa-bulk-submit-modal[hidden]{display:none!important}
.qa-bulk-submit-modal{
    position:fixed;
    inset:0;
    z-index:3150;
    display:grid;
    place-items:center;
    padding:20px;
    opacity:0;
    visibility:hidden;
    transition:.16s;
}
.qa-bulk-submit-modal.show{opacity:1;visibility:visible}
.qa-bulk-submit-backdrop{
    position:absolute;
    inset:0;
    background:rgba(15,23,42,.48);
    backdrop-filter:blur(3px);
}
.qa-bulk-submit-dialog{
    position:relative;
    z-index:1;
    width:min(480px,100%);
    padding:28px;
    border:1px solid rgba(203,213,225,.75);
    border-radius:22px;
    background:var(--qt-surface,#fff);
    box-shadow:0 26px 70px rgba(15,23,42,.24);
    transform:translateY(8px) scale(.985);
    transition:.16s;
}
.qa-bulk-submit-modal.show .qa-bulk-submit-dialog{transform:none}
.qa-bulk-submit-icon{
    width:54px;height:54px;display:grid;place-items:center;
    margin-bottom:18px;border-radius:16px;
    color:#315ed8;background:#eaf0ff;font-size:22px;
}
.qa-bulk-submit-eyebrow{
    display:block;margin-bottom:5px;color:#315ed8;
    font-size:10px;font-weight:850;letter-spacing:.08em;
    text-transform:uppercase;
}
.qa-bulk-submit-copy h2{
    margin:0;color:var(--qt-text,#10254a);
    font-size:22px;font-weight:900;
}
.qa-bulk-submit-copy p{
    margin:9px 0 0;color:var(--qt-muted,#71809a);
    font-size:12px;line-height:1.6;
}
.qa-bulk-submit-note{
    display:flex;align-items:flex-start;gap:8px;
    margin-top:15px;padding:11px 12px;
    border:1px solid #dce5f5;border-radius:11px;
    color:#5f7090;background:#f7f9fd;
    font-size:10px;line-height:1.45;
}
.qa-bulk-submit-actions{
    display:grid;grid-template-columns:1fr 1fr;
    gap:10px;margin-top:24px;
}
.qa-bulk-submit-actions form{margin:0}
.qa-bulk-submit-actions .btn{
    width:100%;min-height:44px;
    display:inline-flex;align-items:center;justify-content:center;
    gap:7px;border-radius:11px;font-size:11px;font-weight:800;
}
body.qa-bulk-submit-open{overflow:hidden!important}
@media(max-width:700px){
    .testcase-page-actions{width:100%;display:grid;grid-template-columns:1fr}
    .testcase-page-actions .btn{width:100%}
    .qa-bulk-submit-actions{grid-template-columns:1fr}
    .qa-bulk-submit-dialog{padding:22px 18px;border-radius:18px}
}


/* =========================================================
   STORY-BASED TEST CASE SUBMIT / EXPORT
   ========================================================= */
.qa-bulk-submit-dialog-wide{
    width:min(720px,100%);
    max-height:min(760px,calc(100vh - 36px));
    overflow:auto;
}
.qa-bulk-submit-modal-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:18px;
}
.qa-bulk-submit-modal-head h2{margin:2px 0 0}
.qa-bulk-submit-modal-head p{
    margin:7px 0 0;
    color:var(--qt-muted,#71809a);
    font-size:11px;
}
.qa-bulk-submit-x{
    width:36px;height:36px;display:grid;place-items:center;
    flex:0 0 auto;border:0;border-radius:10px;
    color:#64748b;background:#f3f6fb;
}
.qa-story-select-wrap label{
    display:block;margin-bottom:6px;
    color:var(--qt-text,#10254a);
    font-size:10px;font-weight:850;
}
.qa-story-case-empty{
    min-height:190px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:5px;
    margin-top:14px;
    border:1px dashed #d6deed;
    border-radius:14px;
    color:#7b89a3;
    background:#fafbfe;
    text-align:center;
}
.qa-story-case-empty[hidden]{display:none!important}
.qa-story-case-empty i{font-size:25px;color:#4c6ef5}
.qa-story-case-empty strong{font-size:12px;color:#34435e}
.qa-story-case-empty span{font-size:10px}
.qa-story-case-group{
    margin-top:14px;
    border:1px solid #dfe5ef;
    border-radius:14px;
    overflow:hidden;
}
.qa-story-case-group[hidden]{display:none!important}
.qa-story-case-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 14px;
    background:#f7f9fd;
    border-bottom:1px solid #e4e9f2;
}
.qa-story-case-toolbar strong,
.qa-story-case-toolbar span{display:block}
.qa-story-case-toolbar strong{font-size:11px;color:#315ed8}
.qa-story-case-toolbar span{margin-top:2px;font-size:10px;color:#6d7c97}
.qa-select-all-label{
    display:flex;align-items:center;gap:7px;
    margin:0;white-space:nowrap;
    font-size:10px;font-weight:800;color:#43516a;
}
.qa-story-case-list{
    max-height:290px;
    overflow:auto;
}
.qa-story-case-row{
    display:grid;
    grid-template-columns:22px 72px minmax(0,1fr);
    align-items:center;
    gap:9px;
    margin:0;
    padding:11px 14px;
    border-bottom:1px solid #edf0f5;
    cursor:pointer;
}
.qa-story-case-row:last-child{border-bottom:0}
.qa-story-case-row:hover{background:#fbfcff}
.qa-story-case-id{
    color:#315ed8;
    font-size:10px;
    font-weight:850;
}
.qa-story-case-title{
    color:#1c2e4f;
    font-size:11px;
    font-weight:750;
}
.qa-story-case-title small{
    display:block;
    margin-top:2px;
    color:#7a89a2;
    font-size:9px;
    font-weight:650;
}
.qa-bulk-submit-summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-top:13px;
    padding:10px 12px;
    border-radius:10px;
    color:#62728e;
    background:#f6f8fc;
    font-size:10px;
}
.testcase-export-note{
    display:flex;
    align-items:flex-start;
    gap:8px;
    margin-top:12px;
    padding:11px 12px;
    border:1px solid #dce5f5;
    border-radius:11px;
    color:#61718c;
    background:#f7f9fd;
    font-size:10px;
    line-height:1.45;
}
@media(max-width:640px){
    .qa-story-case-row{
        grid-template-columns:22px minmax(0,1fr);
    }
    .qa-story-case-id{
        grid-column:2;
    }
    .qa-story-case-title{
        grid-column:2;
    }
    .qa-bulk-submit-summary{
        align-items:flex-start;
        flex-direction:column;
    }
}
/* Test Manager story-based bulk review */
.review-bulk-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.review-bulk-bar>div:first-child{display:flex;flex-direction:column;gap:2px}.review-bulk-bar strong{font-size:13px;color:#172b4d}.review-bulk-bar small{font-size:10px;color:#71809a}.review-bulk-actions{display:flex;gap:8px;flex-wrap:wrap}.review-check-col{width:42px}.review-story-divider td{padding:10px 14px!important;background:#f5f8ff!important;color:#315ed8!important;border-top:1px solid #dce5f5!important;border-bottom:1px solid #dce5f5!important;font-size:11px}.review-story-divider span{margin-left:7px;color:#71809a;font-weight:600}.review-select-table td,.review-select-table th{vertical-align:middle}.review-select-table .form-check-input{width:17px;height:17px;cursor:pointer}@media(max-width:900px){.review-bulk-bar{align-items:stretch}.review-bulk-actions{display:grid;grid-template-columns:1fr}.review-bulk-actions .btn{width:100%}}


/* =========================================================
   TEST PLAN CARD — ACTION BUTTON ALIGNMENT FIX
   Prevent Edit / Change Status overlap
   ========================================================= */

/* Covers the action row immediately following Test Plan Information. */
.test-plan-card .card-actions,
.test-plan-card .plan-actions,
.test-plan-card .action-buttons,
.test-plan-actions,
.plan-card .card-actions,
.plan-card .plan-actions,
.plan-card .action-buttons {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
}

.test-plan-card .card-actions .btn,
.test-plan-card .plan-actions .btn,
.test-plan-card .action-buttons .btn,
.test-plan-actions .btn,
.plan-card .card-actions .btn,
.plan-card .plan-actions .btn,
.plan-card .action-buttons .btn {
    position: static !important;
    float: none !important;
    transform: none !important;
    margin: 0 !important;
    min-width: 118px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    white-space: nowrap !important;
}

/* Fallback for cards where the three controls are direct siblings. */
.test-plan-card .btn + .btn,
.plan-card .btn + .btn {
    margin-left: 0 !important;
}

@media (max-width: 560px) {
    .test-plan-card .card-actions,
    .test-plan-card .plan-actions,
    .test-plan-card .action-buttons,
    .test-plan-actions,
    .plan-card .card-actions,
    .plan-card .plan-actions,
    .plan-card .action-buttons {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .test-plan-card .card-actions .btn,
    .test-plan-card .plan-actions .btn,
    .test-plan-card .action-buttons .btn,
    .test-plan-actions .btn,
    .plan-card .card-actions .btn,
    .plan-card .plan-actions .btn,
    .plan-card .action-buttons .btn {
        width: 100% !important;
    }
}


/* Test Plan actions — mirror User Stories card action row */
.test-plan-card-actions.user-story-card-actions-modern {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: 100% !important;
}

.test-plan-card-actions.user-story-card-actions-modern > .btn {
    position: static !important;
    float: none !important;
    transform: none !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 9px 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

.test-plan-card-actions.user-story-card-actions-modern > .btn:first-child {
    margin-right: auto !important;
}

@media (max-width: 640px) {
    .test-plan-card-actions.user-story-card-actions-modern {
        flex-wrap: wrap !important;
    }

    .test-plan-card-actions.user-story-card-actions-modern > .btn:first-child {
        margin-right: 0 !important;
    }

    .test-plan-card-actions.user-story-card-actions-modern > .btn {
        flex: 1 1 calc(50% - 5px) !important;
    }

    .test-plan-card-actions.user-story-card-actions-modern > .btn:last-child {
        flex-basis: 100% !important;
    }
}


/* Automation Tracker — dedicated Action column */
.automation-action-heading {
    width: 110px;
    text-align: center !important;
}
.automation-action-cell {
    width: 110px;
    text-align: center;
    vertical-align: middle !important;
}
.automation-action-cell .automation-edit-draft {
    min-width: 78px;
    justify-content: center;
}
.automation-action-na {
    color: #9aa7bc;
}

/* Multiple QA Testers per User Story */
.user-story-qa-names{display:block;margin-top:3px;max-width:360px;color:#6b7b96;font-size:9px;font-weight:600;line-height:1.35}
.user-story-multi-qa-list{display:flex;flex-direction:column;gap:8px;max-height:310px;overflow:auto;padding:3px}
.user-story-qa-option{display:flex;align-items:center;gap:11px;margin:0;padding:11px 12px;border:1px solid #dfe5ef;border-radius:11px;background:#fff;cursor:pointer}
.user-story-qa-option:hover{background:#f7f9ff;border-color:#b9c9ff}
.user-story-qa-option input{width:17px;height:17px;flex:0 0 auto}
.user-story-qa-option span{display:flex;flex-direction:column;gap:1px}
.user-story-qa-option strong{font-size:11px;color:#1b2d4d}
.user-story-qa-option small{font-size:9px;color:#7b89a3}


/* =========================================================
   USER STORIES — ACTION BUTTONS
   ========================================================= */
.user-story-card-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    padding-top: 14px !important;
    margin-top: 10px !important;
    border-top: 1px solid #e6ebf3 !important;
}

.user-story-card-actions .story-action-form {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex: 0 0 auto !important;
}

.story-action-btn {
    position: static !important;
    float: none !important;
    transform: none !important;
    margin: 0 !important;
    min-height: 40px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border-radius: 9px !important;
    border: 1px solid transparent !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    cursor: pointer;
    font-family: inherit !important;
    box-sizing: border-box !important;
    transition:
        background-color .16s ease,
        border-color .16s ease,
        color .16s ease,
        box-shadow .16s ease !important;
}

.story-action-btn i {
    flex: 0 0 auto !important;
    font-size: 12px !important;
}

.story-btn-view {
    background: #ffffff !important;
    border-color: #6f8fff !important;
    color: #3563e9 !important;
}

.story-btn-view:hover {
    background: #f4f7ff !important;
    border-color: #3563e9 !important;
    color: #2454db !important;
}

.story-btn-assign {
    background: #3563e9 !important;
    border-color: #3563e9 !important;
    color: #ffffff !important;
    box-shadow: 0 5px 12px rgba(53,99,233,.16) !important;
}

.story-btn-assign:hover {
    background: #2955d8 !important;
    border-color: #2955d8 !important;
}

.story-btn-assigned {
    background: #effaf3 !important;
    border-color: #91d2aa !important;
    color: #16834a !important;
    cursor: default !important;
}

.story-btn-unassign {
    background: #ffffff !important;
    border-color: #f0a4ad !important;
    color: #dc3545 !important;
}

.story-btn-unassign:hover {
    background: #fff3f4 !important;
    border-color: #dc3545 !important;
}

.story-btn-manage {
    background: #ffffff !important;
    border-color: #94a3b8 !important;
    color: #475569 !important;
}

.story-btn-manage:hover {
    background: #f8fafc !important;
    border-color: #64748b !important;
}

.story-btn-edit {
    background: #3563e9 !important;
    border-color: #3563e9 !important;
    color: #ffffff !important;
}

.story-btn-edit:hover {
    background: #2955d8 !important;
    border-color: #2955d8 !important;
}

.user-story-card-modern,
.user-story-card-modern * {
    box-sizing: border-box;
}

.user-story-card-actions > * {
    min-width: 0 !important;
}

@media (max-width: 1180px) {
    .story-action-btn {
        padding-left: 11px !important;
        padding-right: 11px !important;
        font-size: 10px !important;
    }
}

@media (max-width: 640px) {
    .user-story-card-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .user-story-card-actions .story-action-form {
        width: 100% !important;
    }

    .story-action-btn {
        width: 100% !important;
        min-height: 42px !important;
    }
}


/* =========================================================
   USER STORIES — FINAL ACTION BAR FIX
   One clean row, no duplicate/stacked buttons.
   ========================================================= */
.user-story-card-modern .user-story-card-actions {
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 14px 0 0 !important;
    border-top: 1px solid #e6ebf3 !important;
}

.user-story-card-modern .user-story-card-actions > .story-action-btn,
.user-story-card-modern .user-story-card-actions > .story-action-form {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
}

.user-story-card-modern .user-story-card-actions .story-action-form {
    display: flex !important;
    width: auto !important;
    padding: 0 !important;
}

.user-story-card-modern .user-story-card-actions .story-action-form .story-action-btn {
    width: 100% !important;
    flex: 1 1 auto !important;
}

.user-story-card-modern .story-action-btn {
    min-width: 0 !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 9px !important;
    margin: 0 !important;
    border-radius: 9px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;

    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;

    position: static !important;
    float: none !important;
    transform: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.user-story-card-modern .story-action-btn span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.user-story-card-modern .story-action-btn i {
    flex: 0 0 auto !important;
    margin: 0 !important;
}

/* Assigned state is informational, not clickable. */
.user-story-card-modern .story-btn-assigned {
    pointer-events: none !important;
}

/* Remove legacy action-area spacing that caused the second row. */
.user-story-card-modern .user-story-card-actions-modern {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Tablet: retain a single row but slightly tighten text. */
@media (max-width: 1100px) {
    .user-story-card-modern .story-action-btn {
        padding-left: 7px !important;
        padding-right: 7px !important;
        font-size: 9px !important;
    }
}

/* Mobile: stack only when the card is genuinely narrow. */
@media (max-width: 560px) {
    .user-story-card-modern .user-story-card-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .user-story-card-modern .user-story-card-actions > .story-action-btn,
    .user-story-card-modern .user-story-card-actions > .story-action-form {
        width: 100% !important;
    }

    .user-story-card-modern .story-action-btn {
        width: 100% !important;
        font-size: 11px !important;
    }
}


/* =========================================================
   USER STORY — BRANDED ASSIGN / UNASSIGN CONFIRMATION
   ========================================================= */
.qa-story-confirm[hidden] {
    display: none !important;
}

.qa-story-confirm {
    position: fixed;
    inset: 0;
    z-index: 3400;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, visibility .16s ease;
}

.qa-story-confirm.show {
    opacity: 1;
    visibility: visible;
}

.qa-story-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(3px);
}

.qa-story-confirm-dialog {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    padding: 28px;
    border: 1px solid rgba(203, 213, 225, .85);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .25);
    transform: translateY(9px) scale(.985);
    transition: transform .16s ease;
}

.qa-story-confirm.show .qa-story-confirm-dialog {
    transform: none;
}

.qa-story-confirm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #718096;
    background: #f4f6fa;
}

.qa-story-confirm-close:hover {
    background: #e9edf4;
    color: #334155;
}

.qa-story-confirm-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 17px;
    border-radius: 16px;
    color: #315ed8;
    background: #eaf0ff;
    font-size: 23px;
}

.qa-story-confirm-icon.danger {
    color: #d9364f;
    background: #fff0f2;
}

.qa-story-confirm-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #315ed8;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .09em;
}

.qa-story-confirm-copy h2 {
    margin: 0;
    color: #14233f;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.25;
}

.qa-story-confirm-copy > p {
    margin: 9px 0 0;
    color: #71809a;
    font-size: 11px;
    line-height: 1.55;
}

.qa-story-confirm-story {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 16px;
    padding: 12px 13px;
    border: 1px solid #e1e7f0;
    border-radius: 11px;
    background: #f8faff;
}

.qa-story-confirm-story strong {
    color: #315ed8;
    font-size: 10px;
}

.qa-story-confirm-story span {
    color: #263b5e;
    font-size: 11px;
    font-weight: 750;
}

.qa-story-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}

.qa-story-confirm-actions .btn {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}

body.qa-story-confirm-open {
    overflow: hidden !important;
}

@media (max-width: 520px) {
    .qa-story-confirm-dialog {
        padding: 23px 18px;
        border-radius: 18px;
    }

    .qa-story-confirm-actions {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   AUTOMATION TRACKER — REPOSITORY ACTIONS
   ========================================================= */
.automation-action-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 94px;
}

.automation-action-stack .automation-edit-draft,
.automation-repo-btn {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}

.automation-repo-open {
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #fff;
}

.automation-repo-open:hover {
    border-color: #64748b;
    color: #0f172a;
    background: #f8fafc;
}

.automation-repo-sync-form {
    margin: 0;
    padding: 0;
}

.automation-repo-sync {
    border: 1px solid #3563e9;
    color: #3563e9;
    background: #f7f9ff;
}

.automation-repo-sync:hover {
    color: #fff;
    background: #3563e9;
}

/* Repository confirmation modal */
.qa-repo-confirm[hidden] { display: none !important; }

.qa-repo-confirm {
    position: fixed;
    inset: 0;
    z-index: 3600;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, visibility .16s ease;
}

.qa-repo-confirm.show {
    opacity: 1;
    visibility: visible;
}

.qa-repo-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.52);
    backdrop-filter: blur(3px);
}

.qa-repo-confirm-dialog {
    position: relative;
    z-index: 1;
    width: min(470px,100%);
    padding: 28px;
    border: 1px solid #dbe3ef;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15,23,42,.25);
    transform: translateY(8px) scale(.985);
    transition: transform .16s ease;
}

.qa-repo-confirm.show .qa-repo-confirm-dialog {
    transform: none;
}

.qa-repo-confirm-x {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #718096;
    background: #f3f6fa;
}

.qa-repo-confirm-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 17px;
    border-radius: 16px;
    color: #fff;
    background: #111827;
    font-size: 24px;
}

.qa-repo-confirm-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #315ed8;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .09em;
}

.qa-repo-confirm-dialog h2 {
    margin: 0;
    color: #14233f;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.25;
}

.qa-repo-confirm-dialog > p {
    margin: 9px 0 0;
    color: #71809a;
    font-size: 11px;
    line-height: 1.55;
}

.qa-repo-confirm-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 12px;
    border: 1px solid #dce5f5;
    border-radius: 11px;
    color: #61718c;
    background: #f7f9fd;
    font-size: 10px;
    line-height: 1.45;
}

.qa-repo-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}

.qa-repo-confirm-actions .btn {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}

body.qa-repo-confirm-open {
    overflow: hidden !important;
}

@media (max-width: 520px) {
    .qa-repo-confirm-actions {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   AUTOMATION REPOSITORY — STATUS + FILE BROWSER
   ========================================================= */
.automation-repo-status-card {
    padding: 7px 8px;
    border: 1px solid #e0e7f1;
    border-radius: 8px;
    background: #f8fafc;
}

.automation-repo-status-top {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 9px;
}

.automation-repo-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #94a3b8;
}

.automation-repo-status-dot.clean {
    background: #16a34a;
}

.automation-repo-status-dot.changes {
    background: #f59e0b;
}

.automation-repo-status-dot.cloned {
    background: #3b82f6;
}

.automation-repo-status-meta {
    display: flex;
    gap: 7px;
    margin-top: 5px;
    color: #718096;
    font-size: 8px;
}

.automation-repo-status-meta span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.automation-repo-files {
    border: 1px solid #8aa7ff;
    color: #315ed8;
    background: #fff;
}

.automation-repo-files:hover {
    color: #fff;
    background: #315ed8;
}

.automation-repo-browser-panel {
    width: min(1120px, calc(100vw - 38px));
    max-width: 1120px;
    max-height: calc(100vh - 38px);
    overflow: auto;
}

.automation-repo-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.automation-repo-summary-grid > div,
.automation-repo-commit-card > div {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e1e7f0;
    border-radius: 11px;
    background: #f8faff;
}

.automation-repo-summary-grid span,
.automation-repo-commit-card span,
.automation-repo-local-path span {
    display: block;
    color: #7a89a2;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.automation-repo-summary-grid strong,
.automation-repo-commit-card strong {
    display: block;
    margin-top: 4px;
    color: #1c2e4f;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.automation-repo-commit-card {
    display: grid;
    grid-template-columns: minmax(120px,.8fr) minmax(220px,2fr) minmax(150px,1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.automation-repo-commit-message strong {
    white-space: normal;
    line-height: 1.35;
}

.automation-repo-local-path {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    margin-bottom: 13px;
    border: 1px solid #dce5f5;
    border-radius: 10px;
    background: #f7f9fd;
}

.automation-repo-local-path > i {
    margin-top: 2px;
    color: #315ed8;
}

.automation-repo-local-path code {
    display: block;
    margin-top: 3px;
    color: #334155;
    font-size: 9px;
    word-break: break-all;
}

.automation-repo-browser-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.automation-repo-breadcrumb {
    min-width: 0;
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e0e7f1;
    border-radius: 8px;
    color: #52627e;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.automation-repo-browser-layout {
    display: grid;
    grid-template-columns: minmax(260px,.8fr) minmax(0,1.6fr);
    gap: 12px;
    min-height: 430px;
}

.automation-repo-file-list,
.automation-repo-preview {
    min-width: 0;
    border: 1px solid #dfe5ef;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.automation-repo-file-list {
    max-height: 520px;
    overflow-y: auto;
}

.automation-repo-file-row {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 20px minmax(0,1fr) auto 14px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    color: #263b5e;
    background: #fff;
    text-align: left;
}

.automation-repo-file-row:hover {
    background: #f6f8ff;
}

.automation-repo-file-row > i:first-child {
    color: #4169e1;
}

.automation-repo-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 750;
}

.automation-repo-file-meta {
    color: #8a98ae;
    font-size: 8px;
    white-space: nowrap;
}

.automation-repo-browser-state {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 20px;
    color: #718096;
    font-size: 10px;
    text-align: center;
}

.automation-repo-browser-state.error {
    color: #c43b4d;
}

.automation-repo-preview {
    display: flex;
    flex-direction: column;
    min-height: 430px;
}

.automation-repo-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5eaf2;
    background: #f8faff;
}

.automation-repo-preview-head span {
    display: block;
    color: #315ed8;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .08em;
}

.automation-repo-preview-head strong {
    display: block;
    margin-top: 2px;
    color: #203657;
    font-size: 10px;
}

.automation-repo-preview-head small {
    color: #8a98ae;
    font-size: 8px;
}

.automation-repo-preview-code {
    flex: 1;
    margin: 0;
    padding: 14px;
    overflow: auto;
    color: #dbe7ff;
    background: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    line-height: 1.55;
    white-space: pre;
    tab-size: 4;
}

@media (max-width: 820px) {
    .automation-repo-summary-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .automation-repo-commit-card {
        grid-template-columns: 1fr;
    }

    .automation-repo-browser-layout {
        grid-template-columns: 1fr;
    }

    .automation-repo-file-list {
        max-height: 280px;
    }
}

@media (max-width: 520px) {
    .automation-repo-summary-grid {
        grid-template-columns: 1fr;
    }

    .automation-repo-browser-toolbar {
        flex-wrap: wrap;
    }

    .automation-repo-breadcrumb {
        order: 3;
        flex-basis: 100%;
    }
}


/* =========================================================
   AUTOMATION TRACKER — ACTION / REPOSITORY LAYOUT FIX
   Keeps Edit, repository status and repository actions compact.
   ========================================================= */

.automation-script-inventory-table {
    min-width: 1220px !important;
    table-layout: auto !important;
}

.automation-script-inventory-table .automation-action-heading {
    width: 320px !important;
    min-width: 320px !important;
    text-align: center !important;
}

.automation-script-inventory-table .automation-action-cell {
    width: 320px !important;
    min-width: 320px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    vertical-align: middle !important;
    text-align: left !important;
}

/*
 * Two-row action grid:
 * Row 1: Edit | Repository Status
 * Row 2: Open Repo | View Files | Sync Repo
 */
.automation-script-inventory-table .automation-action-stack {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 8px !important;
}

.automation-script-inventory-table
.automation-action-stack > .automation-edit-draft {
    grid-column: 1 / 2 !important;
}

.automation-script-inventory-table
.automation-action-stack > .automation-repo-status-card {
    grid-column: 2 / 4 !important;
}

.automation-script-inventory-table
.automation-action-stack > .automation-repo-open {
    grid-column: 1 / 2 !important;
}

.automation-script-inventory-table
.automation-action-stack > .automation-repo-files {
    grid-column: 2 / 3 !important;
}

.automation-script-inventory-table
.automation-action-stack > .automation-repo-sync-form {
    grid-column: 3 / 4 !important;
}

/* All action controls use the same visual size. */
.automation-script-inventory-table .automation-edit-draft,
.automation-script-inventory-table .automation-repo-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 9px !important;
    margin: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;

    border-radius: 9px !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;

    position: static !important;
    float: none !important;
    transform: none !important;
    box-sizing: border-box !important;
}

.automation-script-inventory-table .automation-repo-sync-form {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
}

/* Repository status is readable and no longer breaks into tiny columns. */
.automation-script-inventory-table .automation-repo-status-card {
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 7px 10px !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 9px !important;

    border-radius: 9px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.automation-script-inventory-table .automation-repo-status-top {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
}

.automation-script-inventory-table .automation-repo-status-top strong {
    white-space: nowrap !important;
    font-size: 9px !important;
}

.automation-script-inventory-table .automation-repo-status-meta {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;

    overflow: hidden !important;
    white-space: nowrap !important;
}

.automation-script-inventory-table .automation-repo-status-meta span {
    min-width: 0 !important;
    max-width: 72px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Keep other inventory columns from collapsing excessively. */
.automation-script-inventory-table th:nth-child(1),
.automation-script-inventory-table td:nth-child(1) {
    min-width: 250px !important;
}

.automation-script-inventory-table th:nth-child(2),
.automation-script-inventory-table td:nth-child(2) {
    min-width: 220px !important;
}

.automation-script-inventory-table th:nth-child(3),
.automation-script-inventory-table td:nth-child(3) {
    min-width: 145px !important;
}

.automation-script-inventory-table th:nth-child(4),
.automation-script-inventory-table td:nth-child(4) {
    min-width: 105px !important;
}

.automation-script-inventory-table th:nth-child(5),
.automation-script-inventory-table td:nth-child(5) {
    min-width: 170px !important;
}

.automation-script-inventory-table th:nth-child(6),
.automation-script-inventory-table td:nth-child(6) {
    min-width: 150px !important;
}

/* Smaller screens can scroll the table instead of crushing the Action area. */
@media (max-width: 1350px) {
    .automation-script-inventory-table {
        min-width: 1390px !important;
    }
}

@media (max-width: 700px) {
    .automation-script-inventory-table .automation-action-heading,
    .automation-script-inventory-table .automation-action-cell {
        width: 280px !important;
        min-width: 280px !important;
    }

    .automation-script-inventory-table .automation-action-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .automation-script-inventory-table
    .automation-action-stack > .automation-edit-draft {
        grid-column: 1 / 2 !important;
    }

    .automation-script-inventory-table
    .automation-action-stack > .automation-repo-status-card {
        grid-column: 2 / 3 !important;
    }

    .automation-script-inventory-table
    .automation-action-stack > .automation-repo-open,
    .automation-script-inventory-table
    .automation-action-stack > .automation-repo-files {
        grid-column: auto !important;
    }

    .automation-script-inventory-table
    .automation-action-stack > .automation-repo-sync-form {
        grid-column: 1 / 3 !important;
    }
}
