/* ============================================================
   ADS styles - Core: reset, layout shell, forms, tickets, comments, modals, dashboards, mobile
   Split out of the former monolithic style.css WITHOUT code changes.
   Files are linked in numeric order (see Core/templates/_styles.html) so
   the cascade is identical to the old single file.
   ============================================================ */

/* ========== RESET ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ========== CSS VARIABLES ========== */
:root {
    --green:      #0ea16f;
    --green-dark: #0c8f61;
    --green-lite: #ecfdf5;
    --green-mid:  #bbf7d0;
    --sidebar-w:  220px;
    --header-h:   60px;
    --gray-50:    #f8fafc;
    --gray-100:   #f1f5f9;
    --gray-200:   #e5e7eb;
    --gray-400:   #9ca3af;
    --gray-600:   #6b7280;
    --gray-700:   #374151;
    --gray-900:   #111827;
    --text:       #1f2937;
    --white:      #ffffff;
    --red:        #ef4444;
    --red-dark:   #dc2626;
    --blue:       #3b82f6;
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
    --shadow-md:  0 6px 20px rgba(0,0,0,0.08);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: var(--gray-50);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== LAYOUT SHELL ========== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 200;
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-brand .logo {
    height: 32px;
    width: auto;
}

.sidebar-brand-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--green);
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.sidebar-brand-text span {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-400);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-user {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-900);
}

.sidebar-user-role {
    font-size: 11.5px;
    color: var(--green);
    font-weight: 600;
    display: inline-block;
    margin-top: 3px;
    background: var(--green-lite);
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid var(--green-mid);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sidebar-nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    padding: 10px 10px 4px 10px;
}

.sidebar-nav a,
.sidebar-nav button.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.sidebar-nav a i,
.sidebar-nav button.nav-btn i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    color: var(--gray-400);
    transition: color 0.18s;
}

.sidebar-nav a:hover,
.sidebar-nav button.nav-btn:hover {
    background: var(--gray-100);
    color: var(--green);
}

.sidebar-nav a:hover i,
.sidebar-nav button.nav-btn:hover i {
    color: var(--green);
}

.sidebar-nav a.active {
    background: var(--green-lite);
    color: var(--green-dark);
    font-weight: 600;
}

.sidebar-nav a.active i {
    color: var(--green-dark);
}

.ts-nav-badge {
    margin-left: auto;
    background: #dc2626;
    color: var(--white);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
}

.ts-unmapped-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}
.ts-unmapped-banner i { color: #d97706; }
.ts-workflow-row-unmapped { background: #fffbeb; }

.sidebar-footer {
    padding: 14px 10px;
    border-top: 1px solid var(--gray-100);
}

.sidebar-footer .logout-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--red);
    background: transparent;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    width: 100%;
}

.sidebar-footer .logout-btn:hover {
    background: #fef2f2;
    color: var(--red-dark);
    transform: none;
    box-shadow: none;
}

.sidebar-footer .logout-btn i { font-size: 14px; }

/* ========== MAIN CONTENT AREA ========== */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== TOP HEADER BAR ========== */
.header {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

/* Hide logo/heading in header since sidebar has them */
.header .logo { display: none; }

.heading {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
    margin-right: auto;
}

/* Search bar in header */
.header-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.header-search-input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1.5px solid var(--gray-200);
    border-radius: 9999px;
    font-size: 13.5px;
    background: var(--gray-50);
    color: var(--text);
    transition: all 0.2s;
    outline: none;
}

.header-search-input:focus {
    border-color: var(--green);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.12);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 13px;
    pointer-events: none;
}

/* Header action icons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.18s;
    text-decoration: none;
}

.header-icon-btn:hover {
    background: var(--green-lite);
    color: var(--green);
}

/* Last updated badge */
.header-updated {
    font-size: 11.5px;
    color: var(--gray-400);
    white-space: nowrap;
}

/* Button container in header */
.button-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Remove old logout from header  it lives in sidebar now */
.button-container .logout-btn { display: none; }

.edit-btn, .new-issue-btn {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.edit-btn:hover {
    background: var(--gray-100);
    border-color: var(--green);
    color: var(--green);
}

.new-issue-btn {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.new-issue-btn:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.app-audit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0f766e;
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.app-audit-btn:hover { background: #115e59; }

/* ========== PAGE BODY ========== */
.page-body {
    flex: 1;
    padding: 24px 28px 48px 28px;
}

/* ========== USER INFO / GREETING ========== */
#userInfo { display: none; }

.user_name {
    background: var(--white);
    margin: 0 0 18px 0;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid var(--green);
    box-shadow: var(--shadow-sm);
    display: inline-block;
    color: var(--text);
}

/* ========== INSTRUCTION TEXT ========== */
.instruction-text {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-w) + 50%);
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    width: max-content;
    max-width: 380px;
}

.instruction-text.visible { opacity: 1; }

/* ========== VIEW TICKET NAV ========== */
.view-ticket-nav {
    padding: 0 28px;
    margin-top: 4px;
}

.create-issue-title { padding: 0 28px; }

/* ========== FORM WRAPPER ========== */
#form-wrapper {
    display: flex;
    justify-content: center;
    padding: 0 0 32px 0;
    position: relative;
}

#issueForm {
    max-width: 1100px;
    width: 100%;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    padding: 32px 36px;
    box-shadow: var(--shadow-sm);
    transition: filter 0.4s ease;
}

#form-wrapper.blurred #issueForm {
    filter: blur(6px);
    opacity: 0.85;
}

/* ========== GRID ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px 28px;
}

/* ========== ASSIGNEE CHECKBOX DROPDOWN (ADSV2-50) ========== */
.ads-native-select-hidden { display: none !important; }

.ads-checkbox-dropdown { position: relative; width: 100%; }

.ads-checkbox-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}
.ads-checkbox-dropdown-toggle:hover { border-color: var(--gray-300); }
.ads-checkbox-dropdown-toggle.open { border-color: var(--green); }
.ads-checkbox-dropdown-toggle.disabled { opacity: 0.6; cursor: not-allowed; }
.ads-checkbox-dropdown-toggle i { font-size: 12px; color: var(--gray-500); transition: transform 0.15s; }
.ads-checkbox-dropdown-toggle.open i { transform: rotate(180deg); }
.ads-checkbox-dropdown-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ads-checkbox-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
}

.ads-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text);
}
.ads-checkbox-row:hover { background: var(--gray-100); }
.ads-checkbox-row input { width: auto; padding: 0; margin: 0; cursor: pointer; }

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== LABELS ========== */
.field-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 7px;
}

.field-label i {
    font-size: 12px;
    color: var(--green);
}

/* ========== INPUTS ========== */
input, select, textarea {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.12);
}

select { cursor: pointer; }
select option { background: var(--white); color: var(--text); }

.file-input-wrapper {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 9px;
    padding: 8px 12px;
}

.file-input-wrapper input {
    border: none;
    background: transparent;
    padding: 4px;
    box-shadow: none;
}

.full-width { grid-column: span 3; }
.half-width { grid-column: span 2; }

/* ========== FORM ACTIONS ========== */
.form-actions {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    grid-column: span 3;
}

