﻿/* =============== Header =============== */
.app-header {
    position: sticky; top: 0; z-index: 50; height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--pad);
    background: color-mix(in oklab, var(--surface) 70%, black 30%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-bd);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 800; letter-spacing: 0.5px;
    background: linear-gradient(135deg, #6c8bff 0%, #7b5ce7 100%);
    box-shadow: var(--glow);
}
.brand .title { font-size: 1rem; font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-page-meta {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 1px;
    padding: 0 clamp(14px, 3vw, 28px);
}

.header-page-title {
    color: #f8fafc;
    font-size: clamp(1rem, 1.7vw, 1.34rem);
    font-weight: 900;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-page-subtitle {
    color: #9aa7b8;
    font-size: 0.8rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; cursor: pointer;
    background: var(--glass); border: 1px solid var(--glass-bd); color: var(--text);
    transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.icon-btn:hover { transform: translateY(-2px); }

/* =============== Sidebar =============== */
.sidebar {
    position: fixed; inset: var(--header-h) auto 0 0;
    width: 280px; z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    background: color-mix(in oklab, var(--surface) 85%, black 15%);
    border-right: 1px solid var(--glass-bd);
    backdrop-filter: blur(12px);
    padding: 18px; overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar.open { transform: translateX(0); }
@media (min-width: 1024px) {
    .sidebar { transform: translateX(0); }
    .sidebar.collapsed { transform: translateX(-100%); }
    .overlay { display: none; }
}
@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
}
.sidebar-header {
    text-align: left; padding: 6px 6px 16px;
    border-bottom: 1px solid var(--glass-bd); margin-bottom: 14px;
}
.sidebar-logo {
    width: 56px; height: 56px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800;
    background: linear-gradient(135deg, #6c8bff, #7b5ce7);
    box-shadow: var(--glow);
}
.sidebar h3 { margin: 10px 0 2px; font-size: 1rem; }
.sidebar small { color: var(--muted); }

.nav-section { margin: 14px 0; }
.nav-section-title {
    font-size: 0.75rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin: 8px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 12px; cursor: pointer;
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); }
.nav-item.active {
    background: var(--highlight); color: #fff;
    box-shadow: 0 10px 28px rgba(77, 119, 255, 0.35);
}
.nav-item .nav-badge {
    margin-left: auto; background: #e74c3c; color: #fff;
    padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
}
.sidebar-build {
    margin-top: auto;
    padding: 18px 6px 2px;
    color: rgba(244, 239, 228, 0.48);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
}

/* =============== Overlay =============== */
.overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
    z-index: 55;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* =============== Shell & Content =============== */
.shell { display: grid; grid-template-rows: var(--header-h) 1fr; min-height: 100dvh; }
.content { padding: calc(var(--pad) + 4px); }

/* Page top */
.page-top { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--gap); }
.page-title {
    font-size: var(--h1); font-weight: 800; letter-spacing: 0.2px;
    background: linear-gradient(135deg, #9db3ff, #ffffff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-sub { color: var(--muted); font-size: 0.95rem; }

.search-wrap { position: relative; }
.search-input {
    width: 100%; padding: 12px 14px 12px 40px; border-radius: 14px;
    border: 1px solid var(--glass-bd); background: var(--glass); color: var(--text);
    font-size: 0.95rem;
}
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Overview cards */
.overview-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; }
.overview-card {
    background: var(--glass); border: 1px solid var(--glass-bd);
    border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-1);
}
.overview-card .ic {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, #6c8bff, #7b5ce7); box-shadow: var(--glow);
    margin-bottom: 10px;
}
.overview-value { font-size: 1.6rem; font-weight: 800; }
.overview-label { color: var(--muted); font-size: 0.85rem; }

/* Generic cards */
.grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.card {
    background: var(--glass); border: 1px solid var(--glass-bd);
    border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-1);
    transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--highlight) 60%, white 40%); }
