/*
Theme Name: IssueBoard
Theme URI: https://issueboard.dev
Author: IssueBoard Team
Description: A professional issue tracking and knowledge base theme for WordPress. Features bento grid dashboard, multi-role access, screenshot uploads, step-by-step issue reproduction, and built-in knowledge base.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: issueboard
*/

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
    /* Colors - Stone palette */
    --color-bg: #fafaf9;
    --color-bg-alt: #f5f5f4;
    --color-surface: #ffffff;
    --color-text-primary: #1c1917;
    --color-text-secondary: #78716c;
    --color-text-tertiary: #a8a29e;
    --color-border: #e7e5e4;
    --color-border-light: rgba(231, 229, 228, 0.3);
    --color-border-inner: rgba(214, 211, 209, 0.3);

    /* Accent - Teal */
    --color-accent: #14b8a6;
    --color-accent-dark: #0d9488;
    --color-accent-light: #ccfbf1;
    --color-accent-bg: rgba(20, 184, 166, 0.1);

    /* Status Colors */
    --color-status-open: #ef4444;
    --color-status-open-bg: rgba(239, 68, 68, 0.1);
    --color-status-working: #f59e0b;
    --color-status-working-bg: rgba(245, 158, 11, 0.1);
    --color-status-resolved: #14b8a6;
    --color-status-resolved-bg: rgba(20, 184, 166, 0.1);

    /* Priority Colors */
    --color-priority-critical: #dc2626;
    --color-priority-high: #ea580c;
    --color-priority-medium: #ca8a04;
    --color-priority-low: #65a30d;

    /* Card tint backgrounds */
    --color-tint-blue: rgba(239, 246, 255, 0.2);
    --color-tint-purple: rgba(245, 243, 255, 0.2);
    --color-tint-amber: rgba(255, 251, 235, 0.2);
    --color-tint-emerald: rgba(236, 253, 245, 0.2);
    --color-tint-rose: rgba(255, 241, 242, 0.2);

    /* Typography */
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --gap: 1.5rem;
    --gap-sm: 0.75rem;
    --gap-lg: 2rem;
    --gap-xl: 3rem;

    /* Borders & Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 8px 30px -4px rgba(0, 0, 0, 0.08);
    --shadow-dropdown: 0 10px 40px -4px rgba(0, 0, 0, 0.12);
    --shadow-modal: 0 20px 60px -8px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --ease-bounce: cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: 150ms var(--ease-bounce);
    --transition-normal: 300ms var(--ease-bounce);

    /* Layout */
    --header-height: 72px;
    --sidebar-width: 280px;
    --container-max: 1280px;
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
    --color-bg: #1c1917;
    --color-bg-alt: #292524;
    --color-surface: #292524;
    --color-text-primary: #fafaf9;
    --color-text-secondary: #a8a29e;
    --color-text-tertiary: #78716c;
    --color-border: #44403c;
    --color-border-light: rgba(68, 64, 60, 0.3);
    --color-border-inner: rgba(68, 64, 60, 0.3);
    --color-accent-light: rgba(20, 184, 166, 0.15);
    --color-accent-bg: rgba(20, 184, 166, 0.12);
    --color-status-open-bg: rgba(239, 68, 68, 0.15);
    --color-status-working-bg: rgba(245, 158, 11, 0.15);
    --color-status-resolved-bg: rgba(20, 184, 166, 0.15);
    --color-tint-blue: rgba(59, 130, 246, 0.08);
    --color-tint-purple: rgba(139, 92, 246, 0.08);
    --color-tint-amber: rgba(245, 158, 11, 0.08);
    --color-tint-emerald: rgba(16, 185, 129, 0.08);
    --color-tint-rose: rgba(244, 63, 94, 0.08);
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 30px -4px rgba(0, 0, 0, 0.4);
    --shadow-dropdown: 0 10px 40px -4px rgba(0, 0, 0, 0.5);
    --shadow-modal: 0 20px 60px -8px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] img {
    opacity: 0.92;
}
[data-theme="dark"] .site-header {
    background: #292524;
    border-color: #44403c;
}
[data-theme="dark"] .bento-card {
    background: #292524;
}
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select {
    background-color: #1c1917;
    color: #fafaf9;
    border-color: #44403c;
}
[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
[data-theme="dark"] .btn--secondary {
    background: #44403c;
    color: #fafaf9;
    border-color: #57534e;
}
[data-theme="dark"] .btn--ghost {
    color: #a8a29e;
}
[data-theme="dark"] .btn--ghost:hover {
    background: #44403c;
    color: #fafaf9;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-accent-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-text-primary);
}

h1 {
    font-size: 36px;
    line-height: 40px;
}

h1 .light {
    font-weight: 400;
    color: var(--color-text-secondary);
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
}

h4 {
    font-size: 14px;
    font-weight: 600;
}

p {
    color: var(--color-text-secondary);
    max-width: 65ch;
}

.text-sm {
    font-size: 14px;
}

.text-xs {
    font-size: 12px;
}

.text-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
}

/* ===== Layout ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.site-main {
    padding-top: var(--gap-lg);
    padding-bottom: var(--gap-xl);
}

/* ===== 12-Column Bento Grid ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
}

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-9 { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }
.col-span-11 { grid-column: span 11; }
.col-span-12 { grid-column: span 12; }
.row-span-2 { grid-row: span 2; }
.row-span-3 { grid-row: span 3; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--gap-lg);
    position: relative;
}
.header-inner .header-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--color-text-primary);
}

.header-logo svg {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.header-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.header-nav a svg {
    flex-shrink: 0;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--color-text-primary);
    background: var(--color-bg-alt);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
}

.header-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.header-user:hover {
    background: var(--color-bg-alt);
}

.header-user img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.header-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-user-name {
    font-size: 14px;
    font-weight: 500;
}

.header-user-email {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    padding: 4px;
    z-index: 200;
}

.user-dropdown.is-open {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.user-dropdown a svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.user-dropdown a:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

.user-dropdown .dropdown-title {
    display: block;
    padding: 6px 14px 2px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

/* Notification Bell */
.header-notification {
    position: relative;
}
.header-notification__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}
.header-notification__btn:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}
.header-notification__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--color-status-open);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: var(--radius-full);
}
.header-notification__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    z-index: 200;
}
.header-notification__dropdown.is-open {
    display: block;
}
.notification-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
}
.notification-header__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.notification-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--color-border-light);
}
.notification-reactions__pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 13px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    line-height: 1;
}
.notification-reactions__count {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-border-light);
    border-radius: 999px;
    padding: 0 4px;
}
.notification-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
    cursor: pointer;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item:hover {
    background: var(--color-bg-alt);
}
.notification-item__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.notification-item__arrow {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
    transition: color 150ms;
}
.notification-item:hover .notification-item__arrow {
    color: var(--color-accent);
}
.notification-item__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notification-item__meta {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

/* Notification Drawer */
.notif-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 500;
    backdrop-filter: blur(2px);
}
.notif-drawer-overlay.is-open {
    display: block;
}
.notif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    z-index: 510;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
body.admin-bar .notif-drawer {
    top: 32px;
    height: calc(100vh - 32px);
}
.notif-drawer.is-open {
    transform: translateX(0);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}
.notif-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-sm) var(--gap-lg);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.notif-drawer__title {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-display);
}
.notif-drawer__search {
    padding: var(--gap-sm) var(--gap-lg);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.notif-drawer__search .form-input {
    width: 100%;
}
.notif-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.notif-drawer__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.notif-drawer__date-group {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.notif-drawer__empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 13px;
}
.notif-drawer__sentinel {
    padding: 12px;
    text-align: center;
}
.notification-view-all {
    display: block;
    padding: 10px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    border-top: 1px solid var(--color-border-light);
    cursor: pointer;
}
.notification-view-all:hover {
    background: var(--color-bg-alt);
}

/* Dark Mode Toggle */
.header-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.header-theme-toggle:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}
.theme-icon--dark {
    display: none;
}
[data-theme="dark"] .theme-icon--light {
    display: none;
}
[data-theme="dark"] .theme-icon--dark {
    display: block;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-bottom: var(--gap-sm);
}

.breadcrumb a {
    color: var(--color-text-tertiary);
    display: inline-flex;
    align-items: center;
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.breadcrumb .separator {
    font-size: 10px;
}

/* ===== Bento Card ===== */
.bento-card {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    padding: var(--gap);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--color-border-inner);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

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

.bento-card--no-hover:hover {
    transform: none;
    box-shadow: var(--shadow-card);
}

/* Card tint backgrounds */
.bento-card--blue { background: var(--color-tint-blue); }
.bento-card--purple { background: var(--color-tint-purple); }
.bento-card--amber { background: var(--color-tint-amber); }
.bento-card--emerald { background: var(--color-tint-emerald); }
.bento-card--rose { background: var(--color-tint-rose); }

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--gap-sm);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--gap);
    padding-top: var(--gap-sm);
    border-top: 1px solid var(--color-border-light);
}

/* ===== Issue Card ===== */
.issue-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.issue-card__title {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-display);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.issue-card__title a {
    color: var(--color-text-primary);
}

.issue-card__title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.issue-card__title a:hover {
    color: var(--color-accent-dark);
}

.issue-card__excerpt {
    font-size: 14px;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--gap-sm);
}

.issue-card__thumbnail {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--gap-sm);
    background: var(--color-bg-alt);
}

.issue-card__author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-tertiary);
}

.issue-card__author img {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.issue-card__date {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.status-badge--open {
    background: var(--color-status-open-bg);
    color: var(--color-status-open);
}

.status-badge--open::before {
    background: var(--color-status-open);
}

.status-badge--working {
    background: var(--color-status-working-bg);
    color: var(--color-status-working);
}

.status-badge--working::before {
    background: var(--color-status-working);
}

.status-badge--resolved {
    background: var(--color-status-resolved-bg);
    color: var(--color-status-resolved);
}

.status-badge--resolved::before {
    background: var(--color-status-resolved);
}

.status-badge--published {
    background: var(--color-status-resolved-bg);
    color: var(--color-status-resolved);
}
.status-badge--published::before {
    background: var(--color-status-resolved);
}
.status-badge--draft {
    background: var(--color-status-working-bg);
    color: var(--color-status-working);
}
.status-badge--draft::before {
    background: var(--color-status-working);
}

/* ===== Priority Badge ===== */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    background: var(--color-bg-alt);
    color: var(--color-text-secondary);
}
.priority-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    background: var(--color-text-tertiary);
}

.priority-badge--critical { color: var(--color-priority-critical); background: rgba(220, 38, 38, 0.1); }
.priority-badge--critical::before { background: var(--color-priority-critical); }
.priority-badge--high { color: var(--color-priority-high); background: rgba(234, 88, 12, 0.1); }
.priority-badge--high::before { background: var(--color-priority-high); }
.priority-badge--medium { color: var(--color-priority-medium); background: rgba(202, 138, 4, 0.1); }
.priority-badge--medium::before { background: var(--color-priority-medium); }
.priority-badge--low { color: var(--color-priority-low); background: rgba(101, 163, 13, 0.1); }
.priority-badge--low::before { background: var(--color-priority-low); }

/* ===== Category Badge ===== */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
}

/* ===== Meta Badge ===== */
.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.meta-badge--recommended {
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.meta-badge--critical {
    background: rgba(245, 243, 255, 0.5);
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.2);
}

/* ===== Completion Indicator ===== */
.completion-indicator {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.completion-indicator--done {
    background: var(--color-accent);
    color: white;
}

.completion-indicator--done svg {
    width: 16px;
    height: 16px;
}

.completion-indicator--pending {
    border: 2px solid var(--color-border);
    background: transparent;
}

/* ===== Progress Circle (SVG) ===== */
.progress-circle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-circle svg {
    transform: rotate(-90deg);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

.progress-circle__bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 3;
}

.progress-circle__fill {
    fill: none;
    stroke: var(--color-accent-dark);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray var(--transition-normal);
}

.progress-circle__text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    color: var(--color-text-primary);
}

