/* ========================================
   CSS VARIABLES (SAFE - only colors)
   ======================================== */
   :root {
    --white: #ffffff;
    --purple: #bb86fc;
    --purple-dark: #7c4dff;
    --purple-darker: #3700b3;
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-hover: #2a2a2a;
    --bg-header: #6200ea;
    --text: #e0e0e0;
    --text-muted: #b0b0b0;
    --green: #4caf50;
    --red: #ff6b6b;
    --border: 1px solid #333;
    --radius: 5px;
    --radius-md: 8px;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    --transition: 0.3s ease;

    /* ── Table column widths (adjust these to fine-tune) ── */
    --col-logo:       90px;
    --col-name:       200px;
    --col-display:    200px;
    --col-members:    110px;
    --col-created:    150px;
    --col-updated:    150px;
    --col-tags:       150px;
    /* Info column gets all remaining space automatically */
}

/* ======================================== */
body {
    background-color: var(--bg-body);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
}

h1 {
    color: var(--white);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.promoted {
    border: 2px solid var(--green);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin: 30px 0;
}

/* ── Fixed column widths (uses variables from :root) ── */
th:nth-child(1), td:nth-child(1) { width: var(--col-logo); }
th:nth-child(2), td:nth-child(2) { width: var(--col-name); }
th:nth-child(3), td:nth-child(3) { width: var(--col-display); }
th:nth-child(4), td:nth-child(4) { width: var(--col-members); }
th:nth-child(5), td:nth-child(5) { width: var(--col-created); }
th:nth-child(6), td:nth-child(6) { width: var(--col-updated); }
th:nth-child(7), td:nth-child(7) { width: var(--col-tags); }
/* Column 8 (Info) takes remaining space — no width set */

/* Prevent text overflow in fixed columns */
td { overflow: hidden; text-overflow: ellipsis; }
td.info-cell, td.tags-cell { overflow: visible; }

thead th {
    background-color: var(--bg-header);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: default;
}

th, td {
    padding: 15px;
    text-align: left;
    background-color: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    transition: transform 0.2s ease, background-color var(--transition);
}

tr:hover td {
    background-color: var(--bg-hover);
    transform: translateY(-2px);
}

/* Sortable header styling */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 0;
}

th.sortable:hover {
    background-color: var(--purple-dark);
}

th.sortable form {
    margin: 0;
    padding: 0;
    display: contents;
}

th.sortable .sort-btn {
    appearance: none;
    display: block;
    width: 100%;
    padding: 15px;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-align: left;
}

th.sortable .sort-indicator {
    display: inline-block;
    margin-left: 8px;
    color: var(--white);
    font-size: 0.8em;
    opacity: 0.9;
    min-width: 10px;
}

/* Info search validation styles */
.info-search-wrapper {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.info-search-wrapper input[type="text"] {
    width: 100%;
    min-width: 0;
}

.input-error {
    border: 2px solid var(--red) !important;
    background-color: rgba(255, 107, 107, 0.1) !important;
}

.info-search-error {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    padding: 6px 10px;
    background-color: var(--red);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow);
}

/* Legacy sort classes (if needed) */
.sort-asc::after {
    content: " \25B2";
    color: var(--text-muted);
    margin-left: 5px;
}

.sort-desc::after {
    content: " \25BC";
    color: var(--text-muted);
    margin-left: 5px;
}

.pagination { 
    margin: 0 0 20px 0;
    text-align: center; 
    font-size: 1.1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-body);
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pagination .pagination-btn { 
    margin: 0 5px;
    text-decoration: none; 
    color: var(--purple);
    padding: 8px 12px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    transition: background-color var(--transition), color var(--transition), transform 0.2s ease;
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    border: none;
    font-size: 0.9rem;
}

.pagination .pagination-btn:hover { 
    background-color: var(--purple-darker);
    color: var(--white);
    transform: translateY(-2px);
}

.pagination .pagination-btn:disabled { 
    background-color: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.pagination .pagination-input { 
    padding: 8px;
    background-color: var(--bg-card);
    border: var(--border);
    color: var(--text);
    border-radius: var(--radius);
    width: 60px;
    transition: border-color var(--transition);
    font-family: inherit;
    text-align: center;
    font-size: 0.9rem;
}

.pagination .pagination-input:focus { 
    border-color: var(--purple);
    outline: none;
}

.pagination-ellipsis {
    color: var(--text-muted);
    margin: 0 5px;
    font-size: 0.9rem;
}

#pagination-form {
    display: inline;
}