.card .card-icon {
    width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
    background: linear-gradient(135deg, #6c8bff, #7b5ce7); box-shadow: var(--glow);
    font-size: 1.4rem; margin-bottom: 12px;
}
.card .card-title { font-size: var(--h2); font-weight: 700; margin: 6px 0 8px; }
.card .card-description { color: var(--muted); font-size: 0.95rem; }

/* Sections */
.section { display: block; }
.section[hidden] { display: none !important; }

/* =============== Toolbars =============== */
.section-toolbar {
    display:flex; align-items:center; justify-content:space-between;
    gap:12px; padding:12px 16px; margin-bottom:16px;
    border-radius:12px; background:rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.section-toolbar-title { margin:0; font-size:1.125rem; font-weight:700; }
.section-toolbar-sub { margin:2px 0 0 0; opacity:.8; font-size:.925rem; }

/* =============== Buttons (app variants) =============== */
.btn-primary {
    display:inline-flex; align-items:center; gap:8px;
    padding:10px 14px; border:0; border-radius:10px;
    background:#2563eb; color:#fff; font-weight:600; cursor:pointer;
}
.btn-primary:focus { outline:2px solid rgba(37,99,235,.5); outline-offset:2px; }
.btn-primary i { font-size:.95em; }

.btn-secondary { background: rgba(255,255,255,.1); color:#fff; }
.btn-accent { background:#2563eb; color:#fff; }
.btn[disabled] { opacity:.6; cursor:not-allowed; }
.btn-inline { background: rgba(255,255,255,.08); color:#fff; padding:6px 10px; border-radius:8px; border:0; cursor:pointer; font-weight:600; }

/* =============== Modals & Inputs =============== */
.modal-backdrop {
    position: fixed; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}
.modal-backdrop.show { display: flex; }
.modal {
    width: min(520px, 92vw);
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(10px);
}
.modal-header {
    display:flex; align-items:center; justify-content:space-between;
    gap:8px; margin-bottom:8px;
}
.modal-title { margin:0; font-size:1.1rem; font-weight:700; }
.modal-close {
    border:0; background:transparent; color:inherit; cursor:pointer;
    font-size:1.1rem; padding:6px; border-radius:8px;
}
.modal-body { display:grid; gap:12px; margin-top:6px; }
.input-row { display:grid; gap:6px; }
.input-row label { font-size:.9rem; opacity:.9; }
.text-input, .select-input, .textarea-input {
    width:100%; padding:10px 12px; border-radius:10px;
    border:1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06); color:#fff;
}
.text-input::placeholder, .textarea-input::placeholder { color: rgba(255,255,255,.6); }
.textarea-input { min-height: 96px; resize: vertical; }
.modal-actions {
    display:flex; gap:10px; justify-content:flex-end; margin-top:8px;
}
.status { min-height: 20px; font-size:.95rem; }
.status.ok { color:#86efac; }
.status.err { color:#fca5a5; }
.status.info { color:#c7d2fe; }
.helper-row { display:flex; align-items:center; gap:10px; }

.markdown-body {
    display: grid;
    gap: 8px;
    line-height: 1.5;
    color: inherit;
    font-weight: 400;
    white-space: normal;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5 {
    margin: 0;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 20px;
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5 {
    color: #f4efe4;
    font-weight: 900;
    line-height: 1.25;
}

.markdown-body a {
    color: #d8b365;
    text-decoration: none;
    border-bottom: 1px solid rgba(216, 179, 101, 0.45);
}

.markdown-body a:hover {
    border-bottom-color: #d8b365;
}

.markdown-body code {
    border-radius: 5px;
    padding: 2px 5px;
    color: #f6ead2;
    background: rgba(0, 0, 0, 0.28);
    font-size: 0.92em;
}

.markdown-body pre {
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.28);
}

.markdown-body pre code {
    display: block;
    padding: 0;
    background: transparent;
    white-space: pre;
}

.markdown-body blockquote {
    padding: 8px 10px;
    border-left: 3px solid rgba(216, 179, 101, 0.55);
    background: rgba(216, 179, 101, 0.08);
    color: #d7ddcf;
}

.global-search {
    position: relative;
    width: min(430px, 100%);
    margin-left: auto;
}

.global-search-box {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 10px 0 13px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(2, 6, 12, 0.34);
    color: #9aa8ba;
}

.global-search-box:focus-within {
    border-color: rgba(216, 179, 101, 0.62);
    box-shadow: 0 0 0 3px rgba(216, 179, 101, 0.12);
}

.global-search-box input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f4efe4;
    font: inherit;
}

.global-search-box input::placeholder {
    color: #7f8da3;
}

.global-search-clear {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9aa8ba;
    cursor: pointer;
}

.global-search-clear:hover {
    color: #f4efe4;
    background: rgba(255, 255, 255, 0.06);
}

.global-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1300;
    width: min(640px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 128px));
    overflow: auto;
    padding: 7px;
    border: 1px solid rgba(216, 179, 101, 0.18);
    border-radius: 8px;
    background: rgba(12, 14, 10, 0.98);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

.global-search-result {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #d7ddcf;
    text-align: left;
    cursor: pointer;
}

.global-search-result:hover {
    background: rgba(216, 179, 101, 0.1);
}

.global-search-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 7px;
    color: #d8b365;
    background: rgba(216, 179, 101, 0.12);
}

.global-search-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.global-search-title,
.global-search-sub,
.global-search-context {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-title {
    color: #f4efe4;
    font-weight: 900;
}

.global-search-sub,
.global-search-context,
.global-search-type,
.global-search-empty {
    color: #9aa8ba;
    font-size: 0.84rem;
}

.global-search-type {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.global-search-empty {
    padding: 14px;
}

@media (max-width: 760px) {
    .global-search {
        width: 100%;
        margin-left: 0;
    }

    .global-search-result {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .global-search-type {
        display: none;
    }
}

.date-input-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: center;
    gap: 8px;
}

.date-input-shell .date-text-input {
    padding-right: 12px;
}

.date-native-picker {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.date-picker-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: #f4efe4;
    background: rgba(216, 179, 101, 0.12);
    border: 1px solid rgba(216, 179, 101, 0.22);
}

.date-picker-btn:hover {
    background: rgba(216, 179, 101, 0.2);
}

/* =============== Projects List / Spinners =============== */
.projects-center{
    min-height:240px;display:flex;align-items:center;justify-content:center;padding:40px 0;
}
.spinner{
    width:48px;height:48px;border-radius:50%;
    border:4px solid rgba(255,255,255,.2);border-top-color:#2563eb;
    animation:spin 1s linear infinite;
}
.error-panel{
    text-align:center;padding:24px;background:rgba(255,255,255,.06);
    border-radius:12px;box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}
.projects-grid{
    display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px;
}
.project-card{
    background:rgba(255,255,255,.06);border-radius:12px;padding:12px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04);cursor:pointer;
    transition:transform .12s ease,background .12s ease;
}
.project-card:hover{ transform:translateY(-2px); background:rgba(255,255,255,.08); }
.project-thumb{ width:100%; height:150px; border-radius:10px; object-fit:cover; background:rgba(255,255,255,.04); }
.project-meta{ display:flex; align-items:center; justify-content:space-between; margin-top:10px; gap:10px; }
.project-name{ font-weight:700; font-size:1rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-code{ opacity:.85; font-weight:600; }
.entity-id-chip {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    padding: 4px 8px;
    border: 1px solid rgba(216, 179, 101, 0.18);
    border-radius: 8px;
    background: rgba(216, 179, 101, 0.08);
    color: #d8b365;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0;
}
.counts{ display:flex; gap:12px; margin-top:8px; font-size:.95rem; opacity:.9; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.chip{ padding:4px 8px; border-radius:999px; background:rgba(255,255,255,.1); font-size:.85rem; }

/* =============== Responsive =============== */
@media (min-width: 992px) {
    .shell { grid-template-columns: 280px 1fr; grid-template-rows: var(--header-h) 1fr; }
    .sidebar { position: sticky; inset: 0; top: var(--header-h); transform: none; height: calc(100dvh - var(--header-h)); }
    .content { padding: calc(var(--pad) * 1.25) calc(var(--pad) * 1.5); }
    .page-top { flex-direction: row; align-items: center; justify-content: space-between; }
    .overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== Fix native <select> dropdown list colors ===== */
/* Keep the closed control as-is; only change the opened menu options */
.select-input option,
.select-input optgroup {
    color: #1f2937;            /* dark gray text */
    background: #ffffff;       /* white option background */
}

/* When an option is hovered, focused, or selected in the list */
.select-input option:checked,
.select-input option:focus,
.select-input option:hover {
    color: #ffffff;            /* white text on highlight */
    background: #2563eb;       /* your accent blue */
}

/* Some browsers inherit control color into the popup — be explicit */
select.select-input {
    color-scheme: light;       /* prefer light popup styling where supported */
}

/* ===== Make modals fit within the viewport and scroll their content ===== */
.modal-backdrop {
    padding: 16px;                   /* breathing room so edges aren’t clipped */
    align-items: center;             /* center by default */
    overflow-y: auto;                /* allow backdrop to scroll if needed */
}

@media (max-height: 560px) {
    .modal-backdrop {
        align-items: flex-start;       /* pin to top on very short viewports */
    }
}

.modal {
    max-height: 92dvh;               /* never exceed viewport height */
    display: flex;
    flex-direction: column;
    overflow: hidden;                /* contain internal scrolling */
}

.modal-body {
    overflow: auto;                  /* scroll body if content is tall */
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}


/* ===== Modal inner padding (left/right) ===== */
.modal {
    /* keep your existing padding but add a touch more on the sides */
    padding-left: 22px;
    padding-right: 22px;
}

/* Extra breathing room specifically for the scrolling area */
.modal-body {
    padding-inline: 12px;           /* left & right */
    /* keep the scrolling behavior from before */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Optional: align header/footer content with the body edges */
.modal-header,
.modal-actions {
    padding-inline: 12px;
}

/* ===== Pretty scrollbars (modal content only) ===== */
/* Firefox */
.modal-body {
    scrollbar-width: thin;                              /* thin track */
    scrollbar-color: rgba(255,255,255,.35) transparent; /* thumb / track */
}

/* WebKit (Chrome, Edge, Safari) */
.modal-body::-webkit-scrollbar {
    width: 10px;                 /* overall scrollbar width */
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 10px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.28);
    border-radius: 10px;
    border: 2px solid transparent;      /* creates an inset effect */
    background-clip: content-box;       /* keeps thumb rounded & separated */
}
.modal-body:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.4);   /* a bit brighter on hover */
}

/* Optional: darker thumb when the modal is focused for better contrast */
.modal:focus-within .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.5);
}

/* Tickets section layout */
/* ===== Tickets: single-row horizontal layout ===== */
.tickets-toolbar {
    display:flex; align-items:center; justify-content:flex-end; margin-bottom:12px;
}
.tickets-toolbar .pagination { display:flex; align-items:center; gap:10px; }
.tickets-toolbar .page-indicator { min-width:120px; text-align:center; opacity:.9; font-weight:700; }

/* Make the tickets area scroll horizontally when needed */
#ticketsContent { overflow-x:auto; }

/* Each card is one horizontal row with fixed columns */
.ticket-card {
    background: var(--glass);
    border: 1px solid var(--glass-bd);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 12px 14px;

    /* Horizontal grid columns: Project | Status | Title | Description | Assignee | Type | Priority */
    display: grid;
    grid-template-columns:
    minmax(140px, 1fr)
    minmax(120px, 0.9fr)
    minmax(200px, 1.3fr)
    minmax(320px, 2.2fr)
    minmax(140px, 1fr)
    minmax(120px, 0.9fr)
    minmax(120px, 0.9fr);
    gap: 12px;

    /* Force a sensible minimum width so small screens can scroll horizontally */
    min-width: 1220px;
}

/* Column cell styling */
.ticket-cell { display:flex; flex-direction:column; gap:4px; min-width:0; }
.ticket-cell .label { font-size:.75rem; font-weight:700; letter-spacing:.02em; opacity:.75; }
.ticket-cell .value { font-size:.95rem; font-weight:600; }

/* Title & description tweaks */
.ticket-title { font-weight:800; }
.ticket-desc {
    white-space: normal;         /* wrap across multiple lines */
    word-break: break-word;
    line-height: 1.35;
}

/* Subtle status/priority pills if you like */
.pill {
    display:inline-flex; align-items:center; justify-content:center;
    padding: 3px 8px; border-radius: 999px; font-size:.8rem; font-weight:700;
    background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.12);
}


/* Ticket Detail */
.ticket-detail{
    background: var(--glass);
    border: 1px solid var(--glass-bd);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 16px;
}

.td-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.td-heading {
    min-width: 0;
    flex: 1 1 auto;
}
.td-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.td-watch-btn {
    min-width: 112px;
}
.td-watch-btn.is-watching {
    border-color: rgba(110, 231, 183, 0.38);
    color: #b8f7d8;
    background: rgba(16, 185, 129, 0.12);
}
.td-title { font-size: var(--h2); font-weight: 800; }
.td-subtitle { color: var(--muted); font-weight: 600; margin-top: 2px; }

.td-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.td-item{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.td-label{ font-size: .8rem; font-weight: 700; opacity:.8; }
.td-value{ font-weight: 600; }

.td-badges{ display:flex; gap:8px; flex-wrap:wrap; }
.td-description{ margin-top: 16px; }
.td-descbox{
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-bd);
    background: rgba(255,255,255,.04);
    white-space: pre-wrap;
    line-height: 1.45;
}

/* Ticket Detail: inline edit affordances */
.td-value.td-editable.td-can-edit {
    cursor: pointer;
    position: relative;
    min-height: 36px;
    border-radius: var(--radius-sm);
}
.td-value.td-editable.td-can-edit:hover {
    outline: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255,255,255,.035);
}

.td-inline {
    margin-top: 0;
    width: 100%;
    min-width: 0;
}
.td-inline-textwrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    width: 100%;
}
.td-title-editor {
    align-items: center;
}
.td-title-editor .text-input {
    min-height: 46px;
    font: inherit;
    font-size: inherit;
    font-weight: 800;
    line-height: 1.2;
}
.td-inline-controls {
    display: inline-flex;
    gap: 6px;
    padding-top: 1px;
}
.td-inline-date {
    width: 100%;
}
.td-ctrl {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
}
.td-save {
    color: #9af0c8;
}
.td-cancel {
    color: #f0a8a8;
}
.td-ctrl:disabled {
    opacity: .55;
    cursor: wait;
}

/* Settings */
.settings-layout {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.settings-tabs,
.settings-panel {
    background: rgba(15, 23, 32, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.settings-tabs {
    padding: 10px;
}

.settings-tab {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-weight: 750;
    text-align: left;
}

.settings-tab.active {
    border-color: rgba(110, 231, 183, 0.32);
    background: rgba(16, 185, 129, 0.12);
    color: #d8fce9;
}

.settings-panel {
    padding: 20px;
}

.settings-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.settings-panel-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.settings-panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.settings-form {
    display: grid;
    gap: 18px;
    margin-top: 16px;
}

.notification-options {
    display: grid;
    gap: 10px;
}

.notification-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.notification-option:hover {
    border-color: rgba(110, 231, 183, 0.28);
    background: rgba(255, 255, 255, 0.06);
}

.notification-option-copy {
    display: grid;
    gap: 2px;
    font-weight: 700;
}

.notification-option input[type="checkbox"] {
    width: 42px;
    height: 24px;
    accent-color: #34d399;
    flex: 0 0 auto;
}

.settings-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.settings-actions .status {
    margin: 0;
    flex: 1;
}

.api-scope-list {
    display: grid;
    gap: 10px;
}

.api-key-result {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(110, 231, 183, 0.22);
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.08);
}

.api-key-result label {
    color: #d8fce9;
    font-size: 0.82rem;
    font-weight: 800;
}

.api-key-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: center;
}

.api-key-field input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
}

.profile-name-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-name-summary > div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
}

.profile-name-summary span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.profile-name-summary strong {
    color: var(--text);
    font-size: 1rem;
}
.profile-avatar-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}
.profile-avatar-preview {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(216, 179, 101, 0.24);
    background: rgba(7, 8, 6, 0.4);
}
.profile-avatar-picker {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.profile-avatar-picker input[type="file"] {
    width: 100%;
    min-width: 0;
    color: var(--text);
}
.profile-avatar-picker span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}