.create, .edituh {
    flex: 1;
    padding: 13px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.create { background: var(--green); color: var(--white); }
.create:hover { background: var(--green-dark); transform: translateY(-1px); }

.edituh { background: var(--blue); color: var(--white); }

/* ========== ADSV2-16: EDIT ACTION PINNED TO BOTTOM OF EDIT SCREEN ========== */
.edit-bottom-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.edit-bottom-actions .edituh {
    flex: 0 0 auto;
    min-width: 220px;
    padding: 14px 28px;
}
.edituh:hover { background: #2563eb; transform: translateY(-1px); }

/* ========== DISABLED ========== */
select:disabled, input:disabled, textarea:disabled {
    background: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
}

/* ========== RESPONSE AREA ========== */
.viewattach, #response {
    margin-top: 10px;
    padding: 14px 18px;
    background: var(--gray-50);
    border-radius: 9px;
    border-left: 4px solid var(--green);
    font-size: 13.5px;
    color: var(--text);
}

/* ========== COMMENTS SECTION ========== */
#comments-section {
    max-width: 1100px;
    margin: 0 0 40px 0;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    padding: 26px 32px;
    box-shadow: var(--shadow-sm);
    display: none;
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
    justify-content: space-between;
}

.comments-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-count-badge {
    background: var(--green);
    padding: 2px 9px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--white);
}

.comment-history {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--green);
}

.comment-content {
    flex: 1;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 10px 14px;
}

.comment-author { font-weight: 600; color: var(--text); font-size: 13.5px; }
.comment-time   { font-size: 11.5px; color: var(--gray-600); }

.comment-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    color: var(--text);
    font-size: 13.5px;
    resize: vertical;
    min-height: 78px;
    font-family: inherit;
}

.comment-submit-btn {
    background: var(--green);
    color: var(--white);
    border: none;
    padding: 7px 18px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13.5px;
}

.comment-submit-btn:hover { background: var(--green-dark); }

/* ========== POPUP ========== */
.popup {
    display: none;
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    background: rgba(0,0,0,0.5) !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

.popup-content {
    background: var(--white);
    padding: 36px 32px;
    border-radius: 18px;
    text-align: center;
    width: 380px;
    max-width: 90vw;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    animation: popupIn 0.22s ease;
}

@keyframes popupIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

#popupTitle   { font-size: 19px; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; }
#popupMessage { font-size: 14.5px; color: var(--gray-700); margin-bottom: 22px; }

.successclose {
    padding: 11px 28px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.successclose:hover { background: var(--green-dark); }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ========== SESSION WARNING ========== */
.session-warning {
    position: fixed;
    bottom: 20px; right: 20px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    display: none;
}

.session-warning.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

/* ========== LOGIN PAGE ========== */
.login-bg {
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

#backgroundVideo {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover; z-index: 0; opacity: 0.25;
}

.login_img {
    position: fixed; right: 0; bottom: 0;
    max-height: 70vh; z-index: 1; opacity: 0.1; pointer-events: none;
}

.login-container {
    position: relative; z-index: 2;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px; padding: 52px 44px 40px;
    width: 420px; text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.login-container .logo1 {
    width: 130px; margin-bottom: 22px;
    filter: drop-shadow(0 4px 16px rgba(16,185,129,0.35));
}

.login-container h2 {
    color: var(--white); font-size: 26px; font-weight: 700;
    margin-bottom: 6px; font-family: 'Poppins', sans-serif;
}

.login-container .subtitle {
    color: rgba(255,255,255,0.5); font-size: 13.5px;
    margin-bottom: 32px; font-family: 'Poppins', sans-serif;
}

.github-login-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; width: 100%; padding: 15px 24px;
    background: #24292e; color: var(--white); border: none;
    border-radius: 12px; font-size: 15px; font-weight: 600;
    font-family: 'Poppins', sans-serif; cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3); letter-spacing: 0.3px;
}

.github-login-btn:hover:not(:disabled) {
    background: var(--green); transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(14,161,111,0.45);
}

.github-login-btn:disabled { opacity: 0.75; cursor: not-allowed; }

.login-error {
    background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.35);
    color: #fca5a5; padding: 11px 16px; border-radius: 10px;
    font-size: 13px; margin-bottom: 20px; font-family: 'Poppins', sans-serif; text-align: left;
}

.login-note {
    margin-top: 22px; color: rgba(255,255,255,0.35);
    font-size: 12px; font-family: 'Poppins', sans-serif; line-height: 1.6;
}

/* ========== LOGOUT BTN (header fallback; sidebar is primary) ========== */
.logout-btn {
    display: flex; align-items: center; gap: 7px;
    background: var(--red); color: var(--white); border: none;
    padding: 8px 18px; border-radius: 9999px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: all 0.2s; white-space: nowrap;
}

.logout-btn:hover { background: var(--red-dark); transform: translateY(-1px); color: var(--white); }

/* ========== SEARCHABLE DROPDOWN ========== */
.searchable-dropdown-container { position: relative; width: 100%; }

.searchable-dropdown-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 9px;
    font-size: 13.5px;
    background: var(--white);
    transition: all 0.2s;
    font-family: inherit;
}

.searchable-dropdown-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.12);
}

.searchable-dropdown-list {
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: 240px; overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px; margin-top: 4px;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.searchable-dropdown-item {
    padding: 9px 14px; cursor: pointer;
    font-size: 13.5px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.searchable-dropdown-item:hover { background: var(--gray-100); }
.searchable-dropdown-item:last-child { border-bottom: none; }
.searchable-dropdown-item.active,
.searchable-dropdown-item:focus { background: #e8f5f0 !important; color: #065f46; outline: none; }

/* ========== COMMENT SEARCH ========== */
.comment-search-container {
    margin-left: auto;
    display: flex; align-items: center; gap: 8px;
}

#comment-search-input {
    padding: 7px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 12.5px;
    width: 200px; outline: none;
    transition: all 0.2s;
}

#comment-search-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.1);
}

.comment-search-clear {
    background: none; border: none;
    color: var(--gray-400); cursor: pointer;
    font-size: 13px; padding: 4px 7px;
    border-radius: 50%; transition: all 0.2s;
}

.comment-search-clear:hover { background: var(--gray-100); color: var(--red); }

/* ========== COMMENT INLINE MEDIA ========== */

/* --- Image attachments --- */
.comment-img-wrap {
    margin: 10px 0; padding: 10px;
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: 10px; display: inline-block; max-width: 100%;
}

.comment-inline-img {
    display: block;
    max-width: min(100%, 720px); max-height: 460px;
    object-fit: contain; border-radius: 8px;
    cursor: pointer; border: 1px solid var(--gray-200);
    background: var(--white);
    transition: transform 0.2s, box-shadow 0.2s;
}

.comment-inline-img:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.attachment-img-actions {
    margin-top: 8px; display: flex; justify-content: flex-end;
}

/* --- Generic attachment card (non-image files) --- */
.attachment-card {
    margin: 10px 0;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50);
    overflow: hidden;
    max-width: 100%;
}

.attachment-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.attachment-icon {
    font-size: 20px; flex-shrink: 0;
}

.attachment-filename {
    flex: 1; font-size: 13.5px; font-weight: 600;
    color: var(--text); word-break: break-all;
    min-width: 0;
}

.attachment-actions {
    display: flex; gap: 8px; flex-shrink: 0;
}

/* --- Shared button style for View / Download --- */
.attachment-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 13px; border-radius: 7px;
    font-size: 12.5px; font-weight: 500;
    text-decoration: none; cursor: pointer;
    transition: all 0.18s;
    border: 1px solid transparent;
}

.attachment-btn-view {
    background: #eff6ff; color: #2563eb;
    border-color: #bfdbfe;
}
.attachment-btn-view:hover {
    background: #2563eb; color: #fff;
}

.attachment-btn-download {
    background: #f0fdf4; color: #16a34a;
    border-color: #bbf7d0;
}
.attachment-btn-download:hover {
    background: #16a34a; color: #fff;
}

/* --- PDF inline preview frame --- */
.attachment-preview-frame {
    width: 100%;
    background: var(--gray-100);
}