/* ——————— TOP BAR (nav + search unified) ——————— */
.top-bar {
    position: relative;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 20px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow);
}

.top-bar .top-nav {
    flex-shrink: 0;
    padding: 0;
    background: none;
    gap: 8px;
}

.top-bar .profile-pic {
    width: 34px;
    height: 34px;
}

.top-bar .notification-info {
    margin-right: 0;
}

.top-bar .notification-icon {
    font-size: 1.2rem;
}

/* ——————— SEARCH TOOLBAR (compact) ——————— */
.search-toolbar {
    flex: 1;
    min-width: 0;
}

.search-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.search-row > input[type="text"],
.search-row .info-search-wrapper input[type="text"] {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    padding: 8px 10px;
    background-color: var(--bg-hover);
    border: 1px solid #444;
    color: var(--text);
    border-radius: var(--radius);
    font-size: 0.85rem;
    transition: border-color var(--transition);
}

.search-row > input[type="text"]:focus,
.search-row .info-search-wrapper input[type="text"]:focus {
    border-color: var(--purple);
    outline: none;
}

.search-row .search-tag-autocomplete {
    position: relative;
    z-index: 200;
    flex: 1;
    min-width: 140px;
    max-width: 220px;
}

.search-btn {
    padding: 8px 16px;
    background-color: var(--bg-header);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color var(--transition);
}

.search-btn:hover {
    background-color: var(--purple-dark);
}

.filter-toggle-btn {
    padding: 8px 14px;
    background-color: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid #444;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-toggle-btn:hover {
    border-color: var(--purple);
    color: var(--text);
}

.filter-arrow {
    font-size: 0.7rem;
}

/* ——————— FILTER PANEL (collapsible via div + Hyperscript) ——————— */
.filter-panel {
    display: none;
    padding: 10px 0 4px 0;
    border-top: 1px solid #333;
    margin-top: 10px;
}

.filter-panel.filter-panel--open {
    display: block;
}

.filter-arrow {
    transition: transform var(--transition);
    display: inline-block;
}

.filter-arrow.filter-arrow--open {
    transform: rotate(180deg);
}

/* ——————— FLASH TOAST NOTIFICATIONS ——————— */
.page-flash {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.page-flash .flash-success {
    background: #1b5e20;
    color: #81c784;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: 1px solid #4caf50;
    animation: flash-fadeout 5s forwards;
}

.page-flash .flash-error {
    background: #5e1b1b;
    color: #ff6b6b;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: 1px solid #ff6b6b;
    animation: flash-fadeout 5s forwards;
}

.page-flash .flash-danger {
    background: #5e1b1b;
    color: #ff6b6b;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: 1px solid #ff6b6b;
    animation: flash-fadeout 5s forwards;
}

@keyframes flash-fadeout {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Admin tables (manage_tags, etc.) — auto layout, no fixed column widths */
.admin-table {
    table-layout: auto;
}
.admin-table th,
.admin-table td {
    width: auto;
    overflow: visible;
}
.admin-table .admin-btn {
    min-width: auto;
    padding: 4px 10px;
    font-size: 0.85em;
}

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

.filter-member-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-member-label input[type="number"] {
    width: 70px;
    padding: 6px 8px;
    background-color: var(--bg-hover);
    border: 1px solid #444;
    color: var(--text);
    border-radius: var(--radius);
    font-size: 0.82rem;
    transition: border-color var(--transition);
}

.filter-member-label input[type="number"]:focus {
    border-color: var(--purple);
    outline: none;
}

.filter-apply-btn {
    padding: 6px 14px;
    background-color: var(--bg-header);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background-color var(--transition);
}

.filter-apply-btn:hover {
    background-color: var(--purple-dark);
}

/* ——————— LEGACY: search-box + add-box (kept for other pages) ——————— */
.search-box, .add-box {
    margin: 20px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box input, .search-box textarea, .add-box input, .add-box textarea {
    padding: 10px;
    background-color: var(--bg-card);
    border: var(--border);
    color: var(--text);
    border-radius: var(--radius);
    width: 200px;
    transition: border-color var(--transition);
}

.search-box input:focus, .search-box textarea:focus, .add-box input:focus, .add-box textarea:focus {
    border-color: var(--purple);
    outline: none;
}

.search-box button, .add-box button {
    padding: 10px 20px;
    background-color: var(--bg-header);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--transition);
}

.search-box button:hover, .add-box button:hover {
    background-color: var(--purple-dark);
}

/* Mobile: top bar and search toolbar stack vertically */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .top-bar .top-nav {
        justify-content: flex-end;
        border-top: 1px solid #333;
        padding-top: 8px;
    }
    .search-row {
        flex-direction: column;
    }
    .search-row > input[type="text"],
    .search-row .search-tag-autocomplete {
        max-width: 100%;
        width: 100%;
    }
    .search-row > button {
        width: 100%;
    }
    .filter-panel-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-member-label {
        justify-content: space-between;
    }
    .filter-member-label input[type="number"] {
        width: 100px;
    }
}

.error {
    color: var(--red);
    text-align: center;
    margin-top: 10px;
}

img { 
    max-width: 80px; 
    border-radius: var(--radius); 
    border: 2px solid var(--purple);
}

.members-cell { 
    position: relative; 
}

.members-list { 
    display: none; 
    position: absolute; 
    background: var(--bg-card); 
    border: var(--border); 
    padding: 10px; 
    z-index: 1; 
    color: var(--text); 
    border-radius: var(--radius); 
    box-shadow: var(--shadow);
}

.expand-btn { 
    cursor: pointer; 
    color: var(--purple); 
    text-decoration: underline; 
}

.expand-btn:hover { 
    color: var(--white); 
}

a { 
    color: var(--purple); 
    text-decoration: none; 
    transition: color var(--transition);
}

a:hover { 
    color: var(--white);
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--bg-body);
}