/* ===== Full-Width Dashboard Layout ===== */
.site-main {
    padding-top: 0;
    padding-bottom: 0;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 1fr auto;
    min-height: calc(100vh - var(--header-height));
}

.dashboard-sidebar {
    grid-row: 1 / -1;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 12px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-light);
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.dashboard-sidebar::-webkit-scrollbar {
    width: 4px;
}

.dashboard-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-section__title {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
    margin-bottom: 0;
}

.sidebar-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 0;
    overflow: hidden;
}

.sidebar-stat-card__bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: var(--bar-pct, 0%);
    background: var(--color-text-tertiary);
    transition: width 0.4s ease;
}

.sidebar-stat-card--open .sidebar-stat-card__bar { background: var(--color-status-open); }
.sidebar-stat-card--working .sidebar-stat-card__bar { background: var(--color-status-working); }
.sidebar-stat-card--resolved .sidebar-stat-card__bar { background: var(--color-status-resolved); }

.sidebar-stat-card--open { border-left: 3px solid var(--color-border-light); }
.sidebar-stat-card--working { border-left: 3px solid var(--color-border-light); }
.sidebar-stat-card--resolved { border-left: 3px solid var(--color-border-light); }

.sidebar-stat-card__number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--color-text-primary);
}

.sidebar-stat-card--open .sidebar-stat-card__number { color: var(--color-status-open); }
.sidebar-stat-card--working .sidebar-stat-card__number { color: var(--color-status-working); }
.sidebar-stat-card--resolved .sidebar-stat-card__number { color: var(--color-status-resolved); }

.sidebar-stat-card__label {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.sidebar-stat-card--resolved-7d { border-left: 3px solid var(--color-border-light); }
.sidebar-stat-card--resolved-7d .sidebar-stat-card__number { color: var(--color-status-resolved); }

/* Sidebar chart card */
.sidebar-chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 10px 12px 4px;
    margin-bottom: 6px;
}

.sidebar-chart-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sidebar-chart-card__label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.sidebar-chart-card__total {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text-primary);
}

/* Sidebar age cards */
.sidebar-age-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.sidebar-age-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 0;
    padding: 6px 8px;
    text-align: center;
}

.sidebar-age-card__label {
    font-size: 10px;
    color: var(--color-text-tertiary);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-age-card__number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text-primary);
    line-height: 1;
}

.sidebar-age-card__unit {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-tertiary);
}

/* ===== SLA Compliance Bar ===== */
.compliance-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 0;
    padding: 8px 10px;
}

.compliance-card__header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.compliance-card__value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--color-text-primary);
    line-height: 1;
}

.compliance-card__detail {
    font-size: 10px;
    color: var(--color-text-tertiary);
}

.compliance-bar {
    position: relative;
    margin-bottom: 4px;
}

.compliance-bar__track {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.compliance-bar__zone {
    /* flex set via inline style from saved boundaries */
}

.compliance-bar__zone--red {
    background: #ef4444;
}

.compliance-bar__zone--amber {
    background: #f59e0b;
}

.compliance-bar__zone--green {
    background: #22c55e;
}

.compliance-bar__indicator {
    position: absolute;
    top: -3px;
    transform: translateX(-50%);
    z-index: 1;
}

.compliance-bar__needle {
    width: 3px;
    height: 16px;
    background: var(--color-text-primary);
    border-radius: 2px;
    box-shadow: 0 0 0 2px var(--color-surface);
}

.compliance-bar__labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--color-text-tertiary);
    padding: 0 1px;
}

/* Compliance indicator dots (settings page) */
.compliance-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.compliance-dot--red { background: #ef4444; }
.compliance-dot--amber { background: #f59e0b; }
.compliance-dot--green { background: #22c55e; }

/* ===== Compact List View ===== */
.issue-compact-list-view .issue-list-header {
    grid-template-columns: 80px 1fr 110px 100px;
    padding: 6px 10px;
}
.issue-compact-list-view .issue-list-header__col:nth-child(4) {
    /* Priority header */
}
.issue-compact-list-view .issue-list-row {
    grid-template-columns: 80px 1fr 110px 100px;
    padding: 4px 10px;
    font-size: 0.8125rem;
    gap: 8px;
    min-height: unset;
}
.issue-compact-list-view .issue-list-row__priority,
.issue-compact-list-view .issue-list-row__date {
    display: none;
}
.issue-compact-list-view .issue-list-row__assignee {
    font-size: 0.75rem;
}

/* ===== Floating Action Button ===== */
.fab-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.fab-create {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--color-status-resolved);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.fab-create:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: color-mix(in srgb, var(--color-status-resolved) 88%, #000);
}

.fab-create:active {
    transform: scale(0.96);
}

.fab-wrapper.is-open .fab-create {
    transform: rotate(45deg);
}

.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
}

.fab-wrapper.is-open .fab-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: background 0.15s, box-shadow 0.15s;
}

.fab-menu__item:hover {
    background: var(--color-bg-alt);
    box-shadow: var(--shadow-lg);
}

.fab-menu__item svg {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
}

.dashboard-content {
    min-width: 0;
    padding: var(--gap) var(--gap-lg);
    display: flex;
    flex-direction: column;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    margin-bottom: var(--gap);
    flex-wrap: wrap;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topbar-left .breadcrumb {
    margin-bottom: 0;
}

.shortcut-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--color-text-tertiary);
}

.dashboard-topbar .breadcrumb {
    margin-bottom: 0;
}

.dashboard-topbar .filter-tabs {
    margin-bottom: 0;
}

.dashboard-topbar--end {
    justify-content: flex-end;
}

/* Summary Cards with Sparklines */
.issue-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--gap-sm);
    margin-bottom: var(--gap);
    transition: height 0.3s ease, opacity 0.25s ease, margin-bottom 0.3s ease;
}

.summary-card {
    padding: 14px 16px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-card__label {
    font-size: 11px;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.summary-card__value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.summary-card__value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.summary-card__change {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
}

.summary-card__change--good,
.summary-card__trend--good {
    color: #22c55e;
}

.summary-card__change--bad,
.summary-card__trend--bad {
    color: #ef4444;
}

.summary-card__change--neutral,
.summary-card__trend--neutral {
    color: var(--color-text-tertiary);
}

.summary-card__sparkline {
    margin-top: auto;
    margin-left: -16px;
    margin-right: -16px;
    line-height: 0;
}

.summary-card__sparkline .sparkline {
    display: block;
    width: 100%;
}

.dashboard-content__header {
    margin-bottom: var(--gap);
}

.dashboard-content__header h1 {
    margin-bottom: 4px;
}

.dashboard-content__desc {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* ===== Product Columns ===== */
/* Hide grid/list until JS applies saved filters (prevents flash of unfiltered content) */
.product-columns,
.issue-list-view,
.issue-compact-grid,
.archive-view {
    opacity: 0;
    transition: opacity 150ms ease;
}

.product-columns.is-ready,
.issue-list-view.is-ready,
.issue-compact-grid.is-ready,
.archive-view.is-ready {
    opacity: 1;
}

.product-columns {
    columns: 300px;
    column-gap: var(--gap);
    padding-bottom: var(--gap-sm);
}

/* Column layout (non-masonry): CSS Grid with equal-height columns */
.product-columns--grid-layout {
    columns: unset;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

.product-columns--grid-layout .product-column {
    break-inside: unset;
    margin-bottom: 0;
}

/* Compact view: 4-column grid by default */
.issue-compact-grid {
    columns: unset;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

.issue-compact-grid .product-column {
    break-inside: unset;
    margin-bottom: 0;
}

/* Compact view masonry override */
.issue-compact-grid.product-columns--masonry {
    display: block;
    columns: 300px;
    grid-template-columns: unset;
}

.issue-compact-grid.product-columns--masonry .product-column {
    break-inside: avoid;
    margin-bottom: var(--gap);
}

@media (max-width: 1400px) {
    .product-columns--grid-layout,
    .issue-compact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .product-columns--grid-layout,
    .issue-compact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .product-columns--grid-layout,
    .issue-compact-grid {
        grid-template-columns: 1fr;
    }
}

.product-column {
    break-inside: avoid;
    margin-bottom: var(--gap);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.product-column--unassigned {
    opacity: 0.75;
}

.product-column__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border-light);
}

.product-column__title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.product-column__count {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1px 8px;
}

.product-column__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.product-column__empty {
    font-size: 13px;
    color: var(--color-text-tertiary);
    text-align: center;
    padding: var(--gap);
}

/* ===== View Toggle ===== */
.view-toggle {
    display: flex;
    gap: 2px;
}

.view-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: calc(var(--radius-sm) - 1px);
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle__btn svg {
    width: 14px;
    height: 14px;
}

.view-toggle__btn:hover {
    color: var(--color-text-primary);
    background: var(--color-bg);
}

.view-toggle__btn.is-active {
    color: var(--color-text-primary);
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ===== List View ===== */
.issue-list-view {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    overflow: visible;
}

.issue-list-view > :first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.issue-list-view > :last-child {
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.issue-list-header {
    display: grid;
    grid-template-columns: 6px 110px 120px 1fr 100px 120px 90px;
    align-items: center;
    gap: var(--gap-sm);
    padding: 8px 16px;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 2;
}

.issue-list-header__col {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: relative;
}

.issue-list-header__col--filterable {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.issue-list-header__col--filterable:hover {
    color: var(--color-text-primary);
}

.issue-list-header__col--filterable.is-filtered {
    color: var(--color-accent);
}

.issue-list-header__funnel {
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.issue-list-header__col--filterable:hover .issue-list-header__funnel,
.issue-list-header__col--filterable.is-filtered .issue-list-header__funnel {
    opacity: 1;
}

.issue-list-filter {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    padding: 4px;
}

.issue-list-filter.is-open {
    display: block;
}

.issue-list-filter__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
}

.issue-list-filter__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.issue-list-filter__option.is-selected {
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 500;
}

.issue-list-filter__check {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--color-border);
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.issue-list-filter__check svg {
    display: none;
}

.issue-list-filter__option.is-selected .issue-list-filter__check {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.issue-list-filter__option.is-selected .issue-list-filter__check svg {
    display: block;
}

.issue-list-rows {
    display: flex;
    flex-direction: column;
}

/* List group (used on archive pages) */
.issue-list-group {
    overflow: hidden;
}

.issue-list-group__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-alt);
    cursor: pointer;
    user-select: none;
}

.issue-list-group:first-child .issue-list-group__header {
    border-top: none;
}

.issue-list-group__header:hover {
    background: var(--color-bg);
}

.issue-list-group__chevron {
    transition: transform 0.15s ease;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

.issue-list-group.is-collapsed .issue-list-group__chevron {
    transform: rotate(-90deg);
}

.issue-list-group.is-collapsed .issue-list-group__rows {
    display: none;
}

.issue-list-group__count {
    font-weight: 400;
    color: var(--color-text-tertiary);
    font-size: 11px;
}

.issue-list-group__rows {
    display: flex;
    flex-direction: column;
}

.issue-list-row {
    display: grid;
    grid-template-columns: 6px 110px 120px 1fr 100px 120px 90px;
    align-items: center;
    gap: var(--gap-sm);
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.1s ease;
}

.issue-list-row:last-child {
    border-bottom: none;
}

.issue-list-row:hover {
    background: var(--color-bg-alt);
}

.issue-list-row__sla {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sla-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sla-dot--ok {
    background: var(--color-status-resolved, #14b8a6);
}

.sla-dot--breach {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.sla-dot--resolved {
    background: var(--color-status-resolved, #14b8a6);
    opacity: 0.5;
}

.sla-dot--none {
    background: var(--color-text-tertiary, #78716c);
    opacity: 0.3;
}

.issue-list-row__status {
    flex-shrink: 0;
}

.issue-list-row__main {
    min-width: 0;
}

.issue-list-row__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.issue-list-row__title:hover {
    color: var(--color-accent);
}

.issue-list-row__product {
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issue-list-row__priority {
    flex-shrink: 0;
}

.issue-list-row__assignee {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.issue-list-row__assignee--unassigned {
    color: var(--color-status-open);
}

.issue-list-header__col[data-col="date"] {
    text-align: left;
}

.issue-list-row__date {
    font-size: 12px;
    color: var(--color-text-tertiary);
    text-align: left;
    white-space: nowrap;
}

/* ===== Column Picker Off-Canvas ===== */
.column-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}
.column-picker-overlay.is-open {
    display: block;
}

.column-picker-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 90vw;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl, -4px 0 24px rgba(0, 0, 0, 0.12));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.column-picker-panel.is-open {
    transform: translateX(0);
}

.column-picker-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border-light);
}
.column-picker-panel__header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.column-picker-panel__close {
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.column-picker-panel__close:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-alt);
}

.column-picker-panel__hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
    padding: 8px 20px;
    margin: 0;
}

.column-picker-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.column-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: grab;
    user-select: none;
    transition: background 0.1s;
}
.column-picker-item:hover {
    background: var(--color-bg-alt);
}
.column-picker-item.is-dragging {
    opacity: 0.5;
    background: var(--color-bg-alt);
}
.column-picker-item.drag-over {
    border-top: 2px solid var(--color-accent);
}

.column-picker-item__drag {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
    cursor: grab;
}

.column-picker-item__label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
}
.column-picker-item.is-disabled .column-picker-item__label {
    color: var(--color-text-tertiary);
}

.column-picker-item__toggle {
    position: relative;
    width: 32px;
    height: 18px;
    background: var(--color-border);
    border-radius: 9px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
}
.column-picker-item__toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.column-picker-item__toggle.is-on {
    background: var(--color-accent);
}
.column-picker-item__toggle.is-on::after {
    transform: translateX(14px);
}
.column-picker-item__toggle.is-locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.column-picker-panel__footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border-light);
}

@media (max-width: 768px) {
    .issue-list-header,
    .issue-list-row {
        grid-template-columns: auto 1fr auto;
    }

    .issue-list-header__col[data-col="sla"],
    .issue-list-header__col[data-col="product"],
    .issue-list-header__col[data-col="priority"],
    .issue-list-header__col[data-col="date"],
    [data-col="sla"],
    [data-col="product"],
    [data-col="priority"],
    [data-col="date"] {
        display: none !important;
    }
}

/* ===== Compact Issue Card ===== */
.issue-card-compact {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 10px 30px 10px 12px;
    cursor: pointer;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.issue-card-compact:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.issue-card-compact__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.issue-card-compact__header .badge {
    font-size: 10px;
    padding: 1px 6px;
}

.issue-card-compact__date {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

.issue-card-compact__title {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-display);
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.issue-card-compact__title a {
    color: var(--color-text-primary);
}

.issue-card-compact__title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.issue-card-compact__title a:hover {
    color: var(--color-accent-dark);
}

.issue-card-compact__desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-tertiary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.issue-card-compact__footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

.issue-card-compact__footer .badge {
    font-size: 10px;
    padding: 1px 5px;
}

/* Compact dot indicators */
.compact-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.compact-dot--open { background: var(--color-status-open); }
.compact-dot--working { background: var(--color-status-working); }
.compact-dot--resolved { background: var(--color-status-resolved); }
.compact-dot--critical { background: var(--color-priority-critical); }
.compact-dot--high { background: var(--color-priority-high); }
.compact-dot--medium { background: var(--color-priority-medium); }
.compact-dot--low { background: var(--color-priority-low); }

/* Compact kebab menu */
.compact-kebab {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
}
.compact-kebab__trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.compact-kebab__trigger svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.compact-kebab__trigger:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}
.compact-kebab__menu {
    display: none;
    position: fixed;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 100;
}
.compact-kebab.is-open .compact-kebab__menu {
    display: block;
}
.compact-kebab__label {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 4px 6px 2px;
}
.compact-kebab__divider {
    height: 1px;
    background: var(--color-border-light);
    margin: 4px 0;
}
.compact-kebab__section .compact-assignee {
    width: 100%;
}
.compact-kebab__section .compact-assignee__trigger,
.compact-kebab__section .drawer-taxonomy__trigger {
    width: 100%;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
}
.compact-kebab__section .compact-assignee__trigger:hover,
.compact-kebab__section .drawer-taxonomy__trigger:hover {
    background: var(--color-bg);
}
.compact-kebab__section .compact-assignee__dropdown,
.compact-kebab__section .drawer-taxonomy__dropdown {
    position: relative;
    top: 2px;
    left: 0;
    right: 0;
    box-shadow: none;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
}
.compact-kebab__section .compact-status-actions {
    padding: 4px 2px;
}

/* Compact card assignee */
.compact-assignee {
    position: relative;
    z-index: 2;
    font-size: 11px;
    color: var(--color-text-secondary);
}

.compact-assignee--unassigned {
    color: var(--color-status-open);
}

.compact-assignee__trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-family: inherit;
    color: inherit;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    max-width: 140px;
}

.compact-assignee__trigger:hover {
    border-color: var(--color-border);
    background: var(--color-bg-alt);
}

.compact-assignee__icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.compact-assignee__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-assignee__chevron {
    flex-shrink: 0;
    opacity: 0.4;
    transition: transform var(--transition-fast);
}

.compact-assignee.is-open .compact-assignee__chevron {
    transform: rotate(180deg);
}

.compact-assignee__dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    min-width: 170px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 20;
}

.compact-assignee.is-open .compact-assignee__dropdown {
    display: block;
}

.compact-assignee__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-secondary);
    transition: background var(--transition-fast);
}

.compact-assignee__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.compact-assignee__option.is-selected {
    color: var(--color-accent);
    font-weight: 600;
}

.compact-assignee__option.is-selected::after {
    content: '';
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    flex-shrink: 0;
}

.compact-assignee__option img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.compact-assignee__option-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-assignee__name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.compact-assignee__name .compact-assignee__icon {
    opacity: 0.6;
}

/* Compact card status action buttons */
.compact-status-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    position: relative;
    z-index: 2;
}