/* Ticket Detail: Comments */
.td-attachments,
.td-pull-requests,
.td-comments { margin-top: 16px; }
.td-comments .tdc-head {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    margin-bottom: 8px;
}

.attachment-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.attachment-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 8px 10px 8px 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(2, 6, 12, 0.22);
    color: var(--text);
    text-decoration: none;
    min-width: 0;
}

.attachment-card:hover {
    border-color: rgba(154, 240, 200, 0.34);
    background: rgba(255, 255, 255, 0.055);
}

.attachment-preview {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 7px;
    background: rgba(216, 179, 101, 0.11);
    color: #d8b365;
    border: 1px solid rgba(216, 179, 101, 0.14);
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-preview i {
    font-size: 1.35rem;
}

.attachment-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.attachment-name,
.attachment-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-name {
    font-weight: 800;
}

.attachment-meta,
.attachment-open {
    color: var(--muted);
    font-size: .82rem;
}

.attachment-open {
    align-self: start;
    padding-top: 5px;
}

.comment-attachments {
    margin-top: 10px;
}

.comment-attachments .attachment-list {
    grid-template-columns: 1fr;
}

.comment-attachments .empty-state {
    display: none;
}
.tdc-list { display:grid; gap:10px; }
.comment {
    border:1px solid var(--glass-bd); background:rgba(255,255,255,.04);
    border-radius:12px; padding:10px;
}
.comment .meta {
    display:flex; gap:10px; align-items:center; flex-wrap:wrap;
    font-size:.85rem; opacity:.85; margin-bottom:4px; font-weight:700;
}
.comment .msg { white-space:pre-wrap; line-height:1.4; }
.tdc-pagination { display:flex; gap:10px; align-items:center; justify-content:flex-end; margin-top:10px; }
.tdc-page-indicator { min-width:120px; text-align:center; font-weight:700; opacity:.9; }

/* =============== 2026 UI Refresh =============== */
body {
    min-width: 320px;
}

a {
    color: inherit;
    text-decoration: none;
}

.bg-particles {
    display: none;
}

.app-header {
    height: 68px;
    padding: 0 clamp(16px, 3vw, 28px);
    background: rgba(10, 15, 21, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 42px rgba(0, 0, 0, 0.2);
}

.brand {
    gap: 10px;
    min-width: 0;
}

.brand .logo,
.sidebar-logo {
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #155e75);
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
}

.brand .logo {
    width: 38px;
    height: 38px;
    font-size: 0.92rem;
}

.brand .title {
    font-size: 0.98rem;
    letter-spacing: 0;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 32, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.icon-btn:hover {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(56, 189, 248, 0.44);
    transform: translateY(-1px);
}

.shell {
    grid-template-rows: 68px 1fr;
}

.sidebar {
    width: 264px;
    padding: 16px 12px;
    background: rgba(12, 18, 26, 0.94);
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.22);
}

.sidebar-header {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 10px 16px;
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

.sidebar-logo {
    width: 46px;
    height: 46px;
}

.sidebar h3,
.sidebar small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar h3 {
    margin: 0 0 1px;
    font-size: 0.98rem;
}

.nav-section {
    margin: 16px 0;
}

.nav-section-title {
    margin: 0 10px 7px;
    color: #7f8da3;
    letter-spacing: 0.08em;
}

.nav-item {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    border: 1px solid transparent;
}

.nav-item i {
    width: 18px;
    color: #93a4b8;
    text-align: center;
}

.nav-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(148, 163, 184, 0.12);
}

.nav-item.active {
    background: rgba(15, 118, 110, 0.24);
    color: #ecfeff;
    border-color: rgba(45, 212, 191, 0.32);
    box-shadow: inset 3px 0 0 var(--highlight);
}

.nav-item.active i {
    color: var(--highlight);
}

.nav-item .nav-badge {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 999px;
}

.content {
    width: min(100%, 1500px);
    padding: clamp(18px, 3vw, 34px);
}

.page-top {
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.page-title {
    color: #f8fafc;
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: 2rem;
    line-height: 1.12;
    letter-spacing: 0;
}

.page-sub {
    margin-top: 5px;
    color: #9aa7b8;
}

.section-toolbar {
    padding: 16px 18px;
    margin-bottom: 18px;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 32, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: var(--shadow-1);
}

.section-toolbar-title {
    font-size: 1.04rem;
    letter-spacing: 0;
}

.section-toolbar-sub {
    color: #94a3b8;
}

.btn-primary,
.btn-accent,
.btn-secondary,
.btn-inline {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    min-height: 38px;
}

.btn-primary,
.btn-accent {
    background: linear-gradient(135deg, var(--accent), #155e75);
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.18);
}

.btn-secondary,
.btn-inline {
    background: rgba(30, 41, 59, 0.76);
    border-color: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.btn-primary:hover,
.btn-accent:hover,
.btn-secondary:hover,
.btn-inline:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.overview-card,
.card,
.project-card,
.ticket-card,
.ticket-detail,
.comment,
.error-panel {
    background: rgba(15, 23, 32, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.overview-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
}

.overview-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--highlight));
}

.overview-card .ic,
.card .card-icon {
    border-radius: var(--radius-md);
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    box-shadow: none;
}

.overview-value {
    font-size: 1.85rem;
    line-height: 1;
}

.overview-label,
.card .card-description {
    color: #9aa7b8;
}

.card {
    padding: 20px;
}

.card:hover,
.project-card:hover,
.ticket-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px);
}

.projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.project-card {
    padding: 0;
    overflow: hidden;
}

.project-thumb {
    height: 168px;
    border-radius: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.project-meta,
.counts,
.chips {
    padding-inline: 14px;
}

.project-meta {
    margin-top: 14px;
}

.project-name {
    font-size: 1.02rem;
}

.project-code {
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.1);
    color: #bae6fd;
    font-size: 0.8rem;
}

.chips {
    padding-bottom: 14px;
}

.chip,
.pill {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.72);
    color: #dbeafe;
}

#ticketsContent {
    padding-bottom: 10px;
}

.tickets-controls {
    margin-bottom: 12px;
}

.ticket-card {
    min-width: 1120px;
    padding: 14px;
    margin-bottom: 12px;
    grid-template-columns:
        minmax(132px, 1fr)
        minmax(118px, 0.85fr)
        minmax(190px, 1.25fr)
        minmax(280px, 2fr)
        minmax(132px, 0.95fr)
        minmax(110px, 0.85fr)
        minmax(110px, 0.85fr);
}

.ticket-cell {
    padding: 4px 2px;
}

.ticket-cell .label,
.td-label {
    color: #8796aa;
    opacity: 1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
}

.ticket-cell .value {
    color: #e5edf6;
}

.ticket-link {
    color: #7dd3fc;
}

.ticket-detail {
    padding: clamp(16px, 2.4vw, 26px);
}

.td-title {
    font-size: 1.45rem;
    line-height: 1.2;
}

.td-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.td-item,
.td-descbox,
.comment {
    background: rgba(2, 6, 12, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-md);
}

.td-item {
    padding: 12px;
}

.td-descbox {
    padding: 14px;
}

.td-comments .tdc-head {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.comment {
    padding: 12px 14px;
}

.modal-backdrop {
    background: rgba(3, 7, 12, 0.68);
}

.modal {
    background: rgba(15, 23, 32, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
}

.modal-title {
    letter-spacing: 0;
}

.modal-close {
    background: rgba(30, 41, 59, 0.68);
}

.input-row label {
    color: #b6c3d4;
    font-weight: 700;
}

.text-input,
.select-input,
.textarea-input,
.search-input {
    border-radius: var(--radius-sm);
    background: rgba(2, 6, 12, 0.34);
    border-color: rgba(148, 163, 184, 0.24);
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus,
.search-input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.projects-center {
    min-height: 260px;
}

.spinner {
    border-color: rgba(148, 163, 184, 0.22);
    border-top-color: var(--highlight);
}

@media (min-width: 992px) {
    .shell {
        grid-template-columns: 264px 1fr;
        grid-template-rows: 68px 1fr;
    }

    .sidebar {
        top: 68px;
        height: calc(100dvh - 68px);
    }
}

@media (max-width: 720px) {
    .app-header {
        padding-inline: 12px;
    }

    .brand .title {
        display: none;
    }

    .content {
        padding: 16px 12px 24px;
    }

    .page-title {
        font-size: 1.45rem;
    }

    .section-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .section-toolbar-right,
    .section-toolbar-right .btn-primary {
        width: 100%;
    }

    .td-header,
    .settings-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .td-header-actions,
    .td-watch-btn {
        width: 100%;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .notification-option {
        align-items: flex-start;
    }

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

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn,
    .modal-actions .btn-primary,
    .modal-actions .btn-accent,
    .modal-actions .btn-secondary {
        width: 100%;
    }
}

.empty-state {
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 32, 0.72);
    box-shadow: var(--shadow-1);
}

.empty-title {
    font-size: 1.05rem;
    font-weight: 800;
}

.empty-sub {
    margin-top: 4px;
    color: #94a3b8;
}

.user-card {
    cursor: pointer;
}

.user-card .card-icon {
    width: 46px;
    height: 46px;
    font-size: 1rem;
}
.user-card-avatar.card-icon {
    object-fit: cover;
    border-radius: 50%;
}

#cpThumbPicker {
    border-color: rgba(148, 163, 184, 0.26) !important;
    border-radius: var(--radius-md) !important;
    background: rgba(2, 6, 12, 0.26) !important;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

#cpThumbPicker:hover {
    border-color: rgba(56, 189, 248, 0.56) !important;
    background: rgba(15, 23, 42, 0.5) !important;
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: rgba(2, 6, 12, 0.28);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.55);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.72);
    background-clip: content-box;
}

.no-team-page {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 18%, rgba(46, 125, 118, 0.22), transparent 32%),
        radial-gradient(circle at 84% 12%, rgba(216, 179, 101, 0.16), transparent 30%),
        var(--bg);
}

.create-team-page {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 24% 20%, rgba(46, 125, 118, 0.2), transparent 34%),
        radial-gradient(circle at 82% 14%, rgba(216, 179, 101, 0.16), transparent 30%),
        var(--bg);
}