.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: var(--text);
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--purple);
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1200;
    min-width: 150px;
    padding: 10px;
}


.dropdown-menu a {
    display: block;
    padding: 8px 10px;
    color: var(--purple);
    text-decoration: none;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background-color: var(--bg-hover);
    color: var(--white);
}

.dropdown-menu span {
    display: block;
    padding: 8px 10px;
    color: var(--text);
    font-weight: bold;
}

.dropdown-menu span.welcome-text {
    white-space: nowrap;
}

.dropdown-menu span.welcome-text a {
    display: inline;
    padding: 0;
    background: none;
}

.search-box, .pagination, table {
    margin: 20px;
}

@media (max-width: 600px) {
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .user-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .dropdown-menu {
        position: static;
        width: 100%;
    }
}

.team-box {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.members-section {
    margin-top: 15px;
}

.members-toggle {
    display: none;
}

.members-label {
    cursor: pointer;
    color: var(--purple);
    margin-left: 5px;
}

.members-box {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: var(--bg-hover);
    border-radius: var(--radius);
}

.members-toggle:checked ~ .members-box {
    display: block;
}

.no-members {
    margin-top: 10px;
    color: var(--text-muted);
}

.banner, .thumbnail {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 10px 0;
}

select {
    padding: 10px;
    background-color: var(--bg-card);
    border: var(--border);
    color: var(--text);
    border-radius: var(--radius);
    width: 220px;
    transition: border-color var(--transition);
}

select:focus {
    border-color: var(--purple);
    outline: none;
}

textarea {
    background: var(--bg-card);
    color: var(--text);
    border: var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: inherit;
    resize: vertical;
    box-sizing: border-box;
}

textarea:focus {
    border-color: var(--purple);
    outline: none;
}

/* ——————— FILTER CHECKBOXES ——————— */
.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background-color: var(--bg-hover);
    border: 1px solid #444;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.filter-checkbox:hover {
    background-color: var(--bg-hover);
    border-color: var(--purple);
    color: var(--text);
    transform: translateY(-1px);
}

/* Hide native checkbox */
.filter-checkbox input[type="checkbox"] {
    display: none;
}

/* Custom check indicator */
.filter-checkbox::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 2px solid #555;
    background-color: transparent;
    transition: all var(--transition);
    flex-shrink: 0;
}

.filter-checkbox:hover::before {
    border-color: var(--purple);
}

/* Checked state */
.filter-checkbox:has(input:checked) {
    background-color: rgba(98, 0, 234, 0.25);
    border-color: var(--purple);
    color: var(--white);
    box-shadow: 0 0 12px rgba(187, 134, 252, 0.2), inset 0 0 8px rgba(187, 134, 252, 0.05);
}

.filter-checkbox:has(input:checked)::before {
    background-color: var(--purple);
    border-color: var(--purple);
    box-shadow: 0 0 6px rgba(187, 134, 252, 0.5);
}