.compact-status-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
    background: transparent;
    cursor: pointer;
    opacity: 0.35;
    transition: all var(--transition-fast);
    color: var(--color-text-tertiary);
}

.compact-status-btn--open:hover {
    opacity: 1;
    color: var(--color-status-open);
    border-color: var(--color-status-open);
    background: rgba(239, 68, 68, 0.1);
}

.compact-status-btn--working:hover {
    opacity: 1;
    color: var(--color-status-working);
    border-color: var(--color-status-working);
    background: rgba(245, 158, 11, 0.1);
}

.compact-status-btn--resolved:hover {
    opacity: 1;
    color: var(--color-status-resolved);
    border-color: var(--color-status-resolved);
    background: rgba(16, 185, 129, 0.1);
}

.compact-status-btn--open.is-active {
    opacity: 1;
    color: var(--color-status-open);
    border-color: var(--color-status-open);
    background: rgba(239, 68, 68, 0.1);
}

.compact-status-btn--working.is-active {
    opacity: 1;
    color: var(--color-status-working);
    border-color: var(--color-status-working);
    background: rgba(245, 158, 11, 0.1);
}

.compact-status-btn--resolved.is-active {
    opacity: 1;
    color: var(--color-status-resolved);
    border-color: var(--color-status-resolved);
    background: rgba(16, 185, 129, 0.1);
}

/* ===== Stats Row (legacy) ===== */
.stats-row {
    display: flex;
    gap: var(--gap);
    margin-bottom: var(--gap-lg);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: var(--gap-sm) var(--gap);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    flex: 1;
}

.stat-card__number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    color: var(--color-text-primary);
}

.stat-card__label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* ===== Filter Tabs ===== */
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
}
.filter-tabs__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    padding: 0 6px;
    white-space: nowrap;
    margin-bottom: var(--gap);
    width: fit-content;
}

.filter-tab {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: calc(var(--radius-sm) - 1px);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}

.filter-tab:hover {
    color: var(--color-text-primary);
}

.filter-tab.active {
    background: var(--color-surface);
    color: var(--color-text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.filter-tab .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    margin-left: 2px;
}

.filter-tab.active .count {
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
}

.filter-tab svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.filter-tabs__divider {
    width: 1px;
    height: 16px;
    background: var(--color-border);
    margin: 0 2px;
}

/* User filter dropdown */
.filter-user-dropdown {
    position: relative;
}

.filter-user-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-user-dropdown__chevron {
    width: 10px;
    height: 10px;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.filter-user-dropdown__panel.is-open ~ .filter-user-dropdown__trigger .filter-user-dropdown__chevron,
.filter-user-dropdown__trigger:focus + .filter-user-dropdown__panel .filter-user-dropdown__chevron {
    transform: rotate(180deg);
}

.filter-user-dropdown__panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.filter-user-dropdown__panel.is-open {
    display: block;
}

.filter-user-dropdown__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}

.filter-user-dropdown__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.filter-user-dropdown__option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}

.filter-user-dropdown__option img {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-display);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.btn--primary:hover {
    background: var(--color-accent-dark);
    color: white;
}

.btn--primary:disabled {
    background: #d6d3d1;
    color: #a8a29e;
    cursor: not-allowed;
}

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-bg-alt);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    padding: 8px 12px;
}

.btn--ghost:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.btn--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.btn--danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn--sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn--lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--gap);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--color-status-open);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-bg);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-tertiary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ===== Custom Select ===== */
.custom-select-wrap {
    position: relative;
}
.custom-select-wrap > select {
    display: none;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 150ms;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-select-trigger:hover {
    border-color: var(--color-accent);
}
.custom-select-trigger.is-placeholder {
    color: var(--color-text-tertiary);
}
.custom-select-trigger__chevron {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
    transition: transform 150ms;
}
.custom-select-wrap.is-open .custom-select-trigger__chevron {
    transform: rotate(180deg);
}
.custom-select-trigger--sm {
    padding: 5px 10px;
    font-size: 12px;
}
.custom-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    padding: 4px;
}
.custom-select-dropdown::-webkit-scrollbar {
    display: none;
}
.custom-select-wrap.is-open .custom-select-dropdown {
    display: block;
}
.custom-select-option {
    padding: 7px 10px;
    font-size: 13px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 100ms, color 100ms;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-select-option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}
.custom-select-option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}
.custom-select-option--sm {
    padding: 5px 10px;
    font-size: 12px;
}
.custom-select-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: 4px 0;
}
.custom-select-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    font-size: 12px;
    color: var(--color-accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background 100ms;
}
.custom-select-add:hover {
    background: var(--color-bg-alt);
}
.custom-select-add-form {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
}
.custom-select-add-form input {
    flex: 1;
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text-primary);
    outline: none;
}
.custom-select-add-form input:focus {
    border-color: var(--color-accent);
}
.custom-select-add-form button {
    font-size: 11px;
    padding: 4px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-accent);
    color: white;
    cursor: pointer;
    white-space: nowrap;
}

.form-hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--color-status-open);
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: var(--gap);
}

.form-row .form-group {
    flex: 1;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--gap);
}

.modal-overlay.is-open {
    display: flex;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 300ms var(--ease-bounce);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap);
    border-bottom: 1px solid var(--color-border);
}

.modal__title {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-display);
}

.modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.modal__body {
    padding: var(--gap);
}

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--gap-sm);
    padding: var(--gap);
    border-top: 1px solid var(--color-border);
}

/* ===== Screenshot Upload ===== */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--gap-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--color-bg);
}

.upload-zone:hover,
.upload-zone.is-dragover {
    border-color: var(--color-accent);
    background: var(--color-accent-bg);
}

.upload-zone__icon {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--gap-sm);
    color: var(--color-text-tertiary);
}

.upload-zone__text {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.upload-zone__text strong {
    color: var(--color-accent-dark);
}

.upload-zone__hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--gap-sm);
    margin-top: var(--gap-sm);
}

.upload-preview__item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.upload-preview__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

/* ===== Document List ===== */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--gap-sm);
}

.document-list__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: border-color 150ms;
}

.document-list__item--link:hover {
    border-color: var(--color-accent);
}