.attachment-iframe {
    width: 100%; height: 520px;
    border: none; display: block;
    background: var(--white);
}

/* --- Text/CSV/JSON/XML text preview --- */
.attachment-text-preview {
    padding: 12px 16px;
}

.attachment-text-loading {
    color: var(--gray-500); font-size: 13px; font-style: italic;
}

.attachment-text-content {
    white-space: pre-wrap; word-break: break-all;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px; color: var(--text);
    max-height: 320px; overflow-y: auto;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: 6px; padding: 10px;
    margin-top: 4px;
}

/* --- Legacy / fallback --- */
.comment-file-link {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 8px 0; padding: 9px 14px;
    background: var(--green-lite); border: 1px solid var(--green-mid);
    border-radius: 10px; max-width: 100%; font-size: 13.5px;
    transition: all 0.2s;
}
.comment-file-link:hover { transform: translateY(-1px); }
.file-link-anchor { color: #16a34a; text-decoration: none; font-weight: 500; word-break: break-all; }
.file-link-anchor:hover { text-decoration: underline; }

.comment-upload-fail {
    color: var(--red-dark); font-size: 13px; margin: 4px 0;
    padding: 4px 8px; background: #fef2f2; border-radius: 6px; display: inline-block;
}

.comment-heading    { margin: 8px 0 4px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.comment-url        { color: var(--blue); text-decoration: underline; word-break: break-all; }
.comment-mention    { color: var(--blue); font-weight: 500; }
.comment-mention:hover { text-decoration: underline; }
.comment-issue-ref  { color: var(--blue); font-weight: 500; }
.comment-issue-ref:hover { text-decoration: underline; }

/* comment-github-link hidden  no longer emitted */
.comment-github-link { display: none; }

/* ========== MODAL ========== */
.modal {
    position: fixed; z-index: 10000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
}

.modal-content {
    background: var(--white); border-radius: 14px;
    width: 90%; max-width: 600px;
    max-height: 88vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-header {
    padding: 14px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}

.modal-header h3 { margin: 0; color: var(--text); font-size: 16px; }

.close-modal { font-size: 26px; cursor: pointer; color: var(--gray-400); }
.close-modal:hover { color: var(--red); }

.modal-body { padding: 20px 22px; display: flex; flex-direction: column; overflow-y: auto; min-height: 0; flex: 1; }

.edit-comment-textarea {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--gray-200); border-radius: 9px;
    font-size: 13.5px; font-family: inherit; resize: vertical;
}

.modal-footer {
    padding: 14px 22px; border-top: 1px solid var(--gray-200);
    display: flex; justify-content: flex-end; gap: 10px;
    flex-shrink: 0;
}

.modal-cancel-btn {
    padding: 7px 18px; background: var(--gray-100);
    border: none; border-radius: 8px; cursor: pointer; font-size: 13.5px;
}

.modal-save-btn {
    padding: 7px 18px; background: var(--green);
    color: var(--white); border: none; border-radius: 8px; cursor: pointer; font-size: 13.5px;
}

.ts-dash-entry-detail {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 20px; padding: 10px 8px;
}
.ts-dash-entry-detail-field { display: flex; flex-direction: column; gap: 2px; }
.ts-dash-entry-detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--gray-400); }
.ts-dash-entry-detail-value { font-size: 13px; color: var(--text); word-break: break-word; }

.vt-multiselect { position: relative; }
.vt-multiselect-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; min-width: 240px; padding: 9px 12px;
    border: 1.5px solid var(--gray-200); border-radius: 8px;
    background: var(--white); cursor: pointer; font-size: 13.5px; color: var(--text);
    text-align: left;
}
.vt-multiselect-btn span { text-align: left; }
.vt-multiselect-btn i { color: var(--gray-400); font-size: 12px; }
.vt-multiselect-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
    min-width: 280px; max-height: 260px; overflow-y: auto;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px;
}
.vt-multiselect-list { display: flex; flex-direction: column; }
.vt-multiselect-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px;
    text-align: left;
}
.vt-multiselect-item:hover { background: var(--gray-100); }
.vt-multiselect-item input[type="checkbox"] {
    width: 16px; height: 16px; min-width: 16px; flex: 0 0 16px;
    padding: 0; margin: 0; border-radius: 4px; cursor: pointer;
}
.vt-multiselect-item span { flex: 1; text-align: left; }

.comment-edit-modal-content { width: 92%; max-width: 640px; }
.comment-edit-modal-content .modal-body { padding: 16px 22px 20px; }
.comment-edit-modal-content .comment-drop-zone { border: 1px dashed var(--gray-200); border-radius: 10px; padding: 8px; }
.comment-edit-modal-content .edit-comment-textarea { border: none; padding: 6px 4px; min-height: 110px; }
.comment-edit-modal-content .edit-comment-textarea:focus { outline: none; box-shadow: none; }
@media (max-width: 600px) {
    .comment-edit-modal-content { width: 94vw; max-width: 94vw; }
}

/* -- Edit Ticket: Select Work Location popup -- */
.ewl-modal-content { width: 92%; max-width: 400px; }
.ewl-intro {
    margin: 0 0 16px; color: var(--gray-500, #6b7280);
    font-size: 13.5px; text-align: center; line-height: 1.5;
}
.ewl-options {
    display: flex; flex-direction: column; gap: 10px;
}
.ewl-option {
    display: flex; align-items: center; justify-content: flex-start; gap: 10px;
    width: 100%; box-sizing: border-box;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-200); border-radius: 10px;
    font-size: 14px; text-align: left;
    cursor: pointer; user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.ewl-option:hover { border-color: var(--green); background: var(--green-light, #f0faf6); }
.ewl-option input[type="radio"] { accent-color: var(--green); width: 16px; height: 16px; flex-shrink: 0; }
.ewl-option:has(input:checked) { border-color: var(--green); background: var(--green-light, #f0faf6); font-weight: 600; }
.ewl-option.selected { border-color: var(--green); background: var(--green-light, #f0faf6); font-weight: 600; }
.ewl-modal-footer {
    display: flex; justify-content: center; align-items: stretch; gap: 12px;
}
.ewl-modal-footer button.modal-cancel-btn,
.ewl-modal-footer button.ts-btn {
    flex: 1 1 0;
    width: 0; /* forces equal flex-basis distribution regardless of content width */
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    padding: 9px 16px;
    margin: 0;
    font-size: 13.5px;
    white-space: nowrap;
}

.modal-save-btn:hover { background: var(--green-dark); }

/* ========== AUDIT MODAL ========== */
.audit-modal-content {
    width: min(980px, 95vw);
    height: min(720px, 90vh);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.audit-log-content {
    flex: 1 1 auto;
    min-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-gutter: stable;
}

.audit-entry {
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--green);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--gray-50);
}

.audit-entry-head {
    display: flex; justify-content: space-between;
    gap: 10px; align-items: center; font-size: 13.5px;
}

.audit-entry-head span,
.audit-entry-meta { color: var(--gray-600); font-size: 12px; }

.audit-entry pre {
    margin-top: 8px; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: 7px;
    padding: 9px; white-space: pre-wrap;
    word-break: break-word; font-size: 11.5px;
}

/* ========== APP AUDIT MODAL ========== */
.app-audit-modal-content {
    /* Keep the popup only slightly wider than the audit summary row. */
    --app-audit-summary-width: 1040px;
    --app-audit-records-width: 1010px;

    width: min(calc(var(--app-audit-summary-width) + 48px), calc(100vw - 72px));
    max-width: 1088px;
    min-width: 0;
    /* Keep the approved popup footprint while reserving a real viewport for records. */
    height: min(640px, calc(100vh - 64px));
    max-height: calc(100vh - 64px);
    min-height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-audit-modal-content .modal-header {
    padding: 16px 28px;
    flex-shrink: 0;
}

.app-audit-modal-content .modal-header h3 {
    font-size: 18px;
}

.app-audit-modal-content .modal-footer {
    padding: 12px 28px;
    flex-shrink: 0;
    background: var(--white);
}

.app-audit-modal-content .modal-body {
    padding: 13px 24px 12px;
    gap: 9px;
    min-height: 0;
    overflow: hidden;
    flex: 1 1 auto;
}

.app-audit-summary {
    display: block;
    width: 100%;
    max-width: var(--app-audit-summary-width);
    margin: 0 auto;
    flex-shrink: 0;
}

/* One compact top row for Back/title and calendar controls. */
.app-audit-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 46px;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--gray-200);
}

.app-audit-mode-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    padding: 0;
    margin: 0;
    border: 0;
}

.app-audit-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    font-size: 12.5px;
    font-weight: 650;
    padding: 7px 13px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.app-audit-back-btn:hover {
    background: var(--green-lite);
    border-color: var(--green);
    color: var(--green-dark);
}

.app-audit-mode-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 750;
    color: var(--gray-900);
    white-space: nowrap;
}

.app-audit-mode-label i { color: var(--green); }

.app-audit-result-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid var(--gray-200);
    border-radius: 9px;
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 12.5px;
    white-space: nowrap;
}

.app-audit-result-meta i { color: var(--green); }

/* Calendar tools stay in the same top row on desktop. */
.app-audit-date-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    padding: 5px 7px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-50);
}