.filter-checkbox:has(input:checked):hover {
    background-color: rgba(98, 0, 234, 0.35);
    box-shadow: 0 0 16px rgba(187, 134, 252, 0.3), inset 0 0 8px rgba(187, 134, 252, 0.08);
    transform: translateY(-1px);
}

.success {
    color: var(--green);
    text-align: center;
    margin: 10px 0;
}

.progress-bar {
    width: 220px;
    height: 10px;
    background-color: var(--bg-hover);
    border-radius: var(--radius);
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background-color: var(--purple);
    transition: width var(--transition);
}

.dropdown-menu a.active {
    background-color: var(--purple-darker);
    color: var(--white);
    font-weight: bold;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    color: var(--text);
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.clear-filters {
    text-align: center;
    margin: 10px 0;
}

.clear-filters-btn {
    padding: 8px 14px;
    background-color: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition);
}

.clear-filters-btn:hover {
    background-color: rgba(255, 107, 107, 0.15);
    color: #ff8a8a;
}

.analytics-box {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.analytics-box h2 {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-box p {
    color: var(--text);
    margin: 10px 0;
}

.analytics-box canvas {
    max-width: 100%;
    margin: 20px 0;
}

.analytics-box ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.analytics-box ul li {
    color: var(--text);
    padding: 5px 0;
    font-size: 0.9rem;
}

.analytics-box ul.team-member-changes li.gained {
    color: #00bcd4;
}

.analytics-box ul.team-member-changes li.lost {
    color: var(--red);
}

.highlight-number {
    color: var(--purple);
    font-weight: 700;
    font-size: 1.0rem;
    background-color: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    transition: background-color var(--transition), transform 0.2s ease;
}

.highlight-number:hover {
    background-color: var(--purple-darker);
    transform: translateY(-1px);
}

.notification-info {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.notification-icon {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--purple);
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1200;
    min-width: 250px;
    padding: 10px;
}

details.profile-details[open] .dropdown-menu {
    display: block;
}

details.notification-details[open] .notification-dropdown {
    display: block;
}

.notification-header {
    color: var(--text);
    font-weight: bold;
    padding: 8px 10px;
    border-bottom: var(--border);
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 5px 0;
}

.notification-item {
    position: relative;
    padding: 10px;
    border-bottom: var(--border);
    background-color: var(--bg-card);
    color: var(--text);
}

.notification-item.unread {
    background-color: var(--bg-hover);
}

.notification-close {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
}

.notification-close:hover {
    color: #ff5555;
}

.notification-item p {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
}

.notification-link {
    color: var(--purple);
    margin-right: 10px;
}

.notification-link:hover {
    color: var(--white);
}

.notification-date {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 5px;
}

.mark-read-btn {
    padding: 5px 10px;
    background-color: var(--bg-header);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8rem;
}

.mark-read-btn:hover {
    background-color: var(--purple-dark);
}

.load-more-notifications,
.notification-load-more {
    display: block;
    width: 100%;
    padding: 8px 10px;
    color: var(--purple);
    text-align: center;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
}

.load-more-notifications:hover,
.notification-load-more:hover {
    background-color: var(--bg-hover);
    color: var(--white);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--purple);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border: 1px solid var(--bg-card);
    display: none;
}

.team-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px auto;
    max-width: 1200px;
    justify-content: center;
}

.hidden { display: none !important; }

.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    color: var(--text);
    position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--purple);
}

.modal-close:hover { color: var(--white); }

.team-claim-btn:hover .team-box {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(187, 134, 252, 0.3);
}

.team-details-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.team-box h2 {
    margin: 0 0 10px;
    color: var(--white);
    font-size: 2rem;
}

.team-name {
    color: var(--purple);
    font-weight: normal;
    font-size: 1.2rem;
}

.team-id {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.team-meta {
    margin: 15px 0;
    font-size: 1.1rem;
}

.team-info {
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--purple);
}

.info-content {
    margin-top: 8px;
    line-height: 1.6;
    color: var(--text);
}

.info-content pre {
    background: var(--bg-hover);
    padding: 10px;
    border-radius: var(--radius);
    overflow-x: auto;
}

/* ——————— TAG PILLS ——————— */
td.tags-cell {
    min-width: 150px;
}

.tag-pill {
    display: inline-block;
    padding: 2px 8px;
    margin: 1px;
    background-color: var(--purple-darker);
    color: var(--white);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.tag-pill--clickable {
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--white);
    background-color: var(--purple-darker);
    padding: 2px 8px;
    border-radius: 12px;
}