.document-list__item--loading {
    opacity: 0.6;
}

.document-list__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    background: var(--color-accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.document-list__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-list__remove {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    transition: color 150ms;
}

.document-list__remove:hover {
    color: var(--color-status-open);
}

.document-list__download {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
}

.document-list__item--link:hover .document-list__download {
    color: var(--color-accent);
}

/* ===== Screenshot Gallery ===== */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--gap-sm);
}

.screenshot-gallery__item {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.screenshot-gallery__item:hover {
    transform: scale(1.02);
}

.screenshot-gallery__item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--gap-lg);
}

.lightbox.is-open {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-sm);
}

.lightbox__close {
    position: absolute;
    top: var(--gap);
    right: var(--gap);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* ===== Steps to Reproduce ===== */
.steps-list {
    counter-reset: step-counter;
    list-style: none;
}

.step-item {
    counter-increment: step-counter;
    display: flex;
    gap: var(--gap);
    padding: var(--gap);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--gap-sm);
    background: var(--color-surface);
}

.step-item__number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius-full);
}

.step-item__content {
    flex: 1;
    min-width: 0;
}

.step-item__text {
    font-size: 14px;
    color: var(--color-text-primary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.step-item__screenshot {
    max-width: 300px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    cursor: pointer;
}

/* ===== Avatar Stack ===== */
.avatar-stack {
    display: flex;
}

.avatar-stack img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-surface);
    margin-left: -8px;
    object-fit: cover;
}

.avatar-stack img:first-child {
    margin-left: 0;
}

.avatar-stack__more {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-surface);
    margin-left: -8px;
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-tertiary);
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--gap-lg);
    flex-wrap: wrap;
    gap: var(--gap);
}

.page-header__content {
    max-width: 512px;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
}

/* ===== Single Issue ===== */
.issue-detail {
    max-width: 900px;
}

.issue-detail__header {
    margin-bottom: var(--gap-lg);
}

.issue-detail__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--gap-sm);
    margin-top: var(--gap-sm);
}

.issue-detail__section {
    margin-bottom: var(--gap-lg);
}

.issue-detail__section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-display);
    margin-bottom: var(--gap);
    padding-bottom: var(--gap-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.issue-detail__content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text-primary);
}

.issue-detail__content p {
    margin-bottom: var(--gap);
    color: var(--color-text-primary);
    max-width: none;
}

/* ===== KB Article Card ===== */
.kb-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kb-card__header {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-sm);
}

.kb-card .card-footer {
    margin-top: auto;
}

.kb-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
    border-radius: var(--radius-sm);
    margin-bottom: var(--gap-sm);
}

.kb-card__title {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-display);
    margin-bottom: 4px;
}

.kb-card__title a {
    color: var(--color-text-primary);
}

.kb-card__title a:hover {
    color: var(--color-accent-dark);
}

.kb-card__excerpt {
    flex: 1;
    font-size: 14px;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-link {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: var(--gap);
    background: var(--color-accent-bg);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.kb-link:hover {
    background: rgba(20, 184, 166, 0.15);
}

.kb-link__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.kb-link__content {
    flex: 1;
    min-width: 0;
}

.kb-link__label {
    font-size: 12px;
    color: var(--color-accent-dark);
    font-weight: 500;
}

.kb-link__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ===== Sidebar Filters ===== */
.archive-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--gap-lg);
}

.filter-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--gap));
    align-self: start;
}

.filter-group {
    margin-bottom: var(--gap);
}

.filter-group__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    margin-bottom: var(--gap-sm);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.filter-option:hover {
    color: var(--color-text-primary);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    accent-color: var(--color-accent);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--gap-lg);
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.pagination .current {
    background: var(--color-accent);
    color: white;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--gap-xl) var(--gap);
    grid-column: 1 / -1;
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--gap);
    color: var(--color-text-tertiary);
    opacity: 0.5;
}

.empty-state__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state__text {
    margin: 0 auto var(--gap);
}

/* ===== Toast / Notification ===== */
.toast {
    position: fixed;
    bottom: var(--gap);
    left: var(--gap);
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 12px 20px;
    background: var(--color-text-primary);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    animation: toastIn 300ms var(--ease-bounce);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.toast--success { border-left: 3px solid var(--color-accent); }
.toast--error { border-left: 3px solid var(--color-status-open); }

/* ===== 404 Page ===== */
.page-404 {
    text-align: center;
    padding: 80px var(--gap);
}

.page-404 h1 {
    font-size: 72px;
    color: var(--color-text-tertiary);
    margin-bottom: var(--gap-sm);
}

/* ===== Assignee Badge ===== */
.assignee-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.assignee-badge img {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.assignee-badge__name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.created-by-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.created-by-badge img {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.created-by-badge__name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issue-controls-row {
    display: flex;
    align-items: center;
    gap: var(--gap);
    flex-wrap: wrap;
    margin-bottom: var(--gap);
}

.issue-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

.issue-control-field__label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
    margin-bottom: 4px;
}

.assign-control {
    display: flex;
    align-items: center;
}

.form-select--sm {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 5px 28px 5px 10px;
    font-size: 0.75rem;
    line-height: 1.4;
    font-weight: 500;
    color: var(--color-text-secondary);
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.form-select--sm:hover {
    border-color: var(--color-text-muted);
    background-color: var(--color-surface);
}

.form-select--sm:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent-bg);
}

[data-theme="dark"] .form-select--sm {
    background-color: #292524;
    border-color: #44403c;
    color: #d6d3d1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="dark"] .form-select--sm:hover {
    border-color: #57534e;
    background-color: #1c1917;
}

/* ===== Taxonomy Manager ===== */
.taxonomy-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    margin-bottom: var(--gap);
    width: fit-content;
}

.taxonomy-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.taxonomy-tab:hover {
    color: var(--color-text-primary);
}

.taxonomy-tab.active {
    background: var(--color-surface);
    color: var(--color-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.taxonomy-tab svg {
    flex-shrink: 0;
}

.taxonomy-tab .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.taxonomy-tab.active .count {
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
}

.taxonomy-panel {
    display: none;
}

.taxonomy-panel.active {
    display: block;
    padding-bottom: 96px;
}

.term-add-row {
    display: flex;
    gap: var(--gap-sm);
    align-items: center;
}

.term-add-row .form-input {
    flex: 1;
}

.term-add-row .form-select {
    width: 180px;
    flex-shrink: 0;
}

.term-list {
    display: flex;
    flex-direction: column;
}

.term-item {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    background: var(--color-surface);
    transition: opacity 200ms, transform 200ms;
}

.term-item__display {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 10px 14px;
}

.term-item__indent {
    width: 20px;
    height: 1px;
    background: var(--color-border);
    flex-shrink: 0;
    margin-left: 8px;
}

.term-item__name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.term-item__count {
    font-size: 12px;
    color: var(--color-text-tertiary);
    background: var(--color-bg-alt);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.term-item__actions {
    display: flex;
    gap: 2px;
}

.term-item.is-dragging {
    opacity: 0.4;
}
.term-item.drag-over {
    box-shadow: 0 -2px 0 0 var(--color-accent);
}
.term-list[data-sortable] .term-item {
    transition: opacity 150ms, box-shadow 150ms;
}

.term-item__edit {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 8px 14px;
}

.term-item__edit .form-input {
    flex: 1;
}

.form-input--sm {
    padding: 6px 10px;
    font-size: 13px;
}

.term-item__actions .btn--ghost {
    padding: 4px 6px;
}

.term-item__actions .term-delete-btn:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

/* ===== Product User Assignment ===== */
.term-item__actions .term-users-btn {
    padding: 4px 6px;
}
.term-item__actions .term-users-btn:hover,
.term-item__actions .term-edit-btn:hover {
    color: var(--color-accent);
    background: var(--color-accent-bg);
}
.term-users-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 10px;
    text-align: center;
}
.term-users-count:empty {
    display: none;
}
.product-users-drawer__select-all {
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 4px;
    padding-bottom: 8px;
    font-weight: 600;
}

/* Product Users Drawer */
.product-users-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}
.product-users-overlay.is-open {
    display: block;
}
.product-users-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 90vw;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl, -4px 0 24px rgba(0, 0, 0, 0.12));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.product-users-drawer.is-open {
    transform: translateX(0);
}
.product-users-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border-light);
}
.product-users-drawer__header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
.product-users-drawer__close {
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.product-users-drawer__close:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-alt);
}
.product-users-drawer__hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
    padding: 8px 20px;
    margin: 0;
}
.product-users-drawer__search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 8px;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text-tertiary);
}
.product-users-drawer__search:focus-within {
    border-color: var(--color-accent);
}
.product-users-drawer__search .form-input {
    border: none;
    padding: 0;
    background: none;
    flex: 1;
    font-size: 13px;
    outline: none;
    box-shadow: none;
}
.product-users-drawer__list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}
.product-users-drawer__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 100ms;
}
.product-users-drawer__user:hover {
    background: var(--color-bg-alt);
}
.product-users-drawer__user.is-hidden {
    display: none;
}
.product-users-drawer__user input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--color-accent);
}
.product-users-drawer__user img {
    border-radius: 50%;
    flex-shrink: 0;
}
.product-users-drawer__user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.product-users-drawer__user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
}
.product-users-drawer__user-email {
    font-size: 11px;
    color: var(--color-text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-users-drawer__footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    gap: 8px;
}

/* ===== Settings Toggle ===== */
.settings-field {
    padding: var(--gap-sm) 0;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.settings-toggle input {
    display: none;
}

.settings-toggle__switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: 12px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.settings-toggle__switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.settings-toggle input:checked + .settings-toggle__switch {
    background: var(--color-accent);
}

.settings-toggle input:checked + .settings-toggle__switch::after {
    transform: translateX(20px);
}

.settings-toggle__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    order: -1;
    flex: 1;
}

/* ===== 2FA User List ===== */
.twofa-user-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.twofa-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.twofa-user-row:hover {
    background: var(--color-bg-alt);
}

.twofa-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.twofa-user-info img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.twofa-user-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.twofa-user-email {
    display: block;
    font-size: 11px;
    color: var(--color-text-tertiary);
}

.twofa-user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.twofa-totp-status--confirmed {
    color: var(--color-accent);
    display: flex;
    align-items: center;
}

/* TOTP Setup Modal */
.totp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 150ms ease;
}

.totp-modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 200ms ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.totp-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.totp-modal__header h3 {
    margin: 0;
    font-size: 0.9375rem;
}

.totp-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-tertiary);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.totp-modal__close:hover {
    color: var(--color-text-primary);
}

.totp-modal__body {
    padding: 20px;
}

/* ===== 2FA User Setup ===== */
.tfa-setup__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--gap);
}

.tfa-setup__status {
    display: flex;
    align-items: flex-start;
    gap: var(--gap);
}

.tfa-setup__status-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tfa-setup__status-icon--active {
    background: color-mix(in srgb, var(--color-status-resolved) 12%, transparent);
    color: var(--color-status-resolved);
}

.tfa-setup__status-icon--email {
    background: color-mix(in srgb, var(--color-status-working) 12%, transparent);
    color: var(--color-status-working);
}

.tfa-setup__methods {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.tfa-setup__method {
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding: var(--gap-sm) 0;
}

.tfa-setup__method-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
}

.tfa-setup__method > div {
    flex: 1;
}

.tfa-setup__qr-wrap {
    display: flex;
    align-items: flex-start;
    gap: var(--gap-lg);
    flex-wrap: wrap;
}

.tfa-setup__qr {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    flex-shrink: 0;
}

.tfa-setup__qr img {
    border-radius: var(--radius-sm);
}