.app-audit-date-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--gray-600);
    white-space: nowrap;
}

.app-audit-date-label i { color: var(--green); }

.app-audit-date-display {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    background: var(--white);
    padding: 6px 9px;
    border-radius: 7px;
    border: 1px solid var(--gray-200);
    white-space: nowrap;
}

.app-audit-date-input {
    width: 165px;
    min-width: 165px;
    padding: 7px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 7px;
    font-size: 12.5px;
    cursor: pointer;
    background: var(--white);
    color: var(--gray-700);
    outline: none;
}

.app-audit-date-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(14,161,111,0.15);
}

.app-audit-today-btn {
    min-height: 34px;
    padding: 7px 13px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.app-audit-today-btn:hover { background: var(--green-dark); }

/* All six metrics remain in one row on standard desktop screens. */
.app-audit-stats-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding-top: 10px;
}

.app-audit-stat {
    min-width: 0;
    min-height: 66px;
    background: var(--green-lite);
    border: 1px solid var(--green-mid);
    border-radius: 11px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-audit-stat b {
    flex: 0 0 auto;
    min-width: 30px;
    color: #047857;
    font-size: 23px;
    line-height: 1;
}

.app-audit-stat span {
    min-width: 0;
    color: var(--gray-700);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.25;
}

.app-audit-modal-content #app-audit-content {
    /* Fill the complete area below the summary for both audit modes. */
    flex: 1 1 0;
    width: 100%;
    max-width: var(--app-audit-summary-width);
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scroll-padding: 10px 0;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #f8fafc;
    padding: 10px;
    scrollbar-gutter: stable;
    position: relative;
    isolation: isolate;
}

.app-audit-records {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 100%;
    padding-bottom: 2px;
}

.app-audit-entry {
    margin: 0;
    padding: 11px 13px;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.app-audit-entry .audit-entry-head {
    padding-bottom: 7px;
    border-bottom: 1px solid var(--gray-100);
}

.app-audit-entry .audit-entry-head strong {
    font-size: 14px;
    color: var(--gray-900);
}

.app-audit-entry .audit-entry-head span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.app-audit-entry-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 7px;
}

.app-audit-entry-subhead .audit-entry-meta {
    margin: 0;
    color: var(--gray-600);
}

.app-audit-entry-subhead .audit-chip-row {
    margin: 0;
}

.audit-empty-state {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--gray-600);
    font-size: 13.5px;
    text-align: center;
}

.audit-empty-state i {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    background: var(--green-lite);
    font-size: 18px;
}

.audit-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.audit-chip i { margin-right: 5px; font-size: 10px; }

.audit-chip {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    padding: 3px 9px;
    font-size: 11.5px;
    font-weight: 700;
}

/* Use the extra modal width to display audit fields in two aligned columns. */
.audit-detail-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 9px;
}

.audit-detail-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(105px, 135px) minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px 10px;
}

.audit-detail-row.audit-detail-row-wide {
    grid-column: 1 / -1;
    grid-template-columns: minmax(105px, 135px) minmax(0, 1fr);
}

.audit-detail-label {
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.audit-detail-value {
    min-width: 0;
    color: var(--gray-900);
    font-size: 12.75px;
    line-height: 1.35;
    word-break: break-word;
}

.audit-detail-box {
    margin-top: 9px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--gray-900);
    font-size: 12.75px;
    word-break: break-word;
}

/* ========== APP AUDIT  MODE SELECTOR ========== */
.app-audit-mode-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    padding: 22px 10px 16px;
    text-align: center;
}

.app-audit-mode-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}

.app-audit-mode-title i { color: var(--green); font-size: 16px; }

.app-audit-mode-btns {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.app-audit-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 250px;
    padding: 26px 18px 20px;
    border: 1.5px solid var(--gray-200);
    border-radius: 16px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: var(--shadow-sm);
}

.app-audit-mode-btn i {
    font-size: 26px;
    color: var(--green);
    background: var(--green-lite);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: all 0.18s ease;
}

.app-audit-mode-btn span {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--gray-900);
}

.app-audit-mode-btn small {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.4;
}

.app-audit-mode-btn:hover {
    border-color: var(--green);
    background: var(--green-lite);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.app-audit-mode-btn:hover i {
    background: var(--green);
    color: var(--white);
}

/* ========== DESCRIPTION DROP ZONE ========== */
.desc-drop-zone {
    position: relative;
    border: 1.5px dashed var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    transition: all 0.2s;
}

.desc-drop-zone.drag-over {
    border-color: var(--green);
    background: var(--green-lite);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.13);
}

.desc-drop-zone textarea { border: none !important; box-shadow: none !important; border-radius: 9px; resize: vertical; }
.desc-drop-zone textarea:focus { outline: none; box-shadow: none !important; border-color: transparent !important; }

.desc-drop-zone:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.12);
}

.desc-drop-overlay {
    display: none; position: absolute; inset: 0;
    border-radius: 8px; background: rgba(14,161,111,0.09);
    border: 2px dashed var(--green); z-index: 5;
    align-items: center; justify-content: center;
    font-size: 17px; font-weight: 600; color: #047857;
    pointer-events: none; gap: 10px;
}

.desc-drop-zone.drag-over .desc-drop-overlay { display: flex; }

.desc-attach-row {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; padding: 8px 10px 10px;
    border-top: 1px solid var(--gray-100);
}

.desc-attach-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--gray-200); background: var(--white);
    color: var(--gray-700); border-radius: 9999px;
    padding: 5px 12px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}

.desc-attach-btn:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-lite); }
.desc-drop-hint { color: var(--gray-400); font-size: 11.5px; }

.desc-file-preview-list {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 0 10px 10px;
}

/* ========== ROLE DASHBOARD ========== */
#role-dashboard { margin: 0 0 20px 0; display: flex !important; flex-wrap: wrap; align-items: stretch; gap: 10px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px; margin-bottom: 16px;
}