.join-team-page {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 24% 20%, rgba(122, 155, 118, 0.2), transparent 34%),
        radial-gradient(circle at 82% 14%, rgba(216, 179, 101, 0.16), transparent 30%),
        var(--bg);
}

.no-team-shell,
.create-team-shell,
.join-team-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.no-team-panel,
.create-team-panel,
.join-team-panel {
    width: min(680px, 100%);
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    box-shadow: var(--shadow-lg);
}

.no-team-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #10201f;
    background: var(--accent);
    font-size: 1.35rem;
    margin-bottom: 22px;
}

.no-team-kicker {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.no-team-panel h1 {
    margin: 0;
    max-width: 560px;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.02;
}

.no-team-copy {
    max-width: 560px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

.no-team-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.join-team-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.join-team-actions a {
    text-decoration: none;
}

.team-invite-panel,
.team-members-panel {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(216, 179, 101, 0.14);
    border-radius: 8px;
    background: rgba(23, 25, 20, 0.78);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.team-invite-grid {
    display: grid;
    grid-template-columns: minmax(160px, 0.85fr) minmax(220px, 1.2fr) minmax(130px, 0.7fr) auto;
    gap: 12px;
    align-items: end;
}

.member-detail-page {
    display: grid;
    gap: 18px;
}

.member-detail-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 22px;
    border: 1px solid rgba(216, 179, 101, 0.16);
    border-radius: 8px;
    background: rgba(23, 25, 20, 0.82);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.member-detail-avatar {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 900;
    font-size: 1.35rem;
    background: linear-gradient(135deg, rgba(216, 179, 101, 0.32), rgba(113, 160, 118, 0.22));
    border: 1px solid rgba(216, 179, 101, 0.22);
}
.member-detail-avatar.is-image,
.avatar-chip {
    object-fit: cover;
}

.member-detail-identity h1 {
    margin: 0;
    font-size: 1.65rem;
    letter-spacing: 0;
}

.member-detail-identity p {
    margin: 6px 0 0;
    color: var(--muted);
}

.member-detail-id {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.member-detail-id span,
.member-detail-facts span,
.member-detail-row-sub {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.member-detail-id strong {
    font-size: 1.4rem;
}

.member-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 18px;
}

.member-detail-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.member-detail-facts div,
.member-detail-row,
.member-project-row {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.member-detail-facts div {
    display: grid;
    gap: 6px;
    padding: 12px;
}

.member-detail-facts strong {
    overflow-wrap: anywhere;
}

.member-detail-list,
.member-project-list {
    display: grid;
    gap: 10px;
}

.member-detail-row,
.member-project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.member-detail-row-title {
    display: block;
    color: var(--text);
    font-weight: 800;
}

.member-project-row {
    color: var(--text);
    text-decoration: none;
}

.member-project-row:hover {
    border-color: rgba(216, 179, 101, 0.28);
    background: rgba(216, 179, 101, 0.06);
}

.member-project-row > span:last-of-type {
    min-width: 0;
    flex: 1;
}

.member-project-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(216, 179, 101, 0.12);
    color: var(--accent);
}

@media (max-width: 820px) {
    .member-detail-hero,
    .member-detail-grid {
        grid-template-columns: 1fr;
    }

    .member-detail-id {
        justify-items: start;
    }

    .member-detail-facts {
        grid-template-columns: 1fr;
    }
}

.create-team-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 24px;
}

.create-team-back:hover {
    color: var(--text);
}

.create-team-form {
    margin-top: 28px;
}

.create-team-form label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.create-team-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.create-team-input-row input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: rgba(2, 6, 12, 0.32);
    outline: none;
}

.create-team-input-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(216, 179, 101, 0.16);
}

@media (max-width: 640px) {
    .header-page-meta {
        padding-inline: 10px;
    }

    .header-page-subtitle {
        display: none;
    }

    .global-search {
        width: min(220px, 42vw);
    }

    .global-search-box input::placeholder {
        color: transparent;
    }

    .no-team-shell,
    .create-team-shell,
    .join-team-shell {
        padding: 18px;
    }

    .no-team-panel,
    .create-team-panel,
    .join-team-panel {
        padding: 28px;
    }

    .create-team-input-row,
    .team-invite-grid {
        grid-template-columns: 1fr;
    }

    .tickets-advanced-filters {
        grid-template-columns: 1fr;
    }
}

/* =============== Modern Dark Refresh =============== */
.app-header {
    background: rgba(12, 13, 10, 0.9);
    border-bottom: 1px solid rgba(216, 179, 101, 0.16);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.26);
}

.brand .logo,
.sidebar-logo,
.overview-card .ic,
.card .card-icon {
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #12130f;
    box-shadow: 0 16px 32px rgba(216, 179, 101, 0.16);
}

.brand .title {
    color: var(--text);
    font-weight: 800;
}

.icon-btn {
    border-radius: 8px;
    background: rgba(238, 229, 207, 0.055);
    border-color: rgba(216, 179, 101, 0.16);
    color: var(--text);
}

.icon-btn:hover {
    background: rgba(216, 179, 101, 0.12);
    border-color: rgba(216, 179, 101, 0.32);
}

.sidebar {
    background: rgba(16, 18, 13, 0.96);
    border-right: 1px solid rgba(216, 179, 101, 0.14);
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.24);
}

.sidebar-header {
    border-bottom-color: rgba(216, 179, 101, 0.14);
}

.sidebar small,
.nav-section-title,
.page-sub,
.section-toolbar-sub,
.overview-label,
.card .card-description,
.empty-sub,
.project-code,
.ticket-meta,
.td-label,
.comment-meta,
.create-team-form label {
    color: var(--muted);
}

.nav-item {
    border: 1px solid transparent;
    border-radius: 8px;
    color: #d9d1bf;
}

.nav-item:hover {
    background: rgba(238, 229, 207, 0.06);
    border-color: rgba(216, 179, 101, 0.1);
}

.nav-item.active {
    background: rgba(216, 179, 101, 0.16);
    color: #fff6dd;
    border-color: rgba(216, 179, 101, 0.28);
    box-shadow: none;
}

.nav-item.active i {
    color: var(--highlight);
}

.page-title {
    color: var(--text);
    background: none;
    -webkit-text-fill-color: currentColor;
    letter-spacing: 0;
}

.section-toolbar,
.overview-card,
.card,
.project-card,
.ticket-card,
.ticket-detail-panel,
.comments-panel,
.empty-state,
.error-panel,
.modal {
    background: rgba(23, 25, 20, 0.78);
    border: 1px solid rgba(216, 179, 101, 0.14);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.section-toolbar {
    padding: 14px 16px;
}

.card:hover,
.project-card:hover,
.ticket-card:hover {
    transform: translateY(-2px);
    background: rgba(31, 35, 25, 0.86);
    border-color: rgba(216, 179, 101, 0.32);
}

.search-input,
.text-input,
.select-input,
.textarea-input,
.create-team-input-row input {
    background: rgba(7, 8, 6, 0.38);
    border: 1px solid rgba(216, 179, 101, 0.18);
    border-radius: 8px;
    color: var(--text);
}

.search-input:focus,
.text-input:focus,
.select-input:focus,
.textarea-input:focus,
.create-team-input-row input:focus {
    outline: none;
    border-color: rgba(216, 179, 101, 0.68);
    box-shadow: 0 0 0 3px rgba(216, 179, 101, 0.12);
}

.btn-primary,
.btn-accent {
    border: 1px solid rgba(216, 179, 101, 0.42);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #b88b3d);
    color: #14140f;
    box-shadow: 0 12px 28px rgba(216, 179, 101, 0.18);
}

.btn-primary:hover,
.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(216, 179, 101, 0.24);
}