.tfa-setup__manual-key {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tfa-setup__manual-key code {
    font-size: 13px;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    background: var(--color-bg-alt);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    letter-spacing: 2px;
    word-break: break-all;
    color: var(--color-text-primary);
}

.btn--danger-outline {
    background: transparent;
    color: var(--color-status-open);
    border: 1px solid color-mix(in srgb, var(--color-status-open) 40%, transparent);
}

.btn--danger-outline:hover {
    background: color-mix(in srgb, var(--color-status-open) 8%, transparent);
    border-color: var(--color-status-open);
}

/* ===== API Key ===== */
.api-key-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.api-key-input {
    flex: 1;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.api-endpoint-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.api-endpoint-row .api-endpoint {
    flex: 1;
}

.api-endpoint {
    display: block;
    font-size: 12px;
    padding: 8px 12px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    word-break: break-all;
    color: var(--color-text-secondary);
}

.api-endpoint-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.api-endpoint-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.api-endpoint-tab:hover {
    border-color: var(--color-text-tertiary);
    color: var(--color-text-primary);
}

.api-endpoint-tab.is-active {
    border-color: var(--color-accent);
    background: var(--color-accent-bg);
    color: var(--color-text-primary);
}

.api-method {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.api-method--post {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.api-method--get {
    background: rgba(20, 184, 166, 0.15);
    color: #0d9488;
}

.api-usage-code {
    font-size: 12px;
    padding: 12px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.api-usage-code code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    white-space: pre;
}

/* API Report */
.api-report__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--gap);
}

.api-report__total-number {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-display);
    line-height: 1;
    color: var(--color-text-primary);
}

.api-report__total-label {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-left: 6px;
}

.api-report__chart {
    margin: 0 -8px;
}

.api-report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

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

/* ===== Product API ===== */
.product-api-list {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

.product-api-item {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.product-api-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--color-bg-alt);
}

.product-api-item__name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-api-item__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.product-api-item__badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-api-item__badge--active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.product-api-item__badge--nokey {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.product-api-item__badge--disabled {
    background: var(--color-bg-alt);
    color: var(--color-text-tertiary);
    border: 1px solid var(--color-border-light);
}

.product-api-item__calls {
    color: var(--color-text-tertiary);
}

.product-api-item__body {
    padding: 16px;
    border-top: 1px solid var(--color-border-light);
}

.product-api-item__body .settings-field {
    padding: 6px 0;
}

[data-theme="dark"] .product-api-item__badge--active {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

[data-theme="dark"] .product-api-item__badge--nokey {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

/* ===== Email Method Tabs ===== */
.email-method-tabs {
    display: inline-flex;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.email-method-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.email-method-tab:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.email-method-tab:hover {
    background: var(--color-bg-alt);
}

.email-method-tab.active {
    background: var(--color-accent);
    color: #fff;
}

.email-method-tab.active svg {
    stroke: #fff;
}

/* ===== Email Log ===== */
.email-log-table {
    width: 100%;
    border-collapse: collapse;
}

.email-log-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
}

.email-log-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.email-log-table tbody tr:hover {
    background: var(--color-bg-alt);
}

.email-log-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.email-log-badge--sent {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.email-log-badge--failed {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.email-log-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-log-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.email-log-modal__content {
    position: relative;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1;
    background: var(--color-surface, #ffffff);
    border-radius: var(--radius, 12px);
    padding: var(--gap, 20px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.email-log-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.email-log-modal__header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.email-log-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border, #e7e5e4);
    border-radius: var(--radius-sm, 8px);
    background: var(--color-bg-alt, #f5f3f1);
    color: var(--color-text-secondary, #78716c);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 150ms, color 150ms, border-color 150ms;
}

.email-log-modal__close:hover {
    background: var(--color-border, #e7e5e4);
    color: var(--color-text-primary, #1c1917);
    border-color: var(--color-text-tertiary, #a8a29e);
}

/* ===== SMTP Form ===== */
.smtp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--gap);
}

@media (max-width: 640px) {
    .smtp-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MM Form ===== */
.mm-form .form-group {
    margin-bottom: var(--gap);
}

.mm-form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.mm-form .form-textarea {
    font-family: 'Inter', sans-serif;
    resize: vertical;
    min-height: 200px;
}

.mm-form__row {
    display: flex;
    gap: var(--gap);
}

.mm-form__row .form-group {
    flex: 1;
}

.mm-form__actions {
    display: flex;
    gap: var(--gap-sm);
    align-items: center;
}

.radio-group {
    display: flex;
    gap: var(--gap);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* ===== MM Status Toggle ===== */
.mm-status-toggle {
    display: flex;
    gap: 8px;
}
.mm-status-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-tertiary);
    transition: all 0.15s;
    user-select: none;
}
.mm-status-option input[type="radio"] {
    display: none;
}
.mm-status-option:hover {
    border-color: var(--color-text-tertiary);
    color: var(--color-text-secondary);
}
.mm-status-option--draft.is-active {
    background: var(--color-status-working-bg);
    color: var(--color-status-working);
    border-color: var(--color-status-working);
}
.mm-status-option--publish.is-active {
    background: var(--color-status-resolved-bg);
    color: var(--color-status-resolved);
    border-color: var(--color-status-resolved);
}

/* ===== MM Linked Issues Card (overflow visible for dropdown) ===== */
.mm-linked-issues-card {
    overflow: visible !important;
}
.mm-linked-issues-card::before {
    pointer-events: none;
}

/* ===== Reference Link Rows ===== */
.mm-ref-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.mm-ref-link__label {
    flex: 1;
    min-width: 0;
}
.mm-ref-link__url {
    flex: 2;
    min-width: 0;
}
.mm-ref-link__remove {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
}
.mm-ref-link__remove:hover {
    color: #ef4444;
}

/* ===== Issue Search Select ===== */
.issue-search-select {
    position: relative;
}
.issue-search-select__selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.issue-search-select__selected:empty {
    display: none;
}
.issue-search-select__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
    white-space: nowrap;
}
.issue-search-select__tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.issue-search-select__tag-remove:hover {
    opacity: 1;
    background: rgba(0,0,0,0.08);
}
.issue-search-select__input-wrap {
    position: relative;
}
.issue-search-select__input {
    width: 100%;
}
.issue-search-select__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 148px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.issue-search-select__dropdown.is-open {
    display: block;
}
.issue-search-select__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}
.issue-search-select__option:hover {
    background: var(--color-bg-alt);
}
.issue-search-select__option.is-hidden {
    display: none !important;
}
.issue-search-select__option-id {
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.issue-search-select__option-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-primary);
}
.issue-search-select__option .status-badge {
    flex-shrink: 0;
    font-size: 10px;
    padding: 2px 6px;
}

/* ===== Issue Drawer ===== */
.issue-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 500;
    backdrop-filter: blur(2px);
}

.issue-drawer-overlay.is-open {
    display: block;
}

.issue-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 540px;
    max-width: 90vw;
    height: 100vh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    z-index: 510;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

body.admin-bar .issue-drawer {
    top: 32px;
    height: calc(100vh - 32px);
}

.issue-drawer.is-open {
    transform: translateX(0);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}

.issue-drawer__header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--gap-sm);
    padding: var(--gap-sm) var(--gap-lg);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.issue-drawer__title {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-display);
    line-height: 1.3;
    display: none;
    flex: 1;
    min-width: 0;
}

.issue-drawer__header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.issue-drawer__header-actions .btn--ghost {
    font-size: 18px;
    padding: 4px 8px;
}

.issue-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--gap-lg);
}

.issue-drawer__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-lg) 0;
}

.issue-drawer__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

/* SLA lozenge dropdown (matches status/priority pattern) */
.drawer-sla-lozenge {
    position: relative;
}
.sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--color-accent-bg, rgba(20, 184, 166, 0.1));
    color: var(--color-accent);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.sla-badge--none {
    background: var(--color-bg-alt);
    color: var(--color-text-tertiary);
}
.drawer-sla-toggle__chevron {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.drawer-sla-lozenge.is-open .drawer-sla-toggle__chevron {
    transform: rotate(180deg);
}
.drawer-sla-lozenge__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 20;
}
.drawer-sla-lozenge.is-open .drawer-sla-lozenge__dropdown {
    display: block;
}
.drawer-sla-lozenge__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}
.drawer-sla-lozenge__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}
.drawer-sla-lozenge__option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}

/* Taxonomy labels (product, category) */
.issue-drawer__taxonomy-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--gap);
}
.drawer-tax-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
}

/* Status lozenge dropdown */
.drawer-status-lozenge {
    position: relative;
}
.drawer-status-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
}
.drawer-priority-toggle {
    border: none;
}
.drawer-status-toggle__chevron {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.drawer-status-lozenge.is-open .drawer-status-toggle__chevron {
    transform: rotate(180deg);
}
.drawer-status-lozenge__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 170px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 20;
}
.drawer-status-lozenge.is-open .drawer-status-lozenge__dropdown {
    display: block;
}
.drawer-status-lozenge__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}
.drawer-status-lozenge__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}
.drawer-status-lozenge__option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}

/* Priority lozenge dropdown */
.drawer-priority-lozenge {
    position: relative;
}
.drawer-priority-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.drawer-priority-toggle__chevron {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.drawer-priority-lozenge.is-open .drawer-priority-toggle__chevron {
    transform: rotate(180deg);
}
.drawer-priority-lozenge__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 170px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 20;
}
.drawer-priority-lozenge.is-open .drawer-priority-lozenge__dropdown {
    display: block;
}
.drawer-priority-lozenge__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}
.drawer-priority-lozenge__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}
.drawer-priority-lozenge__option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}

/* Product label under title */
.issue-drawer__product-label {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--gap);
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.issue-drawer__inline-title {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-display);
    line-height: 1.3;
    margin-bottom: 8px;
}

.issue-drawer__inline-title--editable {
    cursor: text;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    margin-left: -6px;
    outline: none;
    transition: background 0.15s;
}

.issue-drawer__inline-title--editable:hover {
    background: var(--color-bg-alt);
}

.issue-drawer__inline-title--editable:focus {
    background: var(--color-bg-alt);
    box-shadow: 0 0 0 2px var(--color-accent);
}

.issue-drawer__controls-section {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    padding: var(--gap) 0;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: var(--gap-lg);
}

/* Drawer assignee dropdown */
.drawer-assign__label,
.drawer-status__label,
.drawer-taxonomy__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
    margin-bottom: 6px;
}

.drawer-assign {
    position: relative;
}

.drawer-assign__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-primary);
    width: 100%;
    transition: border-color 0.15s ease;
}

.drawer-assign__trigger:hover {
    border-color: var(--color-text-tertiary);
}

.drawer-assign__trigger--unassigned {
    color: var(--color-status-open);
}

.drawer-assign__trigger--unassigned svg {
    stroke: var(--color-status-open);
}

.drawer-assign__name {
    flex: 1;
    text-align: left;
}

.drawer-assign__chevron {
    opacity: 0.4;
    flex-shrink: 0;
}

.drawer-assign__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 10;
    padding: 4px;
    max-height: 220px;
    overflow-y: auto;
}

.drawer-assign__dropdown.is-open {
    display: block;
}

.drawer-assign__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}

.drawer-assign__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.drawer-assign__option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}

.drawer-assign__option img {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Drawer status buttons */
.drawer-status-actions {
    display: flex;
    gap: 6px;
}

.drawer-status__btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.drawer-status__btn:hover {
    border-color: var(--color-text-tertiary);
    color: var(--color-text-primary);
}

.drawer-status__btn--open.is-active {
    background: var(--color-status-open);
    border-color: var(--color-status-open);
    color: #fff;
}

.drawer-status__btn--working.is-active {
    background: var(--color-status-working);
    border-color: var(--color-status-working);
    color: #fff;
}

.drawer-status__btn--resolved.is-active {
    background: var(--color-status-resolved);
    border-color: var(--color-status-resolved);
    color: #fff;
}

/* Drawer taxonomy dropdowns */
.drawer-taxonomy {
    position: relative;
}

.drawer-taxonomy__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-primary);
    width: 100%;
    transition: border-color 0.15s ease;
}

.drawer-taxonomy__trigger:hover {
    border-color: var(--color-text-tertiary);
}

.drawer-taxonomy__trigger--none {
    color: var(--color-text-tertiary);
}

.drawer-taxonomy__name {
    flex: 1;
    text-align: left;
}

.drawer-taxonomy__chevron {
    opacity: 0.4;
    flex-shrink: 0;
}