.tag-pill--clickable:hover {
    background-color: var(--purple);
    box-shadow: 0 0 8px rgba(187, 134, 252, 0.4);
    transform: translateY(-1px);
}

/* Search tag autocomplete wrapper */
.search-tag-autocomplete {
    position: relative;
}

.search-tag-autocomplete .tag-input-wrap {
    min-height: 32px;
    padding: 3px 8px;
    background-color: var(--bg-hover);
    border-color: #444;
}

.search-tag-autocomplete .tag-search-input {
    font-size: 0.85rem;
    min-width: 80px;
}

.search-tag-autocomplete .tag-editor-pill {
    padding: 2px 8px;
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

/* ——————— TAG EDITOR ——————— */
.tag-editor {
    position: relative;
    margin: 8px 0 15px 0;
}

.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 42px;
    padding: 6px 10px;
    background-color: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    cursor: text;
    transition: border-color var(--transition);
}

.tag-input-wrap:focus-within {
    border-color: var(--purple);
}

.tag-editor-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background-color: var(--purple-darker);
    color: var(--white);
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Admin-only tag pill styling */
.tag-editor-pill--admin {
    background-color: #d32f2f;
    border: 1px solid #ff5252;
}

.tag-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    transition: color var(--transition);
}

.tag-remove:hover {
    color: var(--white);
}

.tag-search-input {
    flex: 1;
    min-width: 120px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    padding: 4px 0;
}

.tag-search-input::placeholder {
    color: var(--text-muted);
}

/* Suggestions dropdown */
.tag-suggestions {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 100;
    background-color: var(--bg-card);
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.tag-suggestions:empty {
    display: none;
}

.tag-suggestion-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tag-suggestion-item:hover {
    background-color: rgba(98, 0, 234, 0.25);
    color: var(--white);
}

.tz-suggestion-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tz-suggestion-item:hover {
    background-color: rgba(98, 0, 234, 0.25);
    color: var(--white);
}

/* Admin-only suggestion styling */
.tag-suggestion-item--admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-admin-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    background-color: #d32f2f;
    color: var(--white);
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tag-editor-actions {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.team-link {
    margin: 20px 0;
    text-align: center;
}

.team-link a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-header);
    color: white;
    border-radius: var(--radius);
    font-weight: bold;
}

.team-link a:hover {
    background: var(--purple-dark);
}

.admin-controls {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: var(--border);
}