.dashboard-card {
    background: transparent; border: none;
    border-radius: 8px; padding: 6px 10px 6px 6px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: none; transition: background 0.15s ease;
}

.dashboard-card:hover { transform: none; box-shadow: none; background: var(--gray-100); }

.dashboard-card-icon {
    width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
}

.dashboard-card-icon.green  { background: var(--green-lite); color: #059669; }
.dashboard-card-icon.blue   { background: #eff6ff; color: #2563eb; }
.dashboard-card-icon.yellow { background: #fffbeb; color: #d97706; }
.dashboard-card-icon.red    { background: #fef2f2; color: var(--red-dark); }
.dashboard-card-icon.purple { background: #f5f3ff; color: #7c3aed; }
.dashboard-card-icon.teal   { background: #f0fdfa; color: #0f766e; }

.dashboard-card-info b {
    font-size: 22px; font-weight: 700; color: var(--gray-900); display: block; line-height: 1.2;
}

.dashboard-card-info span { font-size: 13px; color: var(--gray-800); font-weight: 600; white-space: nowrap; }

.dashboard-permissions {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow-sm);
}

.dashboard-permissions h4 {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--gray-600); margin-bottom: 10px;
}

.permission-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.permission-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600;
}

.permission-chip.allowed { background: var(--green-lite); color: #047857; border: 1px solid var(--green-mid); }
.permission-chip.denied  { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; text-decoration: line-through; opacity: 0.65; }

/* ========== CLOSE TICKET BTN ========== */
.close-ticket-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; background: var(--red); color: var(--white);
    border: none; border-radius: 8px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: background 0.2s, transform 0.15s;
}

.close-ticket-btn:hover { background: var(--red-dark); transform: translateY(-1px); }
.close-ticket-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

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

/* ========== COMMENT ATTACH + AUDIT BTN ========== */
.comment-attach-btn,
.audit-log-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--gray-200); background: var(--white);
    color: var(--gray-700); border-radius: 9999px;
    padding: 7px 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; font-size: 13px;
}

.comment-attach-btn:hover,
.audit-log-btn:hover,
.comment-attach-btn:focus,
.audit-log-btn:focus {
    border-color: var(--green); color: var(--green-dark);
    background: var(--green-lite); outline: none;
}

.comment-drop-hint { color: var(--gray-600); font-size: 12px; }

.comment-file-preview-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }

.comment-file-card {
    display: flex; align-items: center; gap: 8px;
    width: 250px; max-width: 100%; padding: 7px 9px;
    border: 1px solid var(--gray-200); border-radius: 10px; background: var(--gray-50);
}

.comment-file-thumb {
    width: 40px; height: 40px; object-fit: cover;
    border-radius: 7px; border: 1px solid var(--gray-200);
}

.comment-file-icon { font-size: 22px; color: var(--gray-600); width: 40px; text-align: center; }

.comment-file-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.comment-file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text); }
.comment-file-meta span { font-size: 11px; color: var(--gray-600); }

.comment-file-remove {
    border: none; background: #fee2e2; color: #b91c1c;
    width: 22px; height: 22px; border-radius: 50%;
    cursor: pointer; font-size: 16px; line-height: 1;
}

/* ========== COMMENT INPUT ZONE ========== */
.add-comment-container { display: flex; align-items: flex-start; gap: 12px; }

.comment-input-wrapper { flex: 1; position: relative; }

.comment-drop-zone {
    border: 1.5px dashed var(--gray-200);
    border-radius: 12px; padding: 10px;
    background: var(--white); transition: all 0.2s; position: relative;
}

.comment-drop-zone:focus,
.comment-drop-zone:focus-within,
.comment-drop-zone.drag-over {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.12);
    background: var(--green-lite);
}

.comment-attach-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }

.mention-suggestions {
    position: absolute; left: 12px; right: 12px; top: 84px;
    max-height: 220px; overflow-y: auto;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,0.1);
    z-index: 50; padding: 5px;
}

.mention-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--gray-700);
}

.mention-item:hover,
.mention-item.active,
.mention-item:focus { background: var(--green-lite); color: #047857; outline: none; }

.mention-item img { width: 22px; height: 22px; border-radius: 50%; }

/* Issue Description field's textarea is taller (150px) than the
   comment box the default .mention-suggestions top offset was tuned
   for, so the dropdown needs to sit further down to avoid covering
   the text as it's typed. */
#desc-mention-suggestions { top: 160px; }

.char-count { font-size: 11.5px; color: var(--gray-400); }

/* ========== COMMENT ACTIONS ========== */
.comment-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* ========== DASHBOARD CARD CLICKABLE ========== */
.dashboard-card-clickable {
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.dashboard-card-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(14,161,111,0.18);
    border-color: var(--green);
}

.dashboard-card-clickable:active { transform: translateY(-1px); }
.dashboard-card-clickable:focus { outline: 2px solid var(--green); outline-offset: 2px; }

/* ========== FOCUS VISIBLE ========== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(14,161,111,0.4);
    outline-offset: 2px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1180px) {
    .app-audit-modal-content {
        width: min(940px, 94vw);
        max-width: 94vw;
        min-width: 0;
        height: min(640px, 92vh);
        max-height: 92vh;
        min-height: 500px;
    }

    .app-audit-modal-content #app-audit-content {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .app-audit-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .app-audit-date-bar {
        width: 100%;
        justify-content: flex-start;
    }

    .app-audit-stats-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    :root { --sidebar-w: 200px; }

    .app-audit-modal-content {
        width: 96vw;
        max-width: 96vw;
        height: min(640px, 94vh);
        max-height: 94vh;
        min-height: 480px;
    }

    .audit-detail-list { grid-template-columns: 1fr; }
    .audit-detail-row.audit-detail-row-wide { grid-column: auto; }
}

@media (max-width: 768px) {
    .app-audit-modal-content {
        width: 98vw;
        max-width: 98vw;
        height: 96vh;
        max-height: 96vh;
        min-height: 0;
        border-radius: 12px;
    }

    .app-audit-modal-content #app-audit-content {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .app-audit-modal-content .modal-header { padding: 13px 16px; }
    .app-audit-modal-content .modal-body { padding: 12px; }
    .app-audit-modal-content .modal-footer { padding: 10px 16px; }

    .app-audit-stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .app-audit-date-bar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .app-audit-date-display,
    .app-audit-date-input,
    .app-audit-today-btn {
        width: 100%;
        min-width: 0;
    }

    .app-audit-mode-bar { align-items: flex-start; }
    .audit-entry-head { align-items: flex-start; flex-direction: column; }
    .app-audit-entry-subhead { align-items: flex-start; flex-direction: column; }
    .audit-detail-row,
    .audit-detail-row.audit-detail-row-wide {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    /* NOTE: sidebar off-canvas / .form-grid / .main-content mobile rules
       used to live here, referencing a .sidebar.open class the JS never
       actually sets. They were dead/conflicting with the real drawer
       implementation and have been consolidated into the single mobile
       layer at the end of this file (see "MOBILE RESPONSIVENESS"). */

    #role-dashboard { margin: 0 0 16px 0; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dashboard-card { padding: 12px 14px; gap: 10px; }

    .comments-header { align-items: flex-start; flex-direction: column; }
    .add-comment-container { gap: 8px; }
    .comment-file-card { width: 100%; }
    .comment-search-container { width: 100%; margin-top: 8px; margin-left: 0; }
    #comment-search-input { width: 100%; }
    .page-body { padding: 16px 16px 40px; }
    .view-ticket-nav, .create-issue-title { padding: 0 16px; }
}