.drawer-taxonomy__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 10;
    padding: 4px;
    max-height: 220px;
    overflow-y: auto;
}

.drawer-taxonomy__dropdown.is-open {
    display: block;
}

.drawer-taxonomy__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}

.drawer-taxonomy__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.drawer-taxonomy__option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}

/* SLA Progress Bar */
.sla-progress {
    margin-top: 8px;
    padding: 8px 0;
}
.sla-progress__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.sla-progress__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.sla-progress__time {
    font-size: 11px;
    color: var(--color-text-tertiary);
}
.sla-progress__track {
    height: 6px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.sla-progress__bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}
.sla-progress--warning .sla-progress__bar {
    background: var(--color-status-working);
}
.sla-progress--breached .sla-progress__bar {
    background: var(--color-status-open);
}
.sla-progress--breached .sla-progress__time {
    color: var(--color-status-open);
    font-weight: 600;
}
.sla-progress__pct {
    font-size: 10px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
    text-align: right;
}

/* Priority dot in dropdown */
.drawer-taxonomy__option .compact-dot {
    flex-shrink: 0;
}

/* Taxonomy selects on single issue page */
.taxonomy-select {
    width: auto;
    min-width: 120px;
}

/* SLA breach highlight */
#toggle-sla-breach.is-active {
    color: var(--color-status-open);
    background: rgba(239, 68, 68, 0.1);
}
.sla-breach-highlight {
    outline: 2px solid var(--color-status-open);
    outline-offset: -2px;
}

/* Empty products toggle */
#toggle-empty-products {
    margin-right: 4px;
}

.issue-drawer__section {
    margin-bottom: var(--gap-lg);
}

.issue-drawer__section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
    margin-bottom: var(--gap-sm);
}

.issue-drawer__content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-primary);
}

.issue-drawer__content p {
    margin-bottom: var(--gap-sm);
}

.drawer-linked-item {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    margin-bottom: 6px;
    transition: border-color 0.15s;
}
.drawer-linked-item:hover {
    border-color: var(--color-border);
}
.drawer-linked-item .status-badge {
    margin-left: auto;
    flex-shrink: 0;
}

.issue-drawer__footer {
    padding-top: var(--gap);
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--gap);
}

.issue-drawer__screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.issue-drawer__screenshots img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
}

.issue-drawer__steps {
    list-style: none;
    padding: 0;
    counter-reset: step;
}

.issue-drawer__steps li {
    counter-increment: step;
    padding: 6px 0 6px 28px;
    position: relative;
    font-size: 14px;
    color: var(--color-text-primary);
}

.issue-drawer__steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-tertiary);
}

.issue-drawer__info {
    font-size: 12px;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    flex-wrap: wrap;
}

.issue-drawer__kb-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--color-accent);
    font-weight: 500;
}

.issue-drawer__footer {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding-top: var(--gap);
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
}

.issue-drawer__admin-actions {
    display: flex;
    gap: var(--gap-sm);
    padding-top: var(--gap);
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--gap);
}

/* ===== Issue Notes ===== */
.issue-notes {
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--gap);
}

.issue-notes__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    color: var(--color-text-tertiary);
    margin-left: 4px;
}

.note-form {
    display: none;
    margin-bottom: 8px;
}
.note-form.is-expanded {
    display: block;
}

.note-form__add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: auto;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-tertiary);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 150ms, color 150ms, transform 150ms;
}
.note-form__add:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.note-form__add.is-active {
    transform: rotate(45deg);
    color: var(--color-text-tertiary);
}

.note-form__input {
    resize: vertical;
    min-height: 52px;
    font-size: 13px;
    padding: 8px 12px;
    width: 100%;
}

.issue-notes__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.issue-notes__empty {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 13px;
    padding: 12px 0;
}

.issue-note {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background 150ms;
}
.issue-note:hover {
    background: var(--color-bg-alt);
}

.issue-note__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.issue-note__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.issue-note__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 150ms;
}
.issue-note:hover .issue-note__actions {
    opacity: 1;
}
.issue-note__delete,
.issue-note__edit {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--color-text-tertiary);
    border-radius: var(--radius);
    display: flex;
    transition: color 150ms;
}
.issue-note__delete:hover {
    color: var(--color-status-open);
}
.issue-note__edit:hover {
    color: var(--color-accent);
}
.note-edit-textarea {
    width: 100%;
    margin: 4px 0;
    font-size: 13px;
}
.note-edit-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

.issue-note__content {
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.issue-note__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.issue-note__time {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

/* ===== Create Issue Drawer ===== */
.create-issue-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}
.create-issue-drawer-overlay.is-open {
    display: block;
}
.create-issue-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 100vw;
    background: var(--color-surface);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}
.create-issue-drawer.is-open {
    transform: translateX(0);
}
.create-issue-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap) var(--gap-lg);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.create-issue-drawer__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.create-issue-drawer__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    padding: 4px;
    border-radius: var(--radius);
    transition: color 150ms;
}
.create-issue-drawer__close:hover {
    color: var(--color-text-primary);
}
.create-issue-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--gap-lg);
}
.create-issue-drawer__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--gap-sm);
    padding: var(--gap) var(--gap-lg);
    border-top: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .create-issue-drawer {
        width: 100vw;
    }
}

/* Note reactions */
.note-reactions {
    display: flex;
    gap: 2px;
}
.note-reaction {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 5px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: background 150ms;
}
.note-reaction.is-empty {
    opacity: 0;
}
.issue-note:hover .note-reaction.is-empty {
    opacity: 0.5;
}
.issue-note:hover .note-reaction.is-empty:hover {
    opacity: 1;
    background: var(--color-bg-alt);
}
.note-reaction:not(.is-empty) {
    background: var(--color-bg-alt);
}
.note-reaction.is-active:not(.is-empty) {
    background: color-mix(in srgb, var(--color-accent) 15%, transparent);
}
.note-reaction__emoji {
    font-size: 12px;
    line-height: 1;
}
.note-reaction__count {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-tertiary);
}
.note-reaction.is-active .note-reaction__count {
    color: var(--color-accent);
}
.note-reaction {
    position: relative;
}
.note-reaction__tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text-primary);
    color: var(--color-bg);
    font-size: 11px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    pointer-events: none;
    z-index: 10;
    text-align: left;
    width: max-content;
}
.note-reaction:hover .note-reaction__tooltip {
    display: block;
}
.note-reaction__tooltip-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.note-reaction__tooltip-emoji {
    font-size: 11px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .issue-drawer {
        width: 100vw;
        max-width: 100vw;
    }
}

/* ===== Confirm / Merge Modals ===== */
.ib-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms;
}
.ib-modal-overlay.is-visible {
    background: rgba(0, 0, 0, 0.45);
}
.ib-modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    width: 420px;
    max-width: 92vw;
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    transition: all 200ms ease-out;
}
.ib-modal-overlay.is-visible .ib-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.ib-modal--merge {
    width: 500px;
}
.ib-modal__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}
.ib-modal__message {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: var(--gap);
}
.ib-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--gap-sm);
    margin-top: var(--gap);
}
.ib-modal__confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Merge search */
.ib-merge-search__input {
    margin-bottom: var(--gap-sm);
}
.ib-merge-search__results {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
}
.ib-merge-search__results:empty {
    border: none;
}
.ib-merge-search__item {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background 120ms;
}
.ib-merge-search__item:hover {
    background: var(--color-bg-hover);
}
.ib-merge-search__item.is-selected {
    background: color-mix(in srgb, var(--color-accent) 12%, transparent);
}
.ib-merge-search__item-id {
    color: var(--color-text-tertiary);
    font-size: 12px;
    min-width: 40px;
}
.ib-merge-search__item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ib-merge-search__empty {
    padding: 16px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 13px;
}

/* ===== Profile Form ===== */
.profile-form .form-group {
    margin-bottom: var(--gap);
}

.profile-form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.profile-form__avatar-section {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.profile-form__avatar {
    position: relative;
    cursor: pointer;
}

.profile-form__avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border-light);
}

.profile-form__avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    color: #fff;
}

.profile-form__avatar:hover .profile-form__avatar-overlay {
    opacity: 1;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-accent);
    cursor: pointer;
    font-size: inherit;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

.profile-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

.profile-form__actions {
    display: flex;
    gap: var(--gap-sm);
}

/* ===== TV Mode ===== */
.tv-countdown {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 10001;
    font-size: 12px;
    color: var(--color-text-tertiary);
}
.tv-countdown__track {
    flex: 1;
    height: 4px;
    background: var(--color-bg-alt);
    border-radius: 2px;
    overflow: hidden;
}
.tv-countdown__progress {
    height: 100%;
    width: 0%;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 1s linear;
}
.tv-countdown__label {
    white-space: nowrap;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
}
.tv-countdown__exit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    font-size: 11px;
    color: var(--color-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 150ms, color 150ms;
}
.tv-countdown__exit:hover {
    border-color: var(--color-text-secondary);
    color: var(--color-text-primary);
}

body.tv-mode .site-header,
body.tv-mode .dashboard-sidebar,
body.tv-mode .page-header,
body.tv-mode .reports-login-log,
body.tv-mode .reports-last-login,
body.tv-mode .reports-card__drag-handle,
body.tv-mode .reports-card__actions,
body.tv-mode .reports-card__controls,
body.tv-mode .reports-chart-card[data-chart-id="comments_by_user"],
body.tv-mode .reports-chart-card[data-chart-id="ai_requests"],
body.tv-mode .reports-chart-card[data-chart-id="ai_tokens"],
body.tv-mode .fab-wrapper {
    display: none !important;
}
body.tv-mode {
    overflow: hidden;
}
body.tv-mode .dashboard-layout {
    grid-template-columns: 1fr !important;
    min-height: 100vh;
    height: 100vh;
}
body.tv-mode .dashboard-content {
    padding: 12px 16px 40px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body.tv-mode .issue-summary-cards {
    flex-shrink: 0;
    margin-bottom: 8px;
}
body.tv-mode .reports-chart-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}
body.tv-mode .reports-chart-card {
    padding: 10px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body.tv-mode .reports-chart-card .reports-chart-container {
    flex: 1;
    min-height: 0;
}
body.tv-mode .reports-chart-card .reports-card__summary {
    margin-bottom: 4px;
}
body.tv-mode .reports-chart-card .reports-card__header {
    margin-bottom: 4px;
}
body.tv-mode .tv-countdown {
    display: flex;
}

/* TV Mode button group & dropdown */
.tv-mode-wrapper {
    position: relative;
}
.tv-mode-btn-group {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.tv-mode-btn-group .btn {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.tv-mode-menu-btn {
    padding: 6px 6px !important;
    border-left: 1px solid var(--color-border) !important;
}
.tv-mode-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 360px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    padding: 16px;
}
.tv-mode-dropdown.is-open {
    display: block;
}
.tv-mode-dropdown__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}
.tv-mode-dropdown__desc {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin: 0 0 10px;
}
.tv-mode-dropdown__url-row {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}
.tv-mode-dropdown__url {
    flex: 1;
    font-size: 11px !important;
    font-family: var(--font-mono, monospace) !important;
    padding: 6px 8px !important;
}
.tv-mode-dropdown__actions {
    display: flex;
    gap: 6px;
}

/* ===== Footer ===== */

.site-footer {
    padding: 32px var(--gap) 12px;
    margin-top: auto;
    background: var(--color-bg);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--gap);
    font-size: 12px;
    color: var(--color-text-tertiary);
    text-align: center;
}

.footer-kbd {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--font-body);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Show Mac shortcut on Mac, Windows shortcut on others — JS adds .is-mac or .is-win to <html> */
.footer-kbd--win,
.footer-kbd--mac { display: none; }
.is-mac .footer-kbd--mac { display: inline-flex; }
.is-win .footer-kbd--win { display: inline-flex; }

.footer-credit {
    text-align: center;
}