.btn-secondary,
.btn-inline {
    border: 1px solid rgba(216, 179, 101, 0.16);
    border-radius: 8px;
    background: rgba(238, 229, 207, 0.075);
    color: var(--text);
}

.chip,
.status-pill,
.nav-badge {
    background: rgba(122, 155, 118, 0.18);
    color: #dfead5;
    border: 1px solid rgba(122, 155, 118, 0.24);
}

.spinner {
    border-color: rgba(216, 179, 101, 0.16);
    border-top-color: var(--accent);
}

.modal-backdrop {
    background: rgba(5, 6, 4, 0.68);
}

.modal {
    background: rgba(21, 23, 18, 0.96);
}

#cpThumbPicker {
    border-color: rgba(216, 179, 101, 0.22) !important;
    background: rgba(7, 8, 6, 0.28) !important;
}

#cpThumbPicker:hover {
    border-color: rgba(216, 179, 101, 0.48) !important;
    background: rgba(31, 35, 25, 0.52) !important;
}

::-webkit-scrollbar-track {
    background: rgba(7, 8, 6, 0.35);
}

::-webkit-scrollbar-thumb {
    background: rgba(216, 179, 101, 0.42);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(216, 179, 101, 0.64);
    background-clip: content-box;
}

.select-input option,
.select-input optgroup {
    color: #171914;
    background: #eee5cf;
}

.select-input option:checked,
.select-input option:focus,
.select-input option:hover {
    color: #14140f;
    background: var(--accent);
}

.ticket-link,
a {
    color: var(--highlight);
}

.project-code,
.pill {
    background: rgba(216, 179, 101, 0.12);
    color: #f1dfaa;
    border-color: rgba(216, 179, 101, 0.2);
}

.td-item,
.td-descbox,
.comment {
    background: rgba(7, 8, 6, 0.28);
    border-color: rgba(216, 179, 101, 0.14);
}

.input-row label {
    color: #c9bfa8;
}

.ticket-cell .value {
    color: var(--text);
}

/* =============== Project Detail Page =============== */
.project-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 22px;
    align-items: start;
}

.project-main-panel,
.project-side-panel {
    display: grid;
    gap: 18px;
}

.project-hero {
    min-height: 280px;
    overflow: hidden;
    border: 1px solid rgba(216, 179, 101, 0.14);
    border-radius: 8px;
    background: rgba(16, 18, 13, 0.72);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.project-hero img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: block;
    object-fit: cover;
}

.project-hero-empty {
    min-height: 280px;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 3rem;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.project-stat,
.project-panel {
    border: 1px solid rgba(216, 179, 101, 0.14);
    border-radius: 8px;
    background: rgba(23, 25, 20, 0.78);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.project-stat {
    min-height: 92px;
    padding: 18px;
    display: grid;
    align-content: center;
    gap: 6px;
}

.project-stat strong {
    color: var(--text);
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    line-height: 1;
}

.project-stat span {
    color: var(--muted);
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.project-panel {
    padding: 18px;
}

.project-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.project-panel-head h2 {
    margin: 0;
    font-size: 1.08rem;
}

.project-access-list,
.project-ticket-list {
    display: grid;
    gap: 10px;
}

.project-access-user,
.project-ticket-row {
    display: grid;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(216, 179, 101, 0.1);
    border-radius: 8px;
    background: rgba(7, 8, 6, 0.22);
}

.project-access-user {
    grid-template-columns: 42px minmax(0, 1fr);
}

.avatar-chip {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #14140f;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 900;
}

.project-access-name,
.project-ticket-title {
    color: var(--text);
    font-weight: 800;
}

.project-access-email,
.project-ticket-assignee {
    color: var(--muted);
    font-size: 0.86rem;
}

.project-ticket-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(120px, auto);
    color: inherit;
    text-decoration: none;
}

.project-ticket-row:hover {
    border-color: rgba(216, 179, 101, 0.3);
    background: rgba(31, 35, 25, 0.72);
}

.project-access-actions {
    margin-top: 12px;
}

.empty-state.compact {
    padding: 18px;
}

@media (max-width: 980px) {
    .project-detail-layout,
    .project-stats {
        grid-template-columns: 1fr;
    }

    .project-ticket-row {
        grid-template-columns: 1fr;
    }
}

/* =============== Structural Layout Refresh =============== */
@media (min-width: 1024px) {
    body {
        overflow: hidden;
    }

    .app-header {
        position: fixed;
        inset: 0 0 auto 0;
        height: 64px;
        padding-inline: 22px;
    }

    .shell {
        min-height: 100vh;
        display: grid;
        grid-template-columns: 248px minmax(0, 1fr);
        grid-template-rows: 1fr;
        padding-top: 64px;
    }

    .sidebar {
        position: sticky;
        top: 64px;
        height: calc(100vh - 64px);
        width: 248px;
        transform: none;
        inset: auto;
        padding: 18px 14px;
    }

    .content {
        width: 100%;
        max-width: none;
        height: calc(100vh - 64px);
        overflow: auto;
        padding: 28px clamp(28px, 4vw, 56px) 48px;
    }

    .content > .page-top,
    .content > .section,
    .content > section {
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
    }
}

.page-top {
    display: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: 22px;
    border: 1px solid rgba(216, 179, 101, 0.12);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(216, 179, 101, 0.09), transparent 36%),
        rgba(16, 18, 13, 0.72);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.page-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.98;
    max-width: 780px;
}

.page-sub {
    max-width: 620px;
    font-size: 1rem;
}

.section-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 78px;
    margin-bottom: 18px;
}

.section-toolbar-title {
    font-size: 1.22rem;
}

.section-toolbar-right {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.overview-card {
    min-height: 190px;
    display: grid;
    align-content: space-between;
    padding: 22px;
}

.overview-card .ic {
    width: 48px;
    height: 48px;
}

.overview-value {
    font-size: clamp(2.7rem, 6vw, 4.6rem);
    line-height: 0.92;
    margin-top: 24px;
}

.overview-label {
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
}

.projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 22px;
}

.project-card {
    min-height: 340px;
    display: grid;
    grid-template-rows: 190px auto auto 1fr;
}

.project-thumb {
    height: 190px;
}

.project-meta {
    align-items: flex-start;
}

.project-name {
    font-size: 1.12rem;
    white-space: normal;
    line-height: 1.2;
}

.counts {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(216, 179, 101, 0.12);
}

.chips {
    align-content: end;
}

#ticketsContent {
    overflow-x: visible;
}

.tickets-toolbar {
    justify-content: space-between;
    padding: 12px;
    border: 1px solid rgba(216, 179, 101, 0.12);
    border-radius: 8px;
    background: rgba(16, 18, 13, 0.62);
}

.ticket-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.2fr) minmax(260px, 1.4fr) minmax(180px, 0.9fr);
    grid-template-areas:
        "project title title status"
        "project desc desc assignee"
        "type desc desc priority";
    gap: 14px 18px;
    padding: 18px;
}

.ticket-card .ticket-cell:nth-child(1) { grid-area: project; }
.ticket-card .ticket-cell:nth-child(2) { grid-area: status; }
.ticket-card .ticket-cell:nth-child(3) { grid-area: title; }
.ticket-card .ticket-cell:nth-child(4) { grid-area: desc; }
.ticket-card .ticket-cell:nth-child(5) { grid-area: assignee; }
.ticket-card .ticket-cell:nth-child(6) { grid-area: type; }
.ticket-card .ticket-cell:nth-child(7) { grid-area: priority; }

.ticket-cell {
    padding: 10px;
    border-radius: 8px;
    background: rgba(7, 8, 6, 0.18);
}

.ticket-desc {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tickets-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.tickets-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tickets-project-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e8ece2;
    font-weight: 700;
}