/* ========== DASHBOARD LAYOUT (sidebar + stats redesign) ========== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 18px;
    align-items: start;
}

/* Left: action cards stacked above stat cards */
.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    align-items: stretch;
}

/* -- Stat number cards row -- */
.dashboard-stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: start;
}

.dashboard-stat-cards .stat-card-wide {
    grid-column: span 2;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s, box-shadow 0.18s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: none;
}

.stat-card-blue::before   { background: var(--blue); }
.stat-card-yellow::before { background: #f59e0b; }
.stat-card-green::before  { background: var(--green); }
.stat-card-purple::before { background: #7c3aed; }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-filter {
    cursor: pointer;
}

.stat-card-filter:focus {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.stat-card-filter-active {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(14,161,111,0.12), var(--shadow-md);
}

.stat-card-icon {
    font-size: 15px;
    margin-bottom: 0;
    order: 2;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-blue   .stat-card-icon { color: var(--blue);   background: #eff6ff; }
.stat-card-yellow .stat-card-icon { color: #d97706;       background: #fffbeb; }
.stat-card-green  .stat-card-icon { color: var(--green);  background: #ecfdf5; }
.stat-card-purple .stat-card-icon { color: #7c3aed;       background: #f5f3ff; }

.stat-card-body {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    order: 1;
    min-width: 0;
}

.stat-card-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    display: block;
}

.stat-card-label {
    font-size: 10.5px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stat-repo-breakdown {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-top: 1px solid var(--gray-100);
    padding-top: 6px;
}

.stat-repo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
}

.stat-repo-name {
    color: var(--gray-700);
    font-weight: 500;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-repo-count {
    background: #ede9fe;
    color: #6d28d9;
    border-radius: 9999px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

/* -- Closed card: wider than its siblings (not taller) — the
   Label/Fully Closed breakdown sits inline between the count and the
   icon, in the same single row as the other stat cards. -- */
#stat-closed {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
#stat-closed .stat-card-body { order: 1; flex-shrink: 0; }
#stat-closed .stat-repo-breakdown { order: 2; }
#stat-closed .stat-card-icon { order: 3; }

#stat-closed .stat-repo-breakdown {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 0;
    border-top: none;
    border-left: 1px solid var(--gray-100);
    padding-top: 0;
    padding-left: 10px;
    flex: 1 1 auto;
    min-width: 0;
}
#stat-closed .stat-repo-row {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}
#stat-closed .stat-repo-name {
    max-width: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#stat-closed .stat-repo-count {
    background: none;
    color: var(--gray-900);
    padding: 0;
    border-radius: 0;
    font-size: 15px;
    font-weight: 800;
}

/* -- Vertical permissions panel -- */
.dashboard-permissions {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 18px 18px;
    box-shadow: var(--shadow-sm);
    align-self: start;
}

.dashboard-permissions h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--gray-600);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.dashboard-permissions h4 i {
    color: var(--green);
    font-size: 13px;
}

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.permission-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.permission-row.allowed {
    background: var(--green-lite);
    color: #065f46;
    border: 1px solid var(--green-mid);
}

.permission-row.denied {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    text-decoration: line-through;
    opacity: 0.7;
}

.permission-row-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.permission-row.allowed .permission-row-icon { color: var(--green); }
.permission-row.denied  .permission-row-icon { color: #dc2626; }

.permission-row-label { flex: 1; }

/* -- Responsive -- */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-permissions {
        /* Put permissions below on smaller screens */
    }
    .dashboard-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dashboard-stat-cards {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-action-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== MULTI-SCREEN PAGE SYSTEM ========== */
.page-screen {
    display: none;
    min-height: calc(100vh - var(--header-h));
}

.page-screen.active {
    display: block;
}

/* ========== SIDEBAR BRAND (logo + text only, no "Amitysoft" duplication) ========== */
.sidebar-brand-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--green);
    line-height: 1.3;
    letter-spacing: -0.2px;
}

/* ========== PAGE SCREEN TITLE ========== */
.page-screen-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--gray-100);
}

.page-screen-title i { color: var(--green); }

/* ========== FORM WRAPPER SCREEN ========== */
.form-wrapper-screen {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.edit-form-notice {
    background: var(--green-lite);
    border: 1px solid var(--green-mid);
    border-radius: 9px;
    padding: 10px 16px;
    font-size: 13.5px;
    color: #065f46;
    margin-bottom: 20px;
}

/* ========== DASHBOARD (no sidebar layout  full width now) ========== */
/* Both containers dissolve so their children join the single
   #role-dashboard flex row alongside each other  one neat row
   instead of two stacked rows with wasted width. */
.dashboard-action-cards,
.dashboard-stat-cards {
    display: contents;
}

.dashboard-action-cards .dashboard-card {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
}

.dashboard-stat-cards .stat-card {
    flex: 1 1 130px;
    min-width: 110px;
    max-width: 190px;
    margin: 0;
}

/* Closed card gets extra room so its Label/Fully Closed breakdown has
   space to sit cleanly instead of overlapping the count. */
.dashboard-stat-cards .stat-card.stat-card-wide {
    flex: 1 1 280px;
    min-width: 240px;
    max-width: 340px;
}

/* When a role has 3+ action buttons (e.g. Super Admin: Create,
   Edit, Workflow Setup, View All Audits), group them into a single
   bordered card instead of leaving them as loose icon+text buttons.
   Roles with just Create/Edit (e.g. Project Manager) keep the plain
   inline look untouched. */
.dashboard-action-cards:has(.dashboard-card:nth-child(3)) {
    display: flex !important;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 2px 4px;
    box-shadow: var(--shadow-sm);
}
.dashboard-action-cards:has(.dashboard-card:nth-child(3)) .dashboard-card {
    padding: 8px 12px;
    border-radius: 8px;
}
.dashboard-action-cards:has(.dashboard-card:nth-child(3)) .dashboard-card:not(:last-child) {
    border-right: 1px solid var(--gray-100);
}
.dashboard-action-cards:has(.dashboard-card:nth-child(3)) .dashboard-card:hover {
    background: var(--gray-100);
}

/* ========== ASSIGNED TICKETS SECTION ========== */
.assigned-tickets-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
    gap: 12px;
    flex-wrap: wrap;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.section-header h3 i { color: var(--green); }

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ticket-filter-select {
    padding: 6px 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 12.5px;
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    outline: none;
}

.ticket-filter-select:focus { border-color: var(--green); }

.ticket-filters-row {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    padding: 12px 22px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
}

.ticket-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-filter-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500, #6b7280);
}

.ticket-filter-group .ticket-filter-select {
    min-width: 150px;
}

.refresh-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.18s;
}

.refresh-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-lite); }

.tickets-table-wrap {
    overflow-x: auto;
    max-height: 480px;
    overflow-y: auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.tickets-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 2px 4px;
    flex-wrap: wrap;
}

.tickets-pagination-info {
    font-size: 12.5px;
    color: var(--gray-600);
}

.tickets-pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tickets-pagination-pages {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-700);
    min-width: 90px;
    text-align: center;
}

.tickets-pagination-controls .ts-btn-sm {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tickets-pagination-controls .ts-btn-sm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tickets-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13.5px;
}
.tickets-table th:nth-child(1), .tickets-table td:nth-child(1) { width: 56px; }
.tickets-table th:nth-child(2), .tickets-table td:nth-child(2) { width: auto; }
.tickets-table th:nth-child(3), .tickets-table td:nth-child(3) { width: 110px; }
.tickets-table th:nth-child(4), .tickets-table td:nth-child(4) { width: 130px; }
.tickets-table th:nth-child(5), .tickets-table td:nth-child(5) { width: 130px; }
.tickets-table th:nth-child(6), .tickets-table td:nth-child(6) { width: 84px; }