.footer-credit a {
    color: var(--color-text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 2px;
}

.footer-credit a:hover {
    color: var(--color-accent);
    text-decoration-color: var(--color-accent);
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: var(--radius-full);
    animation: spin 600ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Selection Tiles ===== */
.selection-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--gap-sm);
}

.selection-tile {
    padding: var(--gap-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.selection-tile:hover {
    border-color: var(--color-text-tertiary);
}

.selection-tile.active {
    border-color: rgba(20, 184, 166, 0.3);
    background: var(--color-surface);
}

.selection-tile.inactive {
    filter: grayscale(1);
    opacity: 0.6;
}

.selection-tile__icon {
    width: 32px;
    height: 32px;
    margin: 0 auto var(--gap-sm);
}

.selection-tile__title {
    font-size: 13px;
    font-weight: 600;
}

.selection-tile__text {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .col-span-7,
    .col-span-8,
    .col-span-9,
    .col-span-10,
    .col-span-11,
    .col-span-12 {
        grid-column: span 6;
    }

    .col-span-5,
    .col-span-4 {
        grid-column: span 3;
    }

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

    .filter-sidebar {
        position: static;
    }

    .stats-row {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 calc(50% - var(--gap));
    }

    .dashboard-layout,
    .dashboard-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .sidebar-toggle {
        display: none;
    }

    .dashboard-sidebar,
    .dashboard-sidebar.is-collapsed {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border-light);
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--gap);
        padding: var(--gap);
        align-items: stretch;
    }

    .dashboard-sidebar.is-collapsed .sidebar-section__title-text,
    .dashboard-sidebar.is-collapsed .sidebar-stat-card,
    .dashboard-sidebar.is-collapsed .sidebar-chart-card,
    .dashboard-sidebar.is-collapsed .sidebar-age-cards,
    .dashboard-sidebar.is-collapsed .compliance-card {
        display: revert;
    }
    .dashboard-sidebar.is-collapsed .sidebar-section__icon {
        display: none;
    }
    .dashboard-sidebar.is-collapsed .sidebar-section {
        border-bottom: revert;
        padding-bottom: revert;
        margin-bottom: revert;
        gap: 8px;
        width: auto;
    }

    .sidebar-section {
        flex: 1 1 auto;
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
        border-right: 1px solid var(--color-border-light);
        padding-right: var(--gap);
    }

    .sidebar-section:last-child {
        border-right: none;
        padding-right: 0;
    }

    .sidebar-stat-card {
        flex: 1 1 calc(50% - 4px);
    }

    .sidebar-progress-wrap {
        justify-content: flex-start;
    }

    .product-columns {
        columns: 260px;
    }
}

@media (max-width: 1350px) {
    .header-nav a {
        font-size: 0;
        padding: 6px 8px;
        gap: 0;
    }
    .header-nav a svg {
        width: 18px;
        height: 18px;
    }
    .header-nav {
        gap: var(--gap-sm);
    }
}

@media (max-width: 640px) {
    :root {
        --gap: 1rem;
        --gap-lg: 1.5rem;
    }

    h1 {
        font-size: 28px;
        line-height: 32px;
    }

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

    .col-span-1,
    .col-span-2,
    .col-span-3,
    .col-span-4,
    .col-span-5,
    .col-span-6,
    .col-span-7,
    .col-span-8,
    .col-span-9,
    .col-span-10,
    .col-span-11,
    .col-span-12 {
        grid-column: span 1;
    }

    .row-span-2,
    .row-span-3 {
        grid-row: span 1;
    }

    .page-header {
        flex-direction: column;
    }

    .header-nav {
        display: none;
    }

    .header-user-info {
        display: none;
    }

    .stats-row {
        flex-direction: column;
    }

    .stat-card {
        flex: 1 1 100%;
    }

    .dashboard-sidebar {
        flex-direction: column;
    }

    .sidebar-section {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--color-border-light);
        padding-bottom: var(--gap-sm);
        margin-bottom: var(--gap-sm);
    }

    .sidebar-section:last-child {
        border-bottom: none;
    }

    .sidebar-stat-card {
        flex: 1 1 100%;
    }

    .dashboard-content {
        padding: var(--gap);
    }

    .product-columns {
        columns: 1;
    }

    .form-row {
        flex-direction: column;
    }

    .screenshot-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        margin: var(--gap-sm);
        max-height: calc(100vh - var(--gap));
    }

    .filter-tabs {
        overflow-x: auto;
        width: 100%;
    }
}

/* ===== WordPress Admin Bar Adjustment ===== */
body.admin-bar .site-header {
    top: 32px;
}

body.admin-bar .dashboard-sidebar {
    top: calc(var(--header-height) + 32px);
    height: calc(100vh - var(--header-height) - 32px);
}

body.admin-bar .dashboard-layout {
    min-height: calc(100vh - var(--header-height) - 32px);
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }

    body.admin-bar .dashboard-sidebar {
        top: auto;
        height: auto;
    }
}

/* ===== Screen Reader Text ===== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal;
}

.screen-reader-text:focus {
    background-color: var(--color-surface);
    clip: auto;
    display: block;
    font-size: 14px;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ===== Team Badge ===== */
.team-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    white-space: nowrap;
}
.team-badge svg {
    flex-shrink: 0;
}

/* ===== Teams Split Layout (Settings Page) ===== */
.teams-split {
    display: flex;
    gap: var(--gap);
    align-items: flex-start;
}
.teams-split__left {
    flex: 0 0 40%;
    min-width: 0;
}
.teams-split__right {
    flex: 0 0 calc(60% - var(--gap));
    min-width: 0;
}
@media (max-width: 900px) {
    .teams-split {
        flex-direction: column;
    }
    .teams-split__left,
    .teams-split__right {
        flex: none;
        width: 100%;
    }
}

/* ===== Team Membership (Settings Page) ===== */
.team-membership {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}
.team-membership__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-bg-alt);
    cursor: pointer;
}
.team-membership__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.team-membership__rename-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    padding: 2px;
    display: flex;
    opacity: 0;
    transition: opacity 150ms, color 150ms;
}
.team-membership:hover .team-membership__rename-btn {
    opacity: 0.6;
}
.team-membership__rename-btn:hover {
    color: var(--color-accent);
    opacity: 1 !important;
}
.team-membership__rename {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-light);
}
.team-membership__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--color-border);
    color: var(--color-text-secondary);
}
.team-membership__toggle {
    transition: transform 0.2s;
}
.team-membership__toggle.is-expanded {
    transform: rotate(180deg);
}
.team-membership__body {
    padding: 12px 14px;
    border-top: 1px solid var(--color-border);
}
.team-membership__members {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.team-membership__member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text-primary);
    background: var(--color-bg-alt);
}
.team-membership__member img {
    border-radius: 50%;
    width: 28px;
    height: 28px;
}
.team-membership__member span {
    flex: 1;
}
.team-membership__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}
.team-membership__remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}
.team-membership__add {
    margin-top: 8px;
}
/* ===== Team User Search Picker ===== */
.team-user-search {
    position: relative;
}
.team-user-search__input-wrap {
    position: relative;
}
.team-user-search__icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    pointer-events: none;
}
.team-user-search__input {
    width: 100%;
    padding-left: 32px !important;
    font-size: 13px;
}
.team-user-search__dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.team-user-search__dropdown.is-open {
    display: block;
}
.team-user-search__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 13px;
}
.team-user-search__option:hover {
    background: var(--color-bg-alt);
}
.team-user-search__option img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}
.team-user-search__option-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.team-user-search__option-name {
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.team-user-search__option-email {
    font-size: 11px;
    color: var(--color-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.team-user-search__option-team {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--color-bg-alt);
    color: var(--color-text-secondary);
    white-space: nowrap;
}
.team-user-search__empty {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* Sidebar Toggle */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text-tertiary);
    cursor: pointer;
    margin-bottom: var(--gap-sm);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    align-self: flex-end;
}
.sidebar-toggle:hover {
    color: var(--color-text);
    border-color: var(--color-border);
}
.sidebar-toggle svg {
    transition: transform 0.2s;
}

/* Sidebar section icons (visible when collapsed) */
.sidebar-section__icon {
    display: none;
    flex-shrink: 0;
    color: var(--color-text-tertiary);
}

/* No issues — full-width layout */
.dashboard-layout.no-issues {
    grid-template-columns: 1fr;
}

.dashboard-layout.no-issues .dashboard-sidebar {
    display: none;
}

.dashboard-layout.no-issues .dashboard-content {
    align-items: center;
    justify-content: center;
}

.dashboard-layout.no-issues .dashboard-topbar {
    display: none;
}

.dashboard-layout.no-issues .product-columns {
    columns: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
}

/* Collapsible Sidebar */
.dashboard-layout {
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: grid-template-columns;
}
.dashboard-sidebar {
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Sidebar inner content — fade instead of display:none */
.dashboard-sidebar .sidebar-section__title-text,
.dashboard-sidebar .sidebar-stat-card,
.dashboard-sidebar .sidebar-chart-card,
.dashboard-sidebar .sidebar-age-cards,
.dashboard-sidebar .compliance-card {
    transition: opacity 0.15s ease, max-height 0.3s ease, margin 0.3s ease;
    opacity: 1;
    max-height: 500px;
    overflow: hidden;
}

.dashboard-layout.sidebar-collapsed {
    grid-template-columns: 56px 1fr;
}

.dashboard-sidebar.is-collapsed {
    padding: 12px 8px;
    align-items: center;
}
.dashboard-sidebar.is-collapsed .sidebar-toggle {
    width: 28px;
    height: 28px;
    margin-right: 5px;
}
.dashboard-sidebar.is-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}
.dashboard-sidebar .sidebar-toggle svg {
    transition: transform 0.3s ease;
}
.dashboard-sidebar.is-collapsed .sidebar-section__icon {
    display: block;
}
.dashboard-sidebar.is-collapsed .sidebar-section__title {
    justify-content: center;
    gap: 0;
}
.dashboard-sidebar.is-collapsed .sidebar-section__title-text,
.dashboard-sidebar.is-collapsed .sidebar-stat-card,
.dashboard-sidebar.is-collapsed .sidebar-chart-card,
.dashboard-sidebar.is-collapsed .sidebar-age-cards,
.dashboard-sidebar.is-collapsed .compliance-card {
    opacity: 0;
    max-height: 0;
    max-width: 0;
    margin: 0;
    padding: 0;
    visibility: hidden;
    overflow: hidden;
    transition: opacity 0.1s ease, max-height 0.25s ease 0.05s, margin 0.25s ease 0.05s, visibility 0s 0.1s;
}
.dashboard-sidebar.is-collapsed .sidebar-section {
    border-bottom: none;
    padding-bottom: 4px;
    margin-bottom: 4px;
    gap: 0;
    width: 100%;
}

.sidebar-section__title {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* SLA Breach outline on issue cards */
.issue-card-compact--sla-breach {
    outline: 2px solid var(--color-status-open);
    outline-offset: -2px;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* SLA Breach stat card */
.sidebar-stat-card--sla-breach {
    border-left: 3px solid var(--color-border-light);
}

/* ===== User Settings Sidebar ===== */
.user-settings-nav__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--color-border);
}

.user-settings-nav__user img {
    border-radius: 50%;
    flex-shrink: 0;
}

.user-settings-nav__user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-settings-nav__name {
    font-size: 14px;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-settings-nav__username {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.user-settings-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 8px;
    gap: 2px;
}

.user-settings-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.user-settings-nav__link:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.user-settings-nav__link.is-active {
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
}

.user-settings-nav__link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.user-settings-nav__link.is-active svg {
    opacity: 1;
}

/* Clickable KB card */
.kb-card--clickable {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.kb-card--clickable:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
}

.kb-card--clickable a {
    color: inherit;
    text-decoration: none;
}

/* ===== Archive View Bar ===== */
.archive-view-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--gap);
}

/* ===== Compact Grid View (Dashboard) ===== */
.issue-compact-grid .issue-card-compact {
    padding: 6px 10px;
}

.issue-compact-grid .issue-card-compact__desc {
    display: none;
}

.issue-compact-grid .issue-card-compact__header {
    margin-bottom: 2px;
}