.tickets-project-filter .select-input {
    min-width: 220px;
    min-height: 36px;
}

.tickets-advanced-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.ticket-filter-dropdown {
    position: relative;
    display: grid;
    gap: 6px;
    min-width: 0;
}
.ticket-filter-dropdown[data-filter="projectIds"] {
    z-index: 6;
}
.ticket-filter-dropdown.open {
    z-index: 40;
}

.ticket-filter-label {
    color: #e8ece2;
    font-weight: 800;
    font-size: 0.88rem;
}

.ticket-filter-trigger {
    min-height: 40px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(216, 179, 101, 0.16);
    color: #f3f6ed;
    background: rgba(7, 8, 6, 0.38);
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.ticket-filter-trigger span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ticket-filter-trigger i {
    color: #d8b365;
    font-size: 0.72rem;
}

.ticket-filter-dropdown.open .ticket-filter-trigger {
    border-color: rgba(216, 179, 101, 0.42);
    box-shadow: 0 0 0 3px rgba(216, 179, 101, 0.08);
}

.ticket-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    z-index: 30;
    display: none;
    min-width: 240px;
    width: max(100%, min(360px, 86vw));
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(216, 179, 101, 0.2);
    background: rgba(16, 18, 13, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.ticket-filter-dropdown.open .ticket-filter-menu {
    display: grid;
    gap: 10px;
}

.ticket-filter-options {
    display: grid;
    gap: 4px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-color: rgba(216, 179, 101, 0.34) rgba(16, 18, 13, 0.3);
    scrollbar-width: thin;
}

.ticket-filter-option {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #e8ece2;
    font-weight: 700;
    cursor: pointer;
}
.ticket-filter-option span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.ticket-filter-option:hover {
    background: rgba(216, 179, 101, 0.08);
}

.ticket-filter-option input {
    width: 15px;
    height: 15px;
    accent-color: #d8b365;
}

.ticket-filter-empty {
    padding: 10px 8px;
    color: #a7b09e;
    font-weight: 700;
}

.ticket-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(216, 179, 101, 0.1);
}

.ticket-filter-actions .btn-primary,
.ticket-filter-actions .btn-secondary {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
}

.tickets-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e8ece2;
    font-weight: 700;
}

.create-another-check {
    margin-top: 4px;
    justify-content: flex-start;
}

.tickets-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(216, 179, 101, 0.14);
    border-radius: 8px;
    background: rgba(7, 8, 6, 0.34);
}

.tickets-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #aeb7aa;
    font-weight: 800;
    cursor: pointer;
}

.tickets-view-btn.active {
    color: #f6ead2;
    background: rgba(216, 179, 101, 0.18);
    box-shadow: inset 0 0 0 1px rgba(216, 179, 101, 0.18);
}

.tickets-notice {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #f3f6ed;
    border: 1px solid rgba(216, 179, 101, 0.16);
    background: rgba(16, 18, 13, 0.74);
    font-weight: 700;
}

.tickets-notice.success {
    border-color: rgba(74, 222, 128, 0.26);
}

.tickets-notice.error {
    border-color: rgba(248, 113, 113, 0.34);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(var(--kanban-column-count, 6), minmax(260px, 1fr));
    gap: 14px;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    height: clamp(460px, calc(100vh - 330px), 760px);
    min-height: 0;
    padding-bottom: 10px;
}

.kanban-column {
    min-width: 260px;
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
    border: 1px solid rgba(216, 179, 101, 0.12);
    border-radius: 8px;
    background: rgba(16, 18, 13, 0.58);
    overflow: hidden;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(216, 179, 101, 0.1);
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(16, 18, 13, 0.96);
    backdrop-filter: blur(10px);
}

.kanban-column-header h3 {
    margin: 0;
    font-size: 0.92rem;
    color: #f3eadc;
}

.kanban-column-header span {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 24px;
    border-radius: 999px;
    color: #f6ead2;
    background: rgba(216, 179, 101, 0.14);
    font-weight: 900;
    font-size: 0.78rem;
}

.kanban-dropzone {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    transition: background 140ms ease, box-shadow 140ms ease;
    scrollbar-color: rgba(216, 179, 101, 0.34) rgba(16, 18, 13, 0.3);
    scrollbar-width: thin;
}

.kanban-dropzone.drag-over {
    background: rgba(216, 179, 101, 0.08);
    box-shadow: inset 0 0 0 1px rgba(216, 179, 101, 0.24);
}

.kanban-ticket {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(216, 179, 101, 0.12);
    border-radius: 8px;
    background: rgba(7, 8, 6, 0.42);
    cursor: grab;
}
.kanban-status-control {
    display: grid;
    gap: 5px;
    color: #aeb7aa;
    font-size: 0.78rem;
    font-weight: 800;
}
.kanban-status-select {
    min-height: 34px;
    width: 100%;
    font-size: 0.86rem;
    cursor: pointer;
}

.kanban-ticket:active {
    cursor: grabbing;
}

.kanban-ticket.dragging {
    opacity: 0.62;
}

.kanban-ticket-top,
.kanban-ticket-footer,
.kanban-ticket-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kanban-ticket-top {
    justify-content: space-between;
}

.kanban-project,
.kanban-ticket-assignee {
    color: #aeb7aa;
    font-size: 0.82rem;
    font-weight: 800;
}

.kanban-ticket-title {
    color: #f4efe4;
    font-size: 0.96rem;
    line-height: 1.25;
}

.kanban-ticket-desc {
    margin: 0;
    color: #cdd4c6;
    font-size: 0.85rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-empty {
    min-height: 72px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(216, 179, 101, 0.18);
    border-radius: 8px;
    color: #879083;
    font-weight: 800;
}

.tickets-page-note {
    margin-top: 10px;
    color: #aeb7aa;
    font-size: 0.88rem;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    color: #16180f;
    background: #d8b365;
    font-size: 0.68rem;
    font-weight: 900;
}

#notifBtn {
    position: relative;
}

.notifications-panel {
    position: fixed;
    top: 62px;
    right: 18px;
    z-index: 1200;
    width: min(380px, calc(100vw - 28px));
    max-height: min(560px, calc(100vh - 84px));
    overflow: auto;
    border: 1px solid rgba(216, 179, 101, 0.18);
    border-radius: 8px;
    background: rgba(12, 14, 10, 0.98);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

.notifications-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid rgba(216, 179, 101, 0.12);
    background: rgba(12, 14, 10, 0.98);
}

.notifications-mark {
    border: 0;
    border-radius: 6px;
    padding: 7px 10px;
    color: #f6ead2;
    background: rgba(216, 179, 101, 0.14);
    font-weight: 800;
    cursor: pointer;
}

.notifications-mark:disabled {
    opacity: 0.45;
    cursor: default;
}

.notifications-list {
    display: grid;
}

.notification-item {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid rgba(216, 179, 101, 0.08);
    background: transparent;
    color: #d7ddcf;
    text-align: left;
    cursor: pointer;
}

.notification-item.unread {
    background: rgba(216, 179, 101, 0.08);
}

.notification-title {
    color: #f4efe4;
    font-weight: 900;
}

.notification-message {
    line-height: 1.35;
}

.notification-time,
.notifications-empty {
    color: #879083;
    font-size: 0.82rem;
    font-weight: 700;
}

.notifications-empty {
    padding: 18px 14px;
}

.td-activity {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(216, 179, 101, 0.12);
    border-radius: 8px;
    background: rgba(16, 18, 13, 0.48);
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: start;
}

.activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: #d8b365;
    box-shadow: 0 0 0 4px rgba(216, 179, 101, 0.12);
}