.tickets-table thead th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-600);
    background: var(--white);
    position: sticky;
    top: 0;
    border-bottom: 2px solid var(--gray-100);
    z-index: 1;
}

.tickets-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.12s;
}

.tickets-table tbody tr:hover {
    background: var(--gray-50);
    cursor: pointer;
}

.tickets-table tbody td {
    padding: 11px 14px;
    color: var(--text);
    vertical-align: middle;
    overflow: hidden;
}

.tickets-table thead th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-loading, .table-empty {
    text-align: center;
    padding: 32px !important;
    color: var(--gray-400);
    font-size: 14px;
}

.ticket-hash {
    font-weight: 700;
    color: var(--blue);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12.5px;
}

.ticket-title {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.ticket-milestone, .ticket-updated {
    color: var(--gray-600);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-badge {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.status-badge {
    border-radius: 9999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.status-open       { background: #dbeafe; color: #1d4ed8; }
.status-inprogress { background: #fef3c7; color: #92400e; }
.status-closed     { background: #dcfce7; color: #15803d; }
.status-hold       { background: #f3e8ff; color: #6d28d9; }

.ticket-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--green-lite);
    color: var(--green-dark);
    border: 1px solid var(--green-mid);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ticket-action-btn:hover { background: var(--green); color: var(--white); }

/* ========== NOTIFICATION BELL ========== */
.notif-wrapper { position: relative; }

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: var(--white);
    border-radius: 9999px;
    font-size: 9.5px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--white);
    line-height: 1;
    pointer-events: none;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    overflow: hidden;
    animation: popupIn 0.18s ease;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-900);
}

.notif-close-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
}

.notif-close-btn:hover { background: var(--gray-100); color: var(--red); }

.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-loading, .notif-empty {
    padding: 24px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.12s;
}

.notif-item:hover { background: var(--gray-50); }
.notif-item:last-child { border-bottom: none; }

/* -- Unread item -- */
.notif-item-unread {
    background: #f0fdf4;
    border-left: 3px solid var(--green, #10b981);
    padding-left: 13px;
}
.notif-item-unread:hover { background: #dcfce7; }

/* Green dot beside the issue number */
.notif-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green, #10b981);
    flex-shrink: 0;
}

/* "· N unread" label in the panel header */
.notif-unread-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #065f46;
    margin-left: 4px;
}

/* "Mark all as read" footer */
.notif-mark-all-row {
    padding: 8px 14px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    text-align: center;
}
.notif-mark-all-btn {
    background: none;
    border: none;
    color: #065f46;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.12s;
}
.notif-mark-all-btn:hover { background: #d1fae5; }

.notif-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.notif-num {
    font-weight: 700;
    color: var(--blue);
    font-size: 12px;
    font-family: 'SF Mono', monospace;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.notif-item-meta {
    font-size: 11.5px;
    color: var(--gray-500, #6b7280);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 1024px) {
    .dashboard-stat-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .dashboard-action-cards { grid-template-columns: repeat(2, 1fr); }
    .dashboard-stat-cards   { grid-template-columns: 1fr 1fr; }
    .form-wrapper-screen    { padding: 18px 16px; }
    .notif-panel            { width: 300px; right: -60px; }
}

/* ========== SIDEBAR COLLAPSE (Issue 3) ========== */
:root { --sidebar-w: 220px; --sidebar-collapsed-w: 60px; }

.app-shell { transition: none; }

.sidebar {
    overflow: visible;
    transition: width 0.25s ease, transform 0.3s ease;
}

.main-content { transition: margin-left 0.25s ease; }

.sidebar-brand {
    min-height: var(--header-h);
    position: relative;
    overflow: visible;
}

.sidebar-brand .logo {
    max-width: 132px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-collapse-btn {
    position: absolute;
    top: 18px;
    right: -13px;
    z-index: 20;
    width: 26px; height: 26px;
    border: 1px solid var(--gray-200); background: var(--white);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--gray-600);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0; transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.sidebar-collapse-btn:hover { background: var(--green-lite); color: var(--green); box-shadow: var(--shadow-md); }
.sidebar-collapse-btn i { transition: color 0.2s ease; font-size: 12px; }

/* Collapsed state */
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); overflow: visible; }
.sidebar-collapsed .sidebar-text { display: none; }
.sidebar-collapsed .sidebar-brand-text { display: none; }
.sidebar-collapsed .sidebar-user { display: none; }
.sidebar-collapsed .sidebar-nav-label { display: none; }
.sidebar-collapsed .sidebar-nav a,
.sidebar-collapsed .sidebar-nav button.nav-btn {
    justify-content: center; padding: 10px 0;
}
.sidebar-collapsed .sidebar-nav a i,
.sidebar-collapsed .sidebar-nav button.nav-btn i { margin: 0; width: auto; }
.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-w); }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 12px 0; }
.sidebar-collapsed .sidebar-brand .logo {
    width: 38px;
    height: 38px;
    max-width: 38px;
    object-fit: contain;
    border-radius: 10px;
}
.sidebar-collapsed .sidebar-footer { padding: 10px 6px; }
.sidebar-collapsed .sidebar-footer .logout-btn { justify-content: center; padding: 9px 0; }
.sidebar-collapsed .sidebar-footer .logout-btn i { margin: 0; }
.sidebar-collapsed .sidebar-footer .logout-btn span { display: none; }

/* ========== HEADER GREETING (Issue 4) ========== */
.header-greeting {
    flex: 1;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide the old static heading */
.heading { display: none; }

/* ========== LOGOUT ICON IN HEADER (Issue 5) ========== */
.header-logout-btn {
    color: var(--red) !important;
}
.header-logout-btn:hover {
    background: #fef2f2 !important;
    color: var(--red-dark) !important;
}

/* ========== HEADER SEARCH RESULTS (Issue 1) ========== */
.header-search { position: relative; }

.header-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    z-index: 500;
    overflow: hidden;
    max-height: 340px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.12s;
    flex-wrap: wrap;
}
.search-result-item:hover { background: var(--gray-50); }
.search-result-item:last-child { border-bottom: none; }

.search-num {
    font-weight: 700;
    color: var(--blue);
    font-size: 12px;
    font-family: 'SF Mono', monospace;
    flex-shrink: 0;
}

.search-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-900);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-no-result {
    padding: 20px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13.5px;
}

/* ========== REPOS POPUP (Issue 7) ========== */
.repos-popup {
    position: absolute;
    left: calc(var(--sidebar-w) + 4px);
    top: auto;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    z-index: 400;
    width: 240px;
    overflow: hidden;
    animation: popupIn 0.18s ease;
}

.sidebar-collapsed .repos-popup { left: calc(var(--sidebar-collapsed-w) + 4px); }

.repos-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 700;
    font-size: 13.5px;
    color: var(--gray-900);
}

.repos-popup-close {
    background: none; border: none;
    color: var(--gray-400); cursor: pointer;
    font-size: 14px; padding: 2px 5px;
    border-radius: 6px; transition: all 0.15s;
}
.repos-popup-close:hover { background: var(--gray-100); color: var(--red); }

.repos-popup-list { max-height: 280px; overflow-y: auto; }

.repo-popup-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px;
    font-size: 13px; color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    cursor: default; transition: background 0.12s;
}
.repo-popup-item:hover { background: var(--gray-50); }
.repo-popup-item:last-child { border-bottom: none; }

/* ========== STAT CARDS  update for new Open card ========== */
.stat-card-green::before  { background: var(--green); }