.issue-compact-grid .issue-card-compact__title {
    font-size: 12px;
}


/* ===== Compact Archive View ===== */
.archive-view--compact {
    grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 1200px) {
    .archive-view--compact {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .archive-view--compact {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .archive-view--compact {
        grid-template-columns: 1fr !important;
    }
}

.archive-view--compact .bento-card {
    padding: 14px;
}

.archive-view--compact .issue-card__excerpt,
.archive-view--compact .kb-card__excerpt {
    display: none;
}

.archive-view--compact .issue-card__title,
.archive-view--compact .kb-card__title {
    font-size: 13px;
}

/* ===== KB List View ===== */
.kb-list-view .kb-list-header,
.kb-list-view .kb-list-row {
    display: grid;
    grid-template-columns: 100px 1fr 120px 120px 90px;
    align-items: center;
    gap: var(--gap-sm);
    padding: 8px 16px;
}

.kb-list-view .kb-list-header {
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 2;
}

.kb-list-view .issue-list-row.kb-list-row {
    grid-template-columns: 100px 1fr 120px 120px 90px;
    padding: 10px 16px;
}

.kb-list-row {
    cursor: pointer;
}

.kb-list-row:hover {
    background: var(--color-bg-alt);
}

/* KB Product Dropdown */
.kb-product-dropdown {
    position: relative;
}

.kb-product-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kb-product-dropdown__chevron {
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.kb-product-dropdown.is-open .kb-product-dropdown__chevron {
    transform: rotate(180deg);
}

.kb-product-dropdown__panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.kb-product-dropdown.is-open .kb-product-dropdown__panel {
    display: block;
}

.kb-product-dropdown__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}

.kb-product-dropdown__option:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.kb-product-dropdown__check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.kb-product-dropdown__option.is-selected .kb-product-dropdown__check {
    opacity: 1;
    color: var(--color-accent);
}

.kb-product-dropdown__option.is-selected {
    color: var(--color-accent);
    font-weight: 500;
}

/* KB filter search inline */
.filter-tabs__search {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* ===== AI Search Panel ===== */
.header-ai-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
}
.header-ai-toggle:hover {
    color: var(--color-accent);
    background: var(--color-accent-bg);
}

.ai-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 600;
    backdrop-filter: blur(2px);
}
.ai-search-overlay.is-open {
    display: block;
}

.ai-search-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 92vw;
    height: 100vh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    z-index: 610;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.ai-search-panel.is-open {
    transform: translateX(0);
}

.ai-search-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-sm) var(--gap);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.ai-search-panel__header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-search-panel__header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-search-panel__title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-primary);
}
.ai-search-panel__clear {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-search-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px !important;
}

/* Chat messages area */
.ai-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--gap);
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

.ai-chat__welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--gap-sm);
    padding: var(--gap-xl) var(--gap);
    color: var(--color-text-tertiary);
    flex: 1;
}
.ai-chat__welcome p {
    font-size: 14px;
    max-width: 280px;
    line-height: 1.5;
    margin: 0;
}

/* Message bubbles */
.ai-chat__message {
    display: flex;
    flex-direction: column;
    max-width: 88%;
}
.ai-chat__message--user {
    align-self: flex-end;
}
.ai-chat__message--assistant {
    align-self: flex-start;
}

.ai-chat__bubble {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}
.ai-chat__message--user .ai-chat__bubble {
    background: var(--color-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-chat__message--assistant .ai-chat__bubble {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
    border-bottom-left-radius: 4px;
}
.ai-chat__bubble p {
    margin: 0 0 8px;
}
.ai-chat__bubble p:last-child {
    margin-bottom: 0;
}
.ai-chat__bubble ul {
    margin: 4px 0 8px;
    padding-left: 18px;
}
.ai-chat__bubble li {
    margin-bottom: 2px;
}
.ai-chat__bubble code {
    background: rgba(0,0,0,0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}
.ai-chat__bubble pre {
    background: rgba(0,0,0,0.06);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
}
.ai-chat__bubble pre code {
    background: none;
    padding: 0;
}
.ai-chat__message--user .ai-chat__bubble code {
    background: rgba(255,255,255,0.2);
}
.ai-chat__message--assistant .ai-chat__bubble a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ai-chat__message--assistant .ai-chat__bubble a:hover {
    color: var(--color-accent-dark);
}
.ai-chat__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
}
.ai-chat__table th,
.ai-chat__table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}
.ai-chat__table th {
    font-weight: 600;
    font-size: 12px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ai-chat__table tr:last-child td {
    border-bottom: none;
}

/* Typing indicator */
.ai-chat__typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-self: flex-start;
}
.ai-chat__typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-tertiary);
    animation: aiTypingDot 1.4s infinite ease-in-out both;
}
.ai-chat__typing span:nth-child(2) { animation-delay: 0.16s; }
.ai-chat__typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes aiTypingDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Source cards */
.ai-chat__sources {
    margin-top: 6px;
}
.ai-chat__sources-toggle {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-chat__sources-toggle::before {
    content: '\25B6';
    font-size: 8px;
    transition: transform var(--transition-fast);
}
.ai-chat__sources-toggle.is-expanded::before {
    transform: rotate(90deg);
}
.ai-chat__sources-list {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.ai-chat__sources-list.is-expanded {
    display: flex;
}
.ai-chat__source-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast);
}
.ai-chat__source-card:hover {
    border-color: var(--color-accent);
}
.ai-chat__source-icon {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
}
.ai-chat__source-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ai-chat__source-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-chat__source-meta {
    font-size: 11px;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-chat__source-status {
    background: var(--color-bg);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 10px;
    text-transform: capitalize;
}

/* Feedback (thumbs up/down) */
.ai-chat__feedback {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.ai-chat__feedback-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    cursor: pointer;
    color: var(--color-text-tertiary);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}
.ai-chat__feedback-btn:hover {
    color: var(--color-text-secondary);
    background: var(--color-surface-raised, rgba(0,0,0,0.04));
}
.ai-chat__feedback-btn.is-active[data-rating="1"] {
    color: var(--color-success, #22c55e);
    border-color: var(--color-success, #22c55e);
    background: rgba(34, 197, 94, 0.08);
}
.ai-chat__feedback-btn.is-active[data-rating="-1"] {
    color: var(--color-danger, #ef4444);
    border-color: var(--color-danger, #ef4444);
    background: rgba(239, 68, 68, 0.08);
}

/* Footer / Input */
.ai-chat__footer {
    border-top: 1px solid var(--color-border-light);
    padding: var(--gap-sm) var(--gap);
    flex-shrink: 0;
}
.ai-chat__remaining {
    font-size: 11px;
    color: var(--color-text-tertiary);
    margin-bottom: 8px;
    text-align: center;
}
.ai-chat__input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 8px 8px 14px;
    transition: border-color var(--transition-fast);
}
.ai-chat__input-wrap:focus-within {
    border-color: var(--color-accent);
}
.ai-chat__input {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-primary);
    outline: none;
    max-height: 120px;
}
.ai-chat__input::placeholder {
    color: var(--color-text-tertiary);
}
.ai-chat__send {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.ai-chat__send:hover {
    background: var(--color-accent-dark);
}
.ai-chat__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dark mode overrides */
[data-theme="dark"] .ai-search-panel {
    background: #292524;
}
[data-theme="dark"] .ai-chat__message--assistant .ai-chat__bubble {
    background: #1c1917;
}
[data-theme="dark"] .ai-chat__bubble code {
    background: rgba(255,255,255,0.1);
}
[data-theme="dark"] .ai-chat__bubble pre {
    background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .ai-chat__source-card {
    background: #1c1917;
    border-color: #44403c;
}
[data-theme="dark"] .ai-chat__input-wrap {
    background: #1c1917;
    border-color: #44403c;
}

/* Mobile */
@media (max-width: 640px) {
    .ai-search-panel {
        width: 100vw;
        max-width: 100vw;
    }
}

/* ===== Reports Page ===== */
.reports-chart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}
@media (max-width: 1200px) {
    .reports-chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .reports-chart-grid {
        grid-template-columns: 1fr;
    }
}

.reports-chart-card {
    position: relative;
    cursor: default;
}

.reports-chart-container {
    min-height: 180px;
}

.reports-card__drag-handle {
    flex-shrink: 0;
    width: 0;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--color-text-muted);
    opacity: 0;
    overflow: hidden;
    transition: width 0.2s ease, opacity 0.15s ease, margin 0.2s ease;
    border-radius: var(--radius-sm);
    margin-right: 0;
}

.reports-chart-card:hover .reports-card__drag-handle {
    width: 20px;
    margin-right: 4px;
    opacity: 0.5;
}

.reports-card__drag-handle:hover {
    opacity: 1 !important;
    color: var(--color-text-secondary);
}

.reports-card__drag-handle:active {
    cursor: grabbing;
}

.reports-chart-card.is-dragging {
    opacity: 0.4;
    transform: scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.reports-chart-card.drag-over-before {
    box-shadow: -3px 0 0 0 var(--color-accent);
}

.reports-chart-card.drag-over-after {
    box-shadow: 3px 0 0 0 var(--color-accent);
}

.reports-card__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reports-card__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.reports-chart-type-toggle {
    padding: 3px !important;
}

.reports-chart-type-toggle svg {
    width: 13px;
    height: 13px;
}

.reports-card__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.reports-card__controls {
    flex-shrink: 0;
}

.reports-card__summary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.reports-summary-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.reports-summary-stat__value {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1;
}

.reports-summary-stat__label {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

[data-theme="dark"] .reports-card__summary {
    background: none;
}

/* ===== Help Page ===== */
.help-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--gap-lg, 32px);
    align-items: start;
}

.help-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 80px;
}

.help-sidebar__link {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.help-sidebar__link:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.help-sidebar__link.is-active {
    background: var(--color-accent-subtle, rgba(99, 102, 241, 0.08));
    color: var(--color-accent);
    font-weight: 500;
}

.help-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 32px 40px;
    min-width: 0;
}

.help-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.help-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 12px;
}

.help-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 24px 0 8px;
}

.help-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 20px 0 8px;
}

.help-content p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
}

.help-content ul,
.help-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.help-content li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.help-content strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.help-content code {
    background: var(--color-bg-alt);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
}

.help-content pre {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
    margin: 0 0 16px;
}

.help-content pre code {
    background: none;
    padding: 0;
    font-size: 13px;
    line-height: 1.6;
}

.help-content a {
    color: var(--color-accent);
}

.help-content a:hover {
    text-decoration: underline;
}

.help-table-wrap {
    overflow-x: auto;
    margin: 0 0 16px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.help-table th,
.help-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
}

.help-table th {
    font-weight: 600;
    color: var(--color-text-primary);
    background: var(--color-bg-alt);
    font-size: 13px;
}

.help-table td {
    color: var(--color-text-secondary);
}

.help-table tr:last-child td {
    border-bottom: none;
}

/* Help Index (card grid) */
.help-index {
    width: 100%;
}

.help-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: var(--gap);
}

.help-search-bar svg {
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

.help-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--color-text-primary);
    outline: none;
}

.help-search-input::placeholder {
    color: var(--color-text-tertiary);
}

.help-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.help-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.help-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.help-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 8px;
}

.help-card__excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-tertiary);
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.help-card__arrow {
    font-size: 16px;
    color: var(--color-accent);
    margin-top: 12px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.help-card:hover .help-card__arrow {
    opacity: 1;
    transform: translateX(0);
}

.help-no-results {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 14px;
    padding: 24px 0;
}

/* Help Sidebar search */
.help-sidebar-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.help-sidebar-search svg {
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

.help-sidebar-search__input {
    flex: 1;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--color-text-primary);
    outline: none;
    padding: 0;
}

.help-sidebar-search__input::placeholder {
    color: var(--color-text-tertiary);
}

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

    .help-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        position: static;
    }

    .help-sidebar-search {
        width: 100%;
    }

    .help-content {
        padding: 20px;
    }

    .help-card-grid {
        grid-template-columns: 1fr;
    }
}