.admin-controls h3 {
    margin: 0 0 15px;
    color: var(--purple);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.admin-btn {
    padding: 10px 16px;
    background: var(--bg-header);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
    min-width: 120px;
    text-align: center;
}

.admin-btn:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

.admin-btn[data-on] {
    background: #d32f2f;
}

.admin-btn[data-on][data-promoted] {
    background: var(--green);
}

.admin-btn[data-on][data-deleted] {
    background: #ff5555;
}

.admin-btn[data-on]:hover {
    background: #b71c1c;
}

.admin-btn[data-on][data-promoted]:hover {
    background: #388e3c;
}

.admin-btn[data-on][data-deleted]:hover {
    background: #e53935;
}

.edit-input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: var(--bg-card);
    border: var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-family: inherit;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.edit-input:focus {
    border-color: var(--purple);
    outline: none;
}

.edit-button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.left-buttons,
.right-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.right-buttons .admin-btn {
    min-width: 140px;
}

@media (max-width: 600px) {
    .edit-button-group {
        flex-direction: column;
        align-items: stretch;
    }
    .left-buttons,
    .right-buttons {
        justify-content: center;
    }
    .right-buttons {
        margin-top: 10px;
    }
    .right-buttons .admin-btn {
        width: 100%;
    }
}

.dashboard-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.dashboard-title {
    text-align: center;
    color: var(--white);
    font-size: 2.2rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-card {
    background-color: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.dashboard-card h2 {
    color: var(--purple);
    margin: 0 0 15px;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background-color: var(--bg-hover);
    border-radius: var(--radius-md);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--purple);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item.open .stat-number { color: var(--red); }
.stat-item.pending .stat-number { color: #ff9800; }
.stat-item.closed .stat-number { color: var(--green); }
.stat-item.hidden .stat-number { color: #78909c; }
.stat-item.promoted .stat-number { color: var(--green); }
.stat-item.claimed .stat-number { color: #00bcd4; }
.stat-item.banned .stat-number { color: #ff5555; }


/* ——————— TEAMS OVERVIEW: FORCE 2 ROWS ——————— */
.teams-card .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 18px;
}

/* big screens = exactly 4 per row → forces 2 rows for 7 items */
@media (min-width: 800px) {
    .teams-card .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* medium screens = 3 per row → still 2 rows + 1 leftover (looks balanced) */
@media (min-width: 600px) and (max-width: 799px) {
    .teams-card .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dashboard-btn {
    display: block;
    margin-top: 15px;
    padding: 10px 16px;
    background-color: var(--bg-header);
    color: white;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.dashboard-btn:hover {
    background-color: var(--purple-dark);
    transform: translateY(-1px);
}

.update-status {
    text-align: center;
}

.status-running {
    color: var(--green);
    font-weight: bold;
}

.status-idle {
    color: var(--text-muted);
}

.progress-fill {
    height: 100%;
    background-color: var(--purple);
    width: 0;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.link-item {
    display: block;
    padding: 10px;
    background-color: var(--bg-hover);
    color: var(--purple);
    text-align: center;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--transition);
}

.link-item:hover {
    background-color: var(--purple-darker);
    color: white;
    transform: translateY(-1px);
}

.cache-btn {
    background-color: var(--bg-hover) !important;
    color: var(--purple) !important;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 10px;
    width: 100%;
    text-align: center;
    border-radius: 6px;
    transition: all var(--transition);
    font-weight: 600;
}

.cache-btn:hover {
    background-color: var(--purple-darker) !important;
    color: white !important;
    transform: translateY(-1px);
}

.link-grid form {
    margin: 0;
    padding: 0;
    display: block;
}

.admin-tools-card {
    background: #1a1a1a;
    border: 1px solid #333;
}

.add-team-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.add-team-form input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: var(--bg-hover);
    color: white;
}

.success { color: var(--green); margin: 8px 0; font-weight: bold; }
.error { color: var(--red); margin: 8px 0; font-weight: bold; }

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.team-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.report-header-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
    min-width: 120px;
}

.collapsible-section {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    margin: 20px 0;
    overflow: visible;
    box-shadow: var(--shadow);
}

.section-header {
    background-color: var(--bg-hover);
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color var(--transition);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.section-header:hover {
    background-color: #333;
}

.section-header h3 {
    margin: 0;
    color: var(--purple);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform var(--transition);
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.section-content {
    padding: 20px;
    border-top: 1px solid #333;
    display: block;
}

.section-content.collapsed {
    display: none;
}

@media (max-width: 600px) {
    .team-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .report-header-btn {
        align-self: flex-end;
    }
}

.toggle-icon {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform var(--transition);
    user-select: none;
    margin-left: 8px;
    line-height: 1;
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.apply-header-btn,
.report-header-btn {
    font-size: 0.9rem;
    padding: 6px 12px;
    min-width: 100px;
}

@media (max-width: 600px) {
    .team-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .apply-header-btn,
    .report-header-btn {
        width: 100%;
        text-align: center;
    }
}
.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.header-buttons {
    display: flex;
    gap: 6px; /* ← TIGHT SPACING */
    align-items: center;
}

.apply-btn {
    background: #4caf50;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
    text-decoration: none;
}

.report-btn {
    background: #d32f2f;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

@media (max-width: 600px) {
    .team-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-buttons {
        width: 100%;
        justify-content: flex-end;
    }
    .apply-btn,
    .report-btn {
        flex: 1;
        text-align: center;
    }
}

.edit-button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.right-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .edit-button-group {
        flex-direction: column;
        align-items: stretch;
    }
    .right-buttons {
        justify-content: flex-start;
    }
    .right-buttons .admin-btn {
        flex: 1;
        min-width: 100px;
    }
}

.cron-status-card {
    margin-top: 15px;
    padding: 12px;
    border-left: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    transition: border-color var(--transition);
    background-color: var(--bg-card); /* ← DARK */
}

.cron-status-card.online {
    border-left-color: #28a745; /* Bootstrap success green */
}

.cron-status-card.offline {
    border-left-color: #dc3545; /* Bootstrap danger red */
}

.cron-title {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
    font-weight: normal;
}

.cron-status {
    font-weight: bold;
    transition: color var(--transition);
}

/* RED for Offline, GREEN for Online */
.cron-status-card.online .cron-status {
    color: #28a745;
}

.cron-status-card.offline .cron-status {
    color: #dc3545;
}

.cron-last-seen {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile */
@media (max-width: 600px) {
    .cron-status-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .cron-last-seen {
        align-self: flex-end;
    }
}

.stat-item.deleted .stat-number { color: var(--red); }


/* ——————— TWITCH: Video on top, Chat below (Real Twitch Layout) ——————— */
.twitch-section {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 0; /* No gap between player and chat */
}

.twitch-player-wrapper {
    width: 100%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.twitch-chat-wrapper {
    width: 100%;
    margin-top: 15px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Make player fully responsive */
#twitch-embed,
#twitch-embed > iframe {
    width: 100% !important;
    height: 600px !important;
    min-height: 500px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #twitch-embed,
    #twitch-embed > iframe {
        height: 400px !important;
    }
    .twitch-chat-wrapper iframe {
        height: 450px;
    }
}


/* ========================================
   API KEY MANAGEMENT - matches your dark/purple theme
   ======================================== */

   .api-key-section {
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.8rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.api-key-section h3 {
    margin: 0 0 1rem 0;
    color: var(--purple);
    font-size: 1.35rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.help-text,
.help-text.small {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
    margin: 0.6rem 0 1.4rem 0;
}

.help-text.small {
    font-size: 0.84rem;
}

.no-key {
    color: var(--text-muted);
    font-style: italic;
    margin: 1.2rem 0;
}

/* Key display area */
.api-key-display-container {
    margin: 1.3rem 0 1.6rem 0;
}

.api-key-display {
    background: var(--bg-hover);
    border: var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.02rem;
    letter-spacing: 0.5px;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.4);
}

.masked {
    color: #555;
    letter-spacing: 2px;
    user-select: none;
}

.real-key {
    color: #a78bfa;          /* lighter purple variant for visibility */
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 0.7rem;
    flex-shrink: 0;
}

.toggle-btn,
.copy-btn {
    background: var(--bg-header);
    color: var(--white);
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.toggle-btn:hover,
.copy-btn:hover:not(:disabled) {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

.copy-btn {
    background: var(--purple);
}

.copy-btn:hover {
    background: var(--purple-darker);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Freshly generated key (one-time reveal) */
.success-box {
    background: rgba(76, 175, 80, 0.12);   /* very subtle green bg */
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: var(--radius-md);
    padding: 1.3rem;
    margin: 1.4rem 0;
}

.success-box strong {
    color: var(--green);
    display: block;
    margin-bottom: 0.8rem;
}

.warning {
    color: #ffca28;
    font-size: 0.9rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* Buttons group below */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.6rem;
}

.button-group form {
    margin: 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    min-width: 160px;
    text-align: center;
}

.btn-primary {
    background: var(--bg-header);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-danger:hover {
    background: #e53935;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-sm {
    min-width: auto;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .api-key-section {
        padding: 1.3rem;
    }
    
    .api-key-display {
        flex-direction: column;
        align-items: stretch;
        gap: 0.9rem;
    }
    
    .actions {
        width: 100%;
        justify-content: center;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* ——————— INFO CELL (expandable via <details>) ——————— */
td.info-cell {
    max-width: 400px;
    overflow: hidden;
    transition: color var(--transition);
    cursor: pointer;
}

td.info-cell details {
    cursor: pointer;
}

td.info-cell details > summary {
    list-style: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
    cursor: pointer;
}

td.info-cell details > summary::-webkit-details-marker {
    display: none;
}

td.info-cell details > summary:hover {
    color: var(--purple);
}

td.info-cell details[open] {
    max-width: none;
    overflow: visible;
}

td.info-cell details[open] > summary {
    font-size: 0;
    line-height: 0;
    display: block;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: var(--bg-hover);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: background-color var(--transition);
}

td.info-cell details[open] > summary:hover {
    background-color: var(--purple-darker);
}

td.info-cell details[open] > summary::after {
    content: "Collapse";
    font-size: 0.82rem;
    color: var(--purple);
    font-weight: 500;
}

td.info-cell details[open] .info-full {
    white-space: normal;
    line-height: 1.6;
}

td.info-cell details[open] .info-full h1,
td.info-cell details[open] .info-full h2,
td.info-cell details[open] .info-full h3 {
    color: var(--white);
    margin-top: 0.8em;
    margin-bottom: 0.3em;
}

td.info-cell details[open] .info-full a {
    color: var(--purple);
}

td.info-cell details[open] .info-full a:hover {
    color: var(--white);
}

td.info-cell details[open] .info-full code {
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

td.info-cell details[open] .info-full pre {
    background: var(--bg-hover);
    padding: 12px;
    border-radius: var(--radius);
    overflow-x: auto;
}

td.info-cell details[open] .info-full blockquote {
    border-left: 3px solid var(--purple);
    margin-left: 0;
    padding-left: 15px;
    color: var(--text-muted);
}

/* ——————— RESPONSIVE TEAMS TABLE -> PILL CARDS (mobile) ——————— */
@media (max-width: 768px) {
    table {
        table-layout: auto;
        border-spacing: 0;
        margin: 16px 0;
    }

    table thead {
        display: none;
    }

    table tr {
        display: block;
        margin-bottom: 14px;
        padding: 14px;
        background-color: var(--bg-card);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow);
    }

    table tr:hover {
        transform: none;
    }

    table tr:hover td {
        background-color: transparent;
        transform: none;
    }

    table td {
        display: block;
        width: 100% !important;
        max-width: none;
        padding: 6px 4px;
        border-radius: 0;
        background-color: transparent;
        overflow: visible;
        text-overflow: initial;
        white-space: normal;
    }

    table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        margin-bottom: 2px;
    }

    /* Team logo: the card's visual anchor, centered and circular */
    table td:first-child {
        text-align: center;
        padding-bottom: 10px;
    }

    table td:first-child::before {
        content: none;
    }

    table td:first-child img {
        width: 72px;
        height: 72px;
        max-width: 72px;
        border-radius: 50%;
        object-fit: cover;
    }

    /* Team name: the card title */
    table td:nth-child(2) {
        text-align: center;
        padding-bottom: 10px;
        border-bottom: var(--border);
    }

    table td:nth-child(2)::before {
        content: none;
    }

    table td:nth-child(2) a {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--white);
    }

    table td.info-cell {
        max-width: none;
        cursor: default;
    }

    table td.info-cell details > summary {
        max-width: 100%;
    }
}

/* ========================================
   TICKET CATEGORY BADGES
   ======================================== */

.ticket-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ticket-category--bug_report {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.ticket-category--suggestion {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.ticket-category--feedback {
    background: rgba(78, 205, 196, 0.15);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.ticket-category--other {
    background: rgba(176, 176, 176, 0.15);
    color: #b0b0b0;
    border: 1px solid rgba(176, 176, 176, 0.3);
}

summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}
/* ========================================
   HTMX Boost – Navigation Progress Bar
   ======================================== */
#nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: #9147ff;
    z-index: 99999;
    pointer-events: none;
    transition: none;
}

body.htmx-request {
    cursor: progress;
}

/* Notification dropdown panel */
.notif-bell-wrap { position:relative; display:inline-flex; align-items:center; }
.notif-bell-btn { background:transparent; border:none; color:#888; font-size:1.1rem; cursor:pointer;
    padding:4px 6px; border-radius:4px; position:relative; line-height:1; margin-right:.4rem; }
.notif-bell-btn:hover { color:#e0e0e0; }
.notif-panel { position:absolute; right:0; top:calc(100% + 8px); width:320px; max-height:420px;
    background:#1a1a2e; border:1px solid #2d2d4a; border-radius:8px; box-shadow:0 8px 32px rgba(0,0,0,.5);
    display:none; flex-direction:column; z-index:9999; overflow:hidden; }
.notif-panel.np-open { display:flex; }
.notif-panel-header { display:flex; align-items:center; justify-content:space-between;
    padding:.6rem 1rem; border-bottom:1px solid #2d2d4a; font-size:.82rem; font-weight:600; color:#b0b0b0;
    text-transform:uppercase; letter-spacing:.05em; flex-shrink:0; }
.notif-panel-close { background:transparent; border:none; color:#555; cursor:pointer; padding:2px 4px;
    border-radius:3px; font-size:.9rem; }
.notif-panel-close:hover { color:#e0e0e0; }
.notif-panel-body { overflow-y:auto; flex:1; }
.np-item { padding:.7rem 1rem; border-bottom:1px solid #1e1e3a; }
.np-item:last-child { border-bottom:none; }
.np-unread { background:rgba(127,191,255,.04); }
.np-btn { background:transparent; border:1px solid #333; color:#666; border-radius:3px;
    padding:2px 6px; font-size:.7rem; cursor:pointer; }
.np-btn:hover { border-color:#7fbfff; color:#7fbfff; }
.notif-bell-badge { position:absolute; top:-5px; right:-4px; background:#f08080; color:#fff;
    font-size:.6rem; font-weight:700; border-radius:10px; padding:1px 4px; line-height:1.4; }