.activity-body {
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(216, 179, 101, 0.08);
}

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

.activity-line {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    color: #e8ece2;
    line-height: 1.35;
}

.activity-line strong {
    color: #f6ead2;
}

.activity-time {
    margin-top: 4px;
    color: #879083;
    font-size: 0.82rem;
    font-weight: 700;
}

.team-role-row {
    margin-top: 6px;
}

.team-role-select {
    min-height: 34px;
    width: 100%;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(216, 179, 101, 0.18);
    color: #f6ead2;
    background: rgba(216, 179, 101, 0.12);
    font-size: 0.82rem;
    font-weight: 900;
}

.release-create-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.6fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.project-edit-grid {
    display: grid;
    gap: 12px;
}

.project-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.project-delete-box {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(248, 113, 113, 0.18);
}

.project-delete-box strong {
    color: #fecaca;
}

.project-delete-box p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.project-delete-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(248, 113, 113, 0.32);
    border-radius: 8px;
    color: #fee2e2;
    background: rgba(127, 29, 29, 0.52);
    font-weight: 900;
    cursor: pointer;
}

.btn-danger:hover {
    background: rgba(153, 27, 27, 0.68);
}

.btn-danger:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.release-list {
    display: grid;
    gap: 10px;
}

.td-subtasks {
    margin-top: 18px;
}

.td-subtask-list {
    display: grid;
    gap: 10px;
}

.td-subtask-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(216, 179, 101, 0.12);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    background: rgba(7, 8, 6, 0.22);
}

.td-subtask-row:hover {
    border-color: rgba(216, 179, 101, 0.26);
    background: rgba(216, 179, 101, 0.06);
}

.td-subtask-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.td-subtask-create {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr) auto;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
}

.release-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.7fr);
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(216, 179, 101, 0.12);
    border-radius: 8px;
    background: rgba(7, 8, 6, 0.22);
}

.release-name {
    color: #f4efe4;
    font-weight: 900;
}

.release-meta {
    margin-top: 4px;
    color: #879083;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: capitalize;
}

/* Next release / Released badges and the manage controls (js/release.controls.js). */
.release-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.release-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.release-badge.is-next {
    color: #d8b365;
    background: rgba(216, 179, 101, 0.12);
    border-color: rgba(216, 179, 101, 0.35);
}

.release-badge.is-released {
    color: #9cc59a;
    background: rgba(122, 155, 118, 0.14);
    border-color: rgba(122, 155, 118, 0.35);
}

.release-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Project name on the global Releases page — same scale as .release-meta but
   without the capitalize, so project names keep their own casing. */
.release-project {
    margin-top: 4px;
    color: #b6bfb2;
    font-size: 0.82rem;
    font-weight: 800;
}

.release-progress {
    display: grid;
    gap: 4px;
}

.release-progress-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(216, 179, 101, 0.12);
}

.release-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #d8b365;
}

.team-content .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.user-card {
    min-height: 210px;
    display: grid;
    align-content: start;
    gap: 8px;
}

.user-card .card-icon {
    width: 52px;
    height: 52px;
}

.no-team-shell,
.create-team-shell,
.join-team-shell {
    align-items: stretch;
    justify-items: center;
    padding-top: clamp(48px, 8vh, 92px);
}

.no-team-panel,
.create-team-panel,
.join-team-panel {
    align-self: start;
    display: grid;
    gap: 4px;
    width: min(760px, 100%);
    padding: clamp(32px, 5vw, 56px);
}

@media (max-width: 920px) {
    .overview-grid,
    .projects-grid,
    .team-content .grid {
        grid-template-columns: 1fr;
    }

    .ticket-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "project"
            "title"
            "status"
            "desc"
            "assignee"
            "type"
            "priority";
    }

    .section-toolbar {
        grid-template-columns: 1fr;
    }

    .tickets-advanced-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kanban-board {
        grid-template-columns: repeat(var(--kanban-column-count, 6), minmax(240px, 78vw));
        height: clamp(420px, calc(100vh - 280px), 680px);
    }

    .release-create-grid,
    .release-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-header {
        gap: 8px;
        padding-inline: 10px;
    }

    .brand {
        gap: 8px;
        min-width: 0;
    }

    .brand .logo {
        width: 36px;
        height: 36px;
        font-size: 0.86rem;
    }

    .header-actions {
        gap: 6px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        flex: 0 0 auto;
    }

    .header-page-meta {
        min-width: 0;
        padding-inline: 6px;
    }

    .header-page-title {
        font-size: 0.98rem;
    }

    .global-search {
        width: min(190px, 38vw);
    }

    .content {
        padding: 14px 10px 22px;
    }

    .section-toolbar,
    .tickets-toolbar,
    .tickets-controls,
    .ticket-card,
    .project-panel,
    .ticket-detail,
    .settings-panel {
        border-radius: 8px;
    }

    .section-toolbar-right,
    .modal-actions,
    .project-panel-head,
    .tickets-control-row,
    .ticket-filter-actions,
    .settings-actions,
    .project-delete-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .section-toolbar-right,
    .section-toolbar-right .btn-primary,
    .modal-actions .btn-primary,
    .modal-actions .btn-secondary,
    .project-action-row .btn-primary,
    .project-delete-actions .btn-danger,
    .project-delete-actions .text-input,
    .ticket-filter-actions .btn-primary,
    .ticket-filter-actions .btn-secondary,
    .settings-actions .btn-primary {
        width: 100%;
    }

    .modal-backdrop {
        align-items: end;
        padding: 10px;
    }

    .modal {
        width: 100%;
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
    }

    .overview-grid,
    .projects-grid,
    .project-stats,
    .profile-name-summary,
    .settings-layout,
    .settings-actions,
    .notification-option,
    .api-key-field,
    .profile-avatar-row,
    .release-create-grid,
    .release-row,
    .td-subtask-create,
    .td-subtask-row {
        grid-template-columns: 1fr;
    }

    .project-panel-head {
        display: grid;
        gap: 10px;
    }

    .project-ticket-row,
    .member-project-row {
        grid-template-columns: 1fr;
    }

    .project-access-user {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .ticket-card {
        gap: 10px;
        padding: 12px;
    }

    .ticket-cell {
        padding: 9px;
    }

    .tickets-view-toggle,
    .tickets-view-btn {
        width: 100%;
    }

    .tickets-view-btn {
        justify-content: center;
    }

    .ticket-filter-menu {
        position: fixed;
        inset: auto 10px 10px 10px;
        width: auto;
        max-height: min(420px, calc(100dvh - 84px));
        overflow: hidden;
    }

    .ticket-filter-options {
        max-height: min(280px, calc(100dvh - 190px));
    }

    .kanban-board {
        height: clamp(420px, calc(100dvh - 245px), 620px);
        margin-inline: -2px;
        padding-inline: 2px;
        grid-template-columns: repeat(var(--kanban-column-count, 6), minmax(230px, 86vw));
    }

    .kanban-column {
        min-width: 230px;
    }

    .td-header {
        gap: 12px;
    }

    .td-inline-textwrap {
        grid-template-columns: 1fr;
    }

    .td-inline-controls {
        justify-content: flex-end;
    }

    .td-subtask-title {
        white-space: normal;
    }

    .no-team-panel,
    .create-team-panel,
    .join-team-panel {
        padding: 22px;
    }
}

@media (max-width: 420px) {
    .header-page-meta {
        display: none;
    }

    .global-search {
        width: 44px;
    }

    .global-search-box {
        grid-template-columns: 1fr;
    }

    .global-search-box input {
        color: transparent;
        caret-color: var(--text);
    }

    .global-search-box input:focus {
        color: var(--text);
    }

    .sidebar {
        width: min(280px, 88vw);
    }
}