/* ========== TICKETS TABLE  6 cols now (no action) ========== */
.tickets-table thead th:last-child,
.tickets-table tbody td:last-child { /* updated count, still fine */ }

/* ========== REPOSITORY-SCOPED DASHBOARD ========== */
.dashboard-repo-scope-bar {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
    border: 1px solid var(--green-mid);
    border-radius: 11px;
    color: var(--gray-700);
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}

.dashboard-repo-scope-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-repo-scope-main strong {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #047857;
    font-size: 13.5px;
}

.dashboard-repo-scope-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--white);
    color: var(--green);
    border: 1px solid var(--green-mid);
}

.dashboard-repo-scope-clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid var(--green-mid);
    border-radius: 8px;
    background: var(--white);
    color: #047857;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}

.dashboard-repo-scope-clear:hover {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
}

.assigned-ticket-scope-label {
    max-width: 240px;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid var(--green-mid);
    border-radius: 9999px;
    background: var(--green-lite);
    color: #047857;
    font-size: 10.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-filter-select:disabled {
    opacity: 0.78;
    color: #047857;
    background: var(--green-lite);
    border-color: var(--green-mid);
    cursor: not-allowed;
}

/* Repository popup items are now real selectable buttons. */
.repo-popup-item {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

.repo-popup-item:hover {
    background: var(--gray-50);
    color: var(--green-dark);
}

.repo-popup-item:focus-visible {
    position: relative;
    z-index: 2;
    outline: 2px solid rgba(14, 161, 111, 0.28);
    outline-offset: -2px;
}

.repo-popup-leading-icon {
    width: 16px;
    flex: 0 0 16px;
    color: var(--green);
    font-size: 12px;
    text-align: center;
}

.repo-popup-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-popup-check {
    margin-left: auto;
    color: var(--green);
    font-size: 11px;
    opacity: 0;
    transform: scale(0.75);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.repo-popup-item-selected {
    background: var(--green-lite);
    color: #047857;
    font-weight: 700;
}

.repo-popup-item-selected:hover {
    background: #dcfce7;
}

.repo-popup-item-selected .repo-popup-check {
    opacity: 1;
    transform: scale(1);
}

.repo-popup-all {
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 700;
    box-shadow: 0 1px 0 var(--gray-100);
}

.repo-popup-loading,
.repo-popup-empty,
.repo-popup-error {
    padding: 13px 14px;
    color: var(--gray-500, #6b7280);
    font-size: 12.5px;
}

.repo-popup-error { color: var(--red); }

@media (max-width: 760px) {
    .dashboard-repo-scope-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-repo-scope-clear {
        width: 100%;
    }

    .dashboard-repo-scope-main strong {
        max-width: 180px;
    }
}



/* ========== ISSUE RELATIONSHIPS (PARENT / SUB-ISSUES) ========== */
.issue-relationships-section {
    max-width: 1100px;
    margin: 0 0 40px 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 26px 32px;
    box-shadow: var(--shadow-sm);
}

.issue-relationships-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.issue-relationships-header h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 17px;
    color: var(--gray-900);
}

.issue-relationships-header h3 i { color: var(--green); }
.issue-relationships-header p {
    margin: 5px 0 0;
    color: var(--gray-600);
    font-size: 12.5px;
}

.relationship-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid var(--gray-200);
    border-radius: 9px;
    background: var(--white);
    color: var(--gray-700);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}
.relationship-refresh-btn:hover {
    color: var(--green-dark);
    border-color: var(--green);
    background: var(--green-lite);
}

.issue-relationships-content { min-height: 86px; }
.relationship-loading {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--gray-600);
    font-size: 13px;
}

.relationship-source-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 16px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.4;
}
.relationship-source-note.native {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.relationship-source-note.legacy {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.relationship-current-row { margin-bottom: 18px; }
.relationship-columns {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr);
    gap: 18px;
    align-items: start;
}
.relationship-column {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50);
}
.relationship-column-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.relationship-column-title i { color: var(--green); }
.relationship-column-title span {
    min-width: 22px;
    padding: 2px 7px;
    margin-left: auto;
    border-radius: 999px;
    color: var(--white);
    background: var(--green);
    text-align: center;
    font-size: 10px;
}
.relationship-child-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 3px;
}

.relationship-issue-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--gray-200);
    border-radius: 11px;
    background: var(--white);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.relationship-issue-card:hover {
    border-color: var(--green);
    box-shadow: 0 5px 14px rgba(14, 161, 111, 0.10);
    transform: translateY(-1px);
}
.relationship-card-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--green-dark);
    background: var(--green-lite);
}
.relationship-card-main { flex: 1; min-width: 0; }
.relationship-card-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.relationship-role-label {
    color: var(--gray-600);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.55px;
    text-transform: uppercase;
}
.relationship-state {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: capitalize;
}
.relationship-state.is-open { color: #047857; background: #d1fae5; }
.relationship-state.is-closed { color: #991b1b; background: #fee2e2; }
.relationship-card-title {
    overflow: hidden;
    color: var(--gray-900);
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.relationship-card-title strong { color: var(--green-dark); }
.relationship-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 13px;
    margin-top: 6px;
    color: var(--gray-600);
    font-size: 10.5px;
}
.relationship-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.relationship-labels { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.relationship-labels span {
    padding: 2px 7px;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    font-size: 9.5px;
    font-weight: 600;
}
.relationship-card-arrow { flex: 0 0 auto; color: var(--gray-400); font-size: 11px; }

.relationship-empty {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px;
    border: 1px dashed var(--gray-200);
    border-radius: 10px;
    color: var(--gray-600);
    background: var(--white);
    text-align: center;
}
.relationship-empty > i { color: var(--gray-400); font-size: 18px; }
.relationship-empty > span { color: var(--gray-700); font-size: 12.5px; font-weight: 700; }
.relationship-empty > small { max-width: 300px; font-size: 10.5px; line-height: 1.45; }

.relationship-error {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    background: #fef2f2;
}
.relationship-error > div { display: flex; flex-direction: column; gap: 4px; }
.relationship-error span { font-size: 11.5px; line-height: 1.45; }
.relationship-error-details {
    max-height: 150px;
    overflow: auto;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    color: #7f1d1d;
    background: #fff7f7;
    font-size: 10.5px;
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .relationship-columns { grid-template-columns: 1fr; }
    .issue-relationships-section { padding: 20px; }
}

@media (max-width: 600px) {
    .issue-relationships-header { align-items: flex-start; flex-direction: column; }
    .relationship-refresh-btn { width: 100%; justify-content: center; }
    .relationship-card-title { white-space: normal; }
}

/* ========== CREATE PAGE: NATIVE SUB-ISSUE ROLE GUIDANCE ========== */
.subissue-role-help {
    margin-top: 7px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--green-mid);
    background: var(--green-lite);
    color: var(--green-dark);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.45;
}

.subissue-role-help i {
    margin-right: 5px;
}

.subissue-role-help.role-denied {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}




/* App version subscript pinned to the bottom of the side panel (value comes from the version_history table) */
.sidebar-version {
    flex-shrink: 0; padding: 8px 10px 10px; text-align: center;
    border-top: 1px solid var(--gray-200);
}
.brand-version {
    font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .3px;
    color: var(--green, #10b981); white-space: nowrap; user-select: none;
}

/* Caution shown in the ticket-edit success popup */
.popup-caution {
    margin: 14px 0 4px; padding: 10px 12px; border-radius: 10px; text-align: left;
    background: #fffbeb; border: 1px solid #fcd34d; color: #92400e;
    font-size: 13px; line-height: 1.45;
}
.popup-caution i { margin-right: 6px; color: #d97706; }
