/* ══════════════════════════════════════════════════════════════
   OutfitMD Dashboard v2 — Stylesheet
   ══════════════════════════════════════════════════════════════ */

:root {
    /* OutfitMD brand */
    --primary: #1a3c6e;
    --primary-light: #2563eb;
    --primary-surface: #e8f0fe;
    --accent: #0ea5e9;

    /* Status */
    --ok: #059669;
    --ok-bg: #ecfdf5;
    --warn: #d97706;
    --warn-bg: #fffbeb;
    --error: #dc2626;
    --error-bg: #fef2f2;

    /* Neutrals */
    --bg: #f0f4f8;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

/* ════ DARK MODE ════ */
[data-theme="dark"] {
    --primary: #93b4e8;
    --primary-light: #60a5fa;
    --primary-surface: #1e3a5f;
    --accent: #38bdf8;

    --ok: #34d399;
    --ok-bg: #064e3b;
    --warn: #fbbf24;
    --warn-bg: #451a03;
    --error: #f87171;
    --error-bg: #450a0a;

    --bg: #0f172a;
    --card: #1e293b;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .login-screen {
    background: linear-gradient(135deg, #020617 0%, #0f172a 40%, #1e3a5f 100%);
}

[data-theme="dark"] .changelog-entry:hover {
    background: #334155;
}

[data-theme="dark"] .changelog-detail-list li {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #0f172a;
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--border);
    color: var(--text-muted);
}

[data-theme="dark"] .modal-overlay .modal {
    background: var(--card);
}

[data-theme="dark"] .kanban-card {
    background: #0f172a;
    border-color: var(--border);
}

[data-theme="dark"] .kanban-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .badge,
[data-theme="dark"] .status-badge {
    border-color: var(--border);
}

[data-theme="dark"] .profile-menu {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="dark"] .profile-menu button:hover {
    background: #334155;
}

[data-theme="dark"] .tracker-row:hover {
    background: #334155 !important;
}

[data-theme="dark"] .accordion-body {
    background: var(--card);
}

/* ═══ Dark Mode Toggle ═══ */
.dark-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dark-toggle-input {
    display: none;
}

.dark-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    background: none;
    font-size: 1.15rem;
    line-height: 1;
}

.dark-toggle-label:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-surface);
}

.dark-toggle-label .icon-sun {
    display: none;
}

.dark-toggle-label .icon-moon {
    display: inline;
}

[data-theme="dark"] .dark-toggle-label .icon-sun {
    display: inline;
}

[data-theme="dark"] .dark-toggle-label .icon-moon {
    display: none;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ════ ANIMATION ════ */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-6px)
    }

    50% {
        transform: translateX(6px)
    }

    75% {
        transform: translateX(-4px)
    }
}

.shake {
    animation: shake 0.4s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ════ LOGIN ════ */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1b33 0%, #1a3c6e 40%, #2563eb 100%);
}

.login-card {
    background: var(--card);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.5s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-img {
    width: 192px;
    height: auto;
    object-fit: contain;
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text);
}

.login-field input,
.login-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border var(--transition);
    background: var(--bg);
}

.login-field input:focus,
.login-field select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-error {
    background: var(--error-bg);
    color: var(--error);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.login-btn {
    width: 100%;
    margin-top: 8px;
}

/* ════ HEADER ════ */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo-img {
    width: 48px;
    height: auto;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.logo h1 span {
    font-weight: 400;
    color: var(--text-muted);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-dropdown {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1.5px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.profile-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.profile-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
    z-index: 100;
}

.profile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition);
}

.profile-menu button:hover {
    background: var(--bg);
}

.profile-menu button:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.profile-menu button:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ════ CHANGELOG BELL ════ */
@keyframes ring {
    0% {
        transform: rotate(0);
    }

    5% {
        transform: rotate(14deg);
    }

    10% {
        transform: rotate(-13deg);
    }

    15% {
        transform: rotate(12deg);
    }

    20% {
        transform: rotate(-10deg);
    }

    25% {
        transform: rotate(8deg);
    }

    30% {
        transform: rotate(-5deg);
    }

    35% {
        transform: rotate(2deg);
    }

    40% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(0);
    }
}

.changelog-wrapper {
    position: relative;
}

.changelog-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
}

.changelog-bell:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-surface);
}

.changelog-bell.has-unread .bell-icon {
    animation: ring 2.5s ease infinite;
    transform-origin: 50% 4px;
    color: var(--primary);
}

.changelog-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
}

.changelog-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 560px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.changelog-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.changelog-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.changelog-mark-read {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--primary-light);
    cursor: pointer;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition);
}

.changelog-mark-read:hover {
    background: var(--primary-surface);
}

.changelog-body {
    overflow-y: auto;
    padding: 8px 12px 12px;
    flex: 1;
}

.changelog-entry {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: background var(--transition);
    border-left: 3px solid transparent;
}

.changelog-entry.unread {
    background: var(--primary-surface);
    border-left-color: var(--primary-light);
}

.changelog-entry:not(.unread) {
    background: var(--bg);
}

.changelog-entry:hover {
    background: #e2e8f0;
}

.changelog-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.changelog-date {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.changelog-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.changelog-tag-new {
    background: var(--ok-bg);
    color: var(--ok);
}

.changelog-tag-fix {
    background: var(--error-bg);
    color: var(--error);
}

.changelog-tag-improvement {
    background: var(--primary-surface);
    color: var(--primary-light);
}

.changelog-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}

.changelog-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.changelog-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
    font-style: italic;
}

/* ── Read More link ── */
.changelog-read-more {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

.changelog-read-more:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ── Detail Panel ── */
.changelog-detail {
    display: none;
    padding: 0 16px 16px;
    overflow-y: auto;
    flex: 1;
    animation: fadeIn 0.2s ease;
}

.changelog-detail-back {
    padding: 12px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.changelog-detail-back a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

.changelog-detail-back a:hover {
    color: var(--primary);
}

.changelog-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.changelog-detail-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
    line-height: 1.3;
}

.changelog-detail-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 12px;
}

.changelog-detail-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.changelog-detail-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.changelog-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-detail-list li {
    position: relative;
    padding: 8px 0 8px 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.changelog-detail-list li:last-child {
    border-bottom: none;
}

.changelog-detail-list li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-light);
}

@media (max-width: 480px) {
    .changelog-dropdown {
        width: calc(100vw - 32px);
        right: -60px;
    }
}

.btn-logout {
    background: none;
    border: 1.5px solid var(--border);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ════ TABS ════ */
.tab-nav {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    padding: 0 24px;
    border-bottom: 2px solid var(--border);
    background: var(--card);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ════ CONTAINER ════ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ════ CARDS ════ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ════ ACCOUNT CARDS ════ */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.account-icon {
    font-size: 1.5rem;
}

.account-info {
    flex: 1;
}

.account-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.account-info code {
    font-size: 0.75rem;
    color: var(--text-light);
    font-family: 'JetBrains Mono', monospace;
}

.account-status {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 4px 12px;
    border-radius: 6px;
    min-width: 48px;
    text-align: center;
}

.sync-ok {
    color: var(--ok);
    background: var(--ok-bg);
}

.sync-warn {
    color: var(--warn);
    background: var(--warn-bg);
}

.sync-bad {
    color: var(--error);
    background: var(--error-bg);
}

.loading-placeholder,
.empty {
    color: var(--text-muted);
    font-style: italic;
}

/* ════ BUTTONS ════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

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

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

.btn-apply:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-preview {
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-preview:hover:not(:disabled) {
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-cancel {
    background: var(--bg);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

.btn-confirm {
    background: var(--error);
    color: white;
}

.btn-confirm:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-lg {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.compare-actions {
    margin-bottom: 20px;
}

/* ════ LOGS ════ */
.log-card {
    background: #0f172a;
    border-color: #1e293b;
}

.log-card h2 {
    color: #e2e8f0;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.log-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.status-done .spinner {
    display: none !important;
}

.status-done span {
    color: var(--ok);
}

.status-error span {
    color: var(--error);
}

.log-viewer {
    max-height: 320px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    padding: 12px;
    background: #020617;
    border-radius: var(--radius-sm);
}

.log-line {
    padding: 2px 0;
    color: #cbd5e1;
}

.log-time {
    color: #475569;
    margin-right: 8px;
}

.log-info {
    color: #38bdf8;
}

.log-warning {
    color: #fbbf24;
}

.log-error {
    color: #f87171;
}

.log-success {
    color: #34d399;
}

.log-change {
    color: #a78bfa;
}

.log-create {
    color: #2dd4bf;
}

/* ════ COMPARISON MATRIX ════ */
.compare-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.compare-results-header h2 {
    margin: 0;
}

.compare-filter {
    display: flex;
    gap: 8px;
}

.compare-filter input,
.compare-filter select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg);
}

.compare-filter input:focus,
.compare-filter select:focus {
    outline: none;
    border-color: var(--primary-light);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.report-card {
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
}

.report-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.report-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.report-success .report-value {
    color: var(--ok);
}

.report-warning .report-value {
    color: var(--warn);
}

.report-error .report-value {
    color: var(--error);
}

.report-neutral .report-value {
    color: var(--primary);
}

.matrix-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.matrix-table th {
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.78rem;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.matrix-table td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.matrix-table tr:hover td {
    background: var(--primary-surface);
}

.sticky-col {
    position: sticky;
    left: 0;
    background: var(--card);
    z-index: 1;
    min-width: 200px;
    font-weight: 500;
}

.matrix-table th.sticky-col {
    z-index: 3;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

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

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

.badge-missing {
    background: var(--error-bg);
    color: var(--error);
}

.badge-error {
    background: #fef2f2;
    color: #991b1b;
}

.badge-active {
    background: var(--ok-bg);
    color: var(--ok);
}

.badge-archived {
    background: #fef3c7;
    color: #92400e;
}

.badge-dryrun {
    background: var(--primary-surface);
    color: var(--primary);
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-pending {
    background: #f3f4f6;
    color: #6b7280;
}

/* ════ ADMIN FILTER BAR ════ */
.admin-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-filter-bar .admin-search {
    flex: 1;
    min-width: 180px;
}

.admin-filter-select {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg);
    cursor: pointer;
    transition: border var(--transition);
}

.admin-filter-select:focus {
    outline: none;
    border-color: var(--primary-light);
}

/* ════ SORTABLE TABLE HEADERS ════ */
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.sortable-th:hover {
    background: rgba(37, 99, 235, 0.15);
}

.sort-icon {
    font-size: 0.72rem;
    margin-left: 4px;
    color: var(--primary-light);
}

/* ════ MINI SPINNER ════ */
.mini-spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1.5px solid #d1d5db;
    border-top-color: #6b7280;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}


.btn-discover {
    background: var(--primary-surface);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-weight: 500;
}

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

.scope-instructions {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.85rem;
}

.scope-instructions ul {
    margin: 6px 0 8px 20px;
    padding: 0;
}

.scope-instructions li {
    margin: 3px 0;
}

.scope-instructions code {
    background: var(--primary-surface);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.scope-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.badge-applied {
    background: var(--ok-bg);
    color: var(--ok);
}

/* Archived / Inactive rows */
.archived-row {
    opacity: 0.6;
}

.archived-row td {
    background: #f9fafb;
}

/* Button icon variants */
.btn-icon-warning:hover {
    background: var(--warn-bg);
}

.btn-icon-success:hover {
    background: var(--ok-bg);
}

/* Inline archive button in onboarding tracker */
.btn-archive-inline {
    font-size: 0.85rem !important;
    padding: 2px 5px !important;
    opacity: 0.4;
    vertical-align: middle;
    margin-left: 4px;
    transition: opacity 0.2s, background 0.2s;
}

.btn-archive-inline:hover {
    opacity: 1;
    background: var(--warn-bg);
}

.onboard-row:hover .btn-archive-inline {
    opacity: 0.7;
}

/* Inline tasks navigation button in onboarding tracker */
.btn-icon-tasks {
    background: none;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 2px;
    opacity: 0.35;
    color: var(--primary);
    transition: opacity 0.2s, background 0.2s;
    line-height: 1;
}

.btn-icon-tasks:hover {
    opacity: 1;
    background: var(--primary-surface);
}

.onboard-row:hover .btn-icon-tasks {
    opacity: 0.65;
}

/* Admin header actions */
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Log detail meta */
.log-detail-meta {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.cell-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ════ SYNC — CHECKBOX LIST ════ */

.sync-controls {
    margin-bottom: 20px;
}

.sync-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sync-search-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg);
}

.sync-search-bar input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.select-all-label {
    white-space: nowrap;
    padding: 8px 14px;
    background: var(--primary-surface);
    border-radius: var(--radius-sm);
}

.clinic-checklist {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.clinic-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.clinic-check:last-child {
    border-bottom: none;
}

.clinic-check:hover {
    background: var(--primary-surface);
}

.clinic-check-name {
    flex: 1;
    font-weight: 500;
}

.clinic-check-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-light);
}

.sync-selected-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 12px;
}

/* ════ SYNC REPORT ════ */
.sync-clinic-report {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.sync-clinic-report:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sync-clinic-report h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: 16px;
}

.alert-info {
    background: var(--primary-surface);
    color: var(--primary);
}

.alert-success {
    background: var(--ok-bg);
    color: var(--ok);
}

.alert-warning {
    background: var(--warn-bg);
    color: var(--warn);
}

/* ════ CRON SETTINGS ════ */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background var(--transition);
}

.toggle-slider::after {
    content: '';
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary);
}

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

.toggle-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.cron-settings-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cron-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cron-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cron-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cron-input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text);
    min-width: 160px;
}

.cron-input:focus {
    outline: none;
    border-color: var(--primary);
}

.cron-days {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.day-pill {
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.day-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.day-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.cron-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 8px 0;
    flex-wrap: wrap;
}

.cron-actions {
    display: flex;
    gap: 8px;
}

/* ════ ADMIN PANEL ════ */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.admin-header h2 {
    margin: 0;
}

.admin-search {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 16px;
    background: var(--bg);
}

.admin-search:focus {
    outline: none;
    border-color: var(--primary-light);
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.admin-table tr:hover td {
    background: var(--primary-surface);
}

.admin-table code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-light);
}

.action-cell {
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1rem;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background var(--transition);
}

.btn-icon:hover {
    background: var(--bg);
}

.btn-icon-danger:hover {
    background: var(--error-bg);
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-admin {
    background: #ede9fe;
    color: #7c3aed;
}

.role-manager {
    background: #e0f2fe;
    color: #0284c7;
}

.role-viewer {
    background: #f1f5f9;
    color: var(--text-muted);
}

.empty-text {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 24px;
}

/* ════ MODALS ════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-container {
    background: var(--card);
    border-radius: var(--radius);
    width: 95%;
    max-width: 480px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.2s ease;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--primary);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
    background: var(--card);
    color: var(--text);
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.2s ease;
}

.modal h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.modal p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ── HTML Editor (Description) ── */
.html-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.html-editor-toolbar button {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    color: var(--text);
    transition: background 0.15s;
    line-height: 1.2;
}

.html-editor-toolbar button:hover {
    background: var(--primary-surface);
    border-color: var(--primary);
}

.toolbar-sep {
    width: 1px;
    background: var(--border);
    margin: 2px 4px;
    align-self: stretch;
}

.html-editor-area {
    min-height: 160px;
    max-height: 350px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 0 0 8px 8px;
    background: var(--card);
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.6;
    outline: none;
    color: var(--text);
}

.html-editor-area:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.html-editor-area:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.html-editor-area h3 {
    font-size: 1rem;
    margin: 8px 0 4px;
}

.html-editor-area p {
    margin: 4px 0;
}

.html-editor-area ul,
.html-editor-area ol {
    margin: 4px 0;
    padding-left: 20px;
}

.html-editor-area a {
    color: var(--primary);
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ── Task / Idea Modal (wider layout, no padding on wrapper) ── */
.idea-modal {
    padding: 0;
    max-width: 560px;
    width: 95%;
    overflow: hidden;
    border-radius: var(--radius);
}

.idea-modal .modal-header {
    border-radius: var(--radius) var(--radius) 0 0;
}

.idea-modal .modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.05rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

.modal-footer .btn-apply {
    margin-left: auto;
}

/* ── Form controls inside modals ── */
.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.form-input {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-error {
    color: var(--danger, #dc2626);
    font-size: 0.82rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--error-bg, #fef2f2);
    border-radius: 6px;
}

.btn-secondary {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

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

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg);
    appearance: auto;
}

/* ════ FOOTER ════ */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-light);
    font-size: 0.8rem;
}

.footer-credit {
    margin-top: 6px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ════ RESPONSIVE ════ */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }

    .header-content {
        padding: 10px 16px;
    }

    .tab-nav {
        padding: 0 16px;
    }

    .tab-btn {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

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

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

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

    .btn {
        width: 100%;
        justify-content: center;
    }

    .compare-results-header {
        flex-direction: column;
    }

    .compare-filter {
        width: 100%;
        flex-direction: column;
    }

    .sync-search-bar {
        flex-direction: column;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .products-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .products-toolbar-right {
        flex-direction: column;
        width: 100%;
    }

    .products-toolbar-right input,
    .products-toolbar-right select {
        width: 100%;
    }

    .save-bar-content {
        flex-direction: column;
        gap: 8px;
    }
}

/* ════ PRODUCTS TAB ════ */
.products-summary {
    margin-bottom: 20px;
}

.products-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.products-toolbar h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.products-cache-info {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.products-toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.products-toolbar-right input,
.products-toolbar-right select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg);
}

.products-toolbar-right input:focus,
.products-toolbar-right select:focus {
    outline: none;
    border-color: var(--primary-light);
}

/* Compact product table rows */
#products-table-section table tbody tr td {
    padding: 5px 10px;
    font-size: 0.82rem;
}

#products-table-section table tbody tr:nth-child(even) {
    background: var(--bg);
}

#products-table-section table tbody tr:nth-child(even) td.sticky-col {
    background: var(--bg);
}

#products-table-section table tbody tr:hover {
    background: var(--primary-surface);
}

#products-table-section table tbody tr:hover td.sticky-col {
    background: var(--primary-surface);
}

.product-cell-value {
    display: inline-block;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Editable cells */
.product-cell-editable {
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
}

.product-cell-editable:hover {
    background: var(--primary-surface) !important;
}

.product-cell-edit-icon {
    opacity: 0;
    margin-left: 6px;
    font-size: 0.75rem;
    transition: opacity var(--transition);
}

.product-cell-editable:hover .product-cell-edit-icon {
    opacity: 0.6;
}

/* Inline input */
.product-inline-input {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid var(--primary-light);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Changed row highlight */
.product-row-changed {
    background: #fffbeb !important;
    border-left: 3px solid var(--warn);
}

.product-row-changed td {
    background: transparent !important;
}

.product-row-changed td.sticky-col {
    background: #fffbeb !important;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--ok);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(18px);
}

/* Status badges */
.status-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-hidden {
    background: #f1f5f9;
    color: #64748b;
}

/* SKU column — compact, monospace */
.col-sku {
    white-space: nowrap;
    width: 1%;
}

.col-sku code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 5px;
    border-radius: 4px;
}

.product-sku-inline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.02em;
}

.btn-generate-sku {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: inherit;
    padding: 1px 8px;
    border-radius: 4px;
    border: 1px dashed #a5b4fc;
    background: #eef2ff;
    color: #4f46e5;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    vertical-align: middle;
}

.btn-generate-sku:hover {
    background: #c7d2fe;
    border-style: solid;
    color: #3730a3;
}

.btn-generate-sku:disabled {
    opacity: 0.6;
    cursor: wait;
}

.badge-onetime {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
    display: inline-block;
}

.badge-recurring {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    white-space: nowrap;
    display: inline-block;
}

/* Quantity column — compact */
.col-qty {
    white-space: nowrap;
    width: 1%;
    text-align: center;
}

/* Inventory badges */
.badge-instock {
    background: #dcfce7;
    color: #166534;
}

.badge-outofstock {
    background: #fee2e2;
    color: #991b1b;
}

/* Save bar */
.products-save-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 2px solid var(--warn);
    padding: 14px 24px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 50;
    animation: fadeIn 0.2s ease;
}

.save-bar-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.save-bar-content span {
    font-weight: 600;
    color: var(--warn);
}

.save-bar-actions {
    display: flex;
    gap: 8px;
}

/* Row number column — tiny, muted */
.col-num {
    white-space: nowrap;
    width: 1%;
    text-align: center;
    color: var(--text-light);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Link columns — compact, centered */
.col-link {
    white-space: nowrap;
    width: 1%;
    text-align: center;
}

.product-link {
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
    transition: all var(--transition);
    white-space: nowrap;
}

.product-link:hover {
    text-decoration: underline;
    color: var(--primary-dark, #1d4ed8);
}

/* ═══ Change History Modal ═══ */
.history-modal {
    max-width: 960px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.history-filter-btn {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.history-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.history-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 55%;
}

.history-modal-body {
    overflow-y: auto;
    max-height: 60vh;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.history-table {
    width: 100%;
    font-size: 0.78rem;
    table-layout: fixed;
}

.history-table thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 6px 8px;
    white-space: nowrap;
}

.history-table td {
    padding: 5px 8px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column widths via col classes */
.history-table .col-date {
    width: 100px;
}

.history-table .col-user {
    width: 130px;
}

.history-table .col-clinic {
    width: 90px;
}

.history-table .col-product {
    width: 160px;
}

.history-table .col-field {
    width: 80px;
}

.history-table .col-old {
    width: 80px;
}

.history-table .col-new {
    width: 80px;
}

.history-date {
    white-space: nowrap;
}

.history-date-main {
    font-weight: 500;
    font-size: 0.76rem;
}

.history-date-time {
    font-size: 0.68rem;
    color: var(--text-light);
    margin-left: 2px;
}

.history-product {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-field-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    background: #ede9fe;
    color: #7c3aed;
    letter-spacing: 0.2px;
}

.history-old {
    color: #dc2626;
    font-size: 0.76rem;
}

.history-new {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.76rem;
}

/* Create Product Modal Form */
.create-product-form {
    margin: 16px 0 0;
}

.create-product-form .form-group {
    margin-bottom: 14px;
}

.create-product-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.create-product-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg);
    transition: border var(--transition);
    box-sizing: border-box;
}

.create-product-form input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.create-product-info {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 4px;
}

.create-product-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 4px 0;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   ONBOARDING TRACKER
   ══════════════════════════════════════════════════════════════ */

/* Source of Truth Hero Card */
.sot-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 50%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    animation: fadeIn 0.4s ease;
}

.sot-icon {
    font-size: 2rem;
    line-height: 1;
}

.sot-info {
    flex: 1;
}

.sot-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.sot-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #f59e0b;
    color: white;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sot-location code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #92400e;
    background: rgba(245, 158, 11, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Pipeline Summary */
.onboard-pipeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pipeline-card {
    text-align: center;
    padding: 16px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.pipeline-card-active {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    outline: 3px solid currentColor;
    outline-offset: -1px;
}

.onboard-pipeline:has(.pipeline-card-active) .pipeline-card:not(.pipeline-card-active) {
    opacity: 0.45;
    transform: scale(0.97);
}

.pipeline-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.pipeline-label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pipeline-not-started {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.pipeline-not-started .pipeline-value {
    color: #64748b;
}

.pipeline-not-started .pipeline-label {
    color: #94a3b8;
}

.pipeline-pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.pipeline-pending .pipeline-value {
    color: #d97706;
}

.pipeline-pending .pipeline-label {
    color: #b45309;
}

.pipeline-in-progress {
    background: #eff6ff;
    border-color: #93c5fd;
}

.pipeline-in-progress .pipeline-value {
    color: #2563eb;
}

.pipeline-in-progress .pipeline-label {
    color: #1d4ed8;
}

.pipeline-launched {
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.pipeline-launched .pipeline-value {
    color: #059669;
}

.pipeline-launched .pipeline-label {
    color: #047857;
}

.pipeline-delayed {
    background: #fef2f2;
    border-color: #fca5a5;
}

.pipeline-delayed .pipeline-value {
    color: #dc2626;
}

.pipeline-delayed .pipeline-label {
    color: #991b1b;
}

/* ═══ Client Cards — Compact Accordion ═══ */
.client-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    border-left: 4px solid #cbd5e1;
    transition: box-shadow var(--transition);
    overflow: hidden;
}

.client-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

/* ── Compact Header Row — Column Layout ── */
.client-card-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
}

/* Fixed-width columns */
.card-col {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.card-col-name {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    overflow: hidden;
}

.card-col-name strong {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.card-col-name .loc-id {
    font-size: 0.62rem;
    color: var(--text-light);
}

.card-col-badges {
    width: 130px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    justify-items: center;
}

.card-col-badges .status-badge {
    font-size: 0.66rem;
    padding: 1px 5px;
}

.badge-labeled {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: 100%;
}

.badge-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-light);
    line-height: 1;
    white-space: nowrap;
}

.card-col-actions {
    gap: 4px;
    justify-content: flex-end;
}

.card-col-status {
    width: 130px;
    justify-content: flex-end;
}

.card-col-toggle {
    width: 28px;
    justify-content: center;
}

/* ── Status Pill — Color-coded ── */
.card-compact-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.card-compact-status-delayed {
    background: #fee2e2;
    color: #991b1b;
}

.card-compact-status-pending_setup {
    background: #fef3c7;
    color: #92400e;
}

.card-compact-status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.card-compact-status-launched {
    background: #d1fae5;
    color: #065f46;
}

.card-compact-status-not_started {
    background: #f1f5f9;
    color: #64748b;
}

/* Chevron toggle button */
.btn-card-toggle {
    background: none;
    border: none;
    padding: 3px;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.btn-card-toggle:hover {
    background: var(--primary-surface);
    color: var(--primary);
}

.chevron-icon {
    transition: transform 0.25s ease;
}

.client-card.open .chevron-icon {
    transform: rotate(180deg);
}

/* ── Collapsible Details Panel ── */
.client-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 14px;
    border-top: 0px solid transparent;
}

.client-card.open .client-card-details {
    max-height: 300px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
}

.card-details-row {
    margin-bottom: 10px;
}

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

.card-details-overall .wf-select-overall {
    min-width: 140px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Status Grid — 2×3 (inside details) */
.client-card-statuses {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 16px;
}

.card-status-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.card-status-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-light);
}

.card-status-item .wf-select {
    width: 100%;
    font-size: 0.75rem;
}

/* ── Action Buttons — Blue Theme ── */
.btn-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.3;
    white-space: nowrap;
}

.btn-card-action:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.btn-card-action-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 600;
}

.btn-card-action-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.btn-card-action-primary svg {
    flex-shrink: 0;
}

.btn-card-action-warn {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
    opacity: 0.4;
}

.btn-card-action-warn:hover {
    opacity: 1;
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.card-action-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #2563eb;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 3px;
}

.btn-card-action .card-action-count {
    background: #3b82f6;
    color: #fff;
}

.btn-card-action-primary .card-action-count {
    background: #ef4444;
    color: #fff;
}

/* ── Card Status Background Colors ── */
.client-card-delayed {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.client-card-pending_setup {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.client-card-in_progress {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.client-card-launched {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.client-card-not_started {
    border-left-color: #cbd5e1;
    background: var(--card);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .client-card-compact {
        flex-wrap: wrap;
        gap: 6px;
    }

    .card-col-name {
        flex: 1 1 100%;
    }

    .card-col-badges {
        width: auto;
    }

    .card-col-actions {
        width: auto;
        flex-wrap: wrap;
    }

    .card-col-status {
        width: auto;
    }

    .client-card-statuses {
        grid-template-columns: repeat(2, 1fr);
    }
}

.onboard-scroll-wrap::-webkit-scrollbar {
    height: 14px;
}

.onboard-scroll-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
}

.onboard-scroll-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #818cf8, #6366f1);
    border-radius: 7px;
    border: 2px solid #e2e8f0;
    min-width: 80px;
}

.onboard-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
}

.loc-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-light);
    opacity: 0.7;
    letter-spacing: -0.02em;
}

.btn-token-edit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: background var(--transition);
}

.btn-token-edit:hover {
    background: var(--primary-surface);
}

.onboard-table {
    width: 100%;
    table-layout: auto;
}

.onboard-table th {
    font-size: 0.72rem;
    padding: 8px 6px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.onboard-table td {
    vertical-align: middle;
    padding: 10px 6px;
    white-space: nowrap;
}

/* Clinic name column — allow wrapping only here */
.onboard-table td:first-child {
    white-space: normal;
    min-width: 140px;
    max-width: 180px;
}

.onboard-table code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-light);
}

.onboard-row-launched {
    background: #f0fdf4;
}

.onboard-row-in_progress {
    background: #eff6ff;
}

.onboard-row-pending_setup {
    background: #fffbeb;
}

.onboard-row-not_started {
    background: var(--card);
}

.onboard-row-delayed {
    background: #fef2f2;
}

/* Onboarding Status Select */
.onboard-status-select {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1.5px solid var(--border);
    transition: all var(--transition);
    background: var(--card);
    min-width: 130px;
}

.onboard-status-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.onboard-status-select.badge-not-started {
    border-color: #cbd5e1;
    color: #64748b;
}

.onboard-status-select.badge-pending-setup {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.onboard-status-select.badge-in-progress {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}

.onboard-status-select.badge-launched,
.wf-select.badge-launched {
    border-color: #6ee7b7;
    background: #ecfdf5;
    color: #065f46;
}

.onboard-status-select.badge-delayed,
.wf-select.badge-delayed {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

.wf-select.badge-not-started {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #64748b;
}

.wf-select.badge-pending-setup {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

.wf-select.badge-in-progress {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}

/* Onboarding Status Badges (read-only) */
.badge-not-started {
    background: #f1f5f9;
    color: #64748b;
}

.badge-pending-setup {
    background: #fef3c7;
    color: #92400e;
}

.badge-in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.badge-launched {
    background: #d1fae5;
    color: #065f46;
}

.badge-delayed {
    background: #fee2e2;
    color: #991b1b;
}

/* Notes Input */
.onboard-notes-input {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: border var(--transition);
}

.onboard-notes-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.onboard-notes-input::placeholder {
    color: var(--text-light);
}

.onboard-notes-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ═══ Workflow Status Selects ═══ */
.wf-select {
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1.5px solid var(--border);
    transition: all var(--transition);
    background: var(--card);
    min-width: 100px;
    appearance: auto;
}

.wf-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wf-badge-gray {
    border-color: #cbd5e1;
    color: #64748b;
    background: #f8fafc;
}

.wf-badge-red {
    border-color: #fca5a5;
    color: #991b1b;
    background: #fef2f2;
}

.wf-badge-yellow {
    border-color: #fde68a;
    color: #92400e;
    background: #fffbeb;
}

.wf-badge-green {
    border-color: #6ee7b7;
    color: #065f46;
    background: #ecfdf5;
}

.wf-badge-blue {
    border-color: #93c5fd;
    color: #1e40af;
    background: #eff6ff;
}

/* Centered column */
.col-center {
    text-align: center;
}

/* Token status badges */
.badge-warning {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
}

.badge-error {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
}

/* Mini spinner for loading tokens */
.mini-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #e2e8f0;
    border-top-color: #94a3b8;
    border-radius: 50%;
    animation: mini-spin 0.8s linear infinite;
}

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

/* ═══ Notes Button ═══ */
.btn-notes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--card);
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-notes:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-surface);
}

.btn-notes.has-notes {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}

.btn-notes.has-notes:hover {
    background: #dbeafe;
}

/* ═══ Notes Modal ═══ */
.notes-modal {
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.notes-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.notes-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition);
}

.btn-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.notes-modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: 50vh;
    min-height: 80px;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-card {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: border var(--transition);
}

.note-card:hover {
    border-color: #93c5fd;
}

.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.note-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}

.note-date {
    font-size: 0.72rem;
    color: var(--text-light);
}

.note-content {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.notes-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.notes-modal-footer {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
}

.notes-textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    resize: vertical;
    min-height: 40px;
    transition: border var(--transition);
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.notes-textarea::placeholder {
    color: var(--text-light);
}

/* Responsive: pipeline + onboarding table on small screens */
@media (max-width: 900px) {
    .onboard-table td:first-child {
        min-width: 120px;
        max-width: 150px;
    }

    .wf-select {
        min-width: 88px;
        font-size: 0.7rem;
        padding: 3px 4px;
    }

    .onboard-status-select {
        min-width: 110px;
        font-size: 0.74rem;
    }
}

@media (max-width: 640px) {
    .onboard-pipeline {
        grid-template-columns: repeat(2, 1fr);
    }

    .sot-hero {
        flex-direction: column;
        text-align: center;
    }

    .sot-location {
        margin-top: 8px;
    }

    .wf-select {
        min-width: 80px;
        font-size: 0.68rem;
    }
}

/* ══════════════════════════════════════════════════════════════
   ROADMAP BOARD
/* ══════════════════════════════════════════════════════════════
   TASKS — Kanban Board Styles
   ══════════════════════════════════════════════════════════════ */

.tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.tasks-toolbar h2 {
    margin: 0;
    font-size: 1.1rem;
}

.tasks-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tasks-client-filter {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

/* Deadline custom range inputs */
.deadline-range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.deadline-range-date {
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    border: 1px solid var(--border) !important;
    background: var(--bg);
    color: var(--text);
    width: 140px;
}

.deadline-range-sep {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Kanban column headers for tasks */
.kanban-task-todo {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-bottom: 3px solid #3b82f6;
}

.kanban-task-todo .kanban-icon,
.kanban-task-todo .kanban-title {
    color: #1e40af;
}

.kanban-task-todo .kanban-count {
    background: #3b82f6;
    color: #fff;
}

.kanban-task-progress {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 3px solid #f59e0b;
}

.kanban-task-progress .kanban-icon,
.kanban-task-progress .kanban-title {
    color: #92400e;
}

.kanban-task-progress .kanban-count {
    background: #f59e0b;
    color: #fff;
}

.kanban-task-done {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-bottom: 3px solid #10b981;
}

.kanban-task-done .kanban-icon,
.kanban-task-done .kanban-title {
    color: #065f46;
}

.kanban-task-done .kanban-count {
    background: #10b981;
    color: #fff;
}

.kanban-task-blocked {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-bottom: 3px solid #ef4444;
}

.kanban-task-blocked .kanban-icon,
.kanban-task-blocked .kanban-title {
    color: #991b1b;
}

.kanban-task-blocked .kanban-count {
    background: #ef4444;
    color: #fff;
}

/* Task card elements */
.task-card {
    cursor: pointer;
}

.task-card-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.task-priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.task-priority-high {
    background: #ef4444;
}

.task-priority-medium {
    background: #f59e0b;
}

.task-priority-low {
    background: #10b981;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.task-client-badge {
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.task-assignee-tag {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.task-manager-tag {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

/* Multi-select assignee dropdown */
.multiselect-wrapper {
    position: relative;
}

.multiselect-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    min-height: 38px;
    flex-wrap: wrap;
    gap: 4px;
}

.multiselect-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.multiselect-placeholder {
    color: var(--text-light);
    font-size: 0.85rem;
}

.multiselect-arrow {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-left: 6px;
    flex-shrink: 0;
}

.multiselect-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.multiselect-pill-x {
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    color: #3b82f6;
    font-weight: 700;
    margin-left: 2px;
}

.multiselect-pill-x:hover {
    color: #dc2626;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.1s ease;
    color: var(--text);
}

.multiselect-option:hover {
    background: #f1f5f9;
}

.multiselect-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Deadline urgency badge — base */
.task-due-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    background: #f3f4f6;
    color: #6b7280;
    transition: all 0.2s ease;
}

.task-deadline-countdown {
    font-size: 0.65rem;
    opacity: 0.85;
}

/* Calm — > 7 days (gray default) */
.task-due-date.task-deadline-calm {
    background: #f3f4f6;
    color: #6b7280;
}

/* Approaching — 4-7 days (yellow) */
.task-due-date.task-deadline-approaching {
    background: #fef9c3;
    color: #a16207;
    font-weight: 600;
}

/* Soon — 1-3 days (orange) */
.task-due-date.task-deadline-soon {
    background: #ffedd5;
    color: #c2410c;
    font-weight: 600;
}

/* Today — 0 days (red) */
.task-due-date.task-deadline-today {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

/* Overdue — past due (dark red + pulse) */
.task-due-date.task-deadline-overdue {
    background: #dc2626;
    color: #fff;
    font-weight: 700;
    animation: deadline-pulse 2s ease-in-out infinite;
}

@keyframes deadline-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3);
    }

    50% {
        opacity: 0.88;
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0);
    }
}

/* Deadline badge in task detail modal */
.task-deadline-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.task-deadline-badge.task-deadline-calm {
    background: #f0fdf4;
    color: #166534;
}

.task-deadline-badge.task-deadline-approaching {
    background: #fef9c3;
    color: #a16207;
}

.task-deadline-badge.task-deadline-soon {
    background: #ffedd5;
    color: #c2410c;
}

.task-deadline-badge.task-deadline-today {
    background: #fee2e2;
    color: #dc2626;
}

.task-deadline-badge.task-deadline-overdue {
    background: #dc2626;
    color: #fff;
    animation: deadline-pulse 2s ease-in-out infinite;
}

/* Progress bar in task detail modal */
.task-deadline-bar-wrapper {
    width: 100%;
}

.task-deadline-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.task-deadline-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.task-deadline-bar-calm {
    background: linear-gradient(90deg, #86efac, #4ade80);
}

.task-deadline-bar-approaching {
    background: linear-gradient(90deg, #fde047, #facc15);
}

.task-deadline-bar-soon {
    background: linear-gradient(90deg, #fb923c, #f97316);
}

.task-deadline-bar-today {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

.task-deadline-bar-overdue {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.task-deadline-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Task detail modal */
.task-detail-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 16px 0;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.task-detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-detail-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.task-status-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-task-todo {
    background: #dbeafe !important;
    color: #1e40af !important;
    border-color: #93c5fd !important;
}

.btn-task-todo:hover:not(:disabled) {
    background: #bfdbfe !important;
}

.btn-task-progress {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fcd34d !important;
}

.btn-task-progress:hover:not(:disabled) {
    background: #fde68a !important;
}

.btn-task-done {
    background: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #6ee7b7 !important;
}

.btn-task-done:hover:not(:disabled) {
    background: #a7f3d0 !important;
}

.btn-task-blocked {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
}

.btn-task-blocked:hover:not(:disabled) {
    background: #fecaca !important;
}

.btn-task-todo:disabled,
.btn-task-progress:disabled,
.btn-task-done:disabled,
.btn-task-blocked:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Task Detail Sections (Change Log & Notes) */
.task-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.task-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.task-section-header h4 {
    margin: 0;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-section-toggle {
    font-size: 0.75rem;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

/* Change Log Timeline */
.task-changelog {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.changelog-entry {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg);
    border-radius: 6px;
    border-left: 3px solid #93c5fd;
    font-size: 0.8rem;
    line-height: 1.4;
}

.changelog-entry .cl-field {
    font-weight: 600;
    color: var(--primary);
}

.changelog-entry .cl-arrow {
    color: var(--text-light);
    margin: 0 2px;
}

.changelog-entry .cl-old {
    text-decoration: line-through;
    color: var(--text-light);
}

.changelog-entry .cl-new {
    color: var(--text);
    font-weight: 500;
}

.changelog-entry .cl-meta {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 2px;
}

.changelog-empty {
    text-align: center;
    padding: 12px;
    color: var(--text-light);
    font-size: 0.82rem;
    font-style: italic;
}

/* Task Notes / Discussion UI */
.task-notes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 8px;
}

.task-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.task-avatar-sm {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.4px;
}

.task-assignee-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.task-note-bubble {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: background 0.15s ease;
}

.task-note-bubble:hover {
    background: #f1f5f9;
}

.task-note-body {
    flex: 1;
    min-width: 0;
}

.task-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.task-note-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}

.task-note-date {
    font-size: 0.7rem;
    color: var(--text-light);
}

.task-note-content {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.task-notes-empty {
    text-align: center;
    padding: 16px;
    color: var(--text-light);
    font-size: 0.82rem;
    font-style: italic;
    margin-top: 8px;
}

/* Note Composer (like Slack input) */
.task-note-composer {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 10px;
    margin-bottom: 4px;
}

.task-note-composer-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-note-composer textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.82rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    resize: vertical;
    min-height: 42px;
    max-height: 120px;
    transition: border var(--transition), box-shadow 0.15s ease;
}

.task-note-composer textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.task-note-send-btn {
    align-self: flex-end;
}

/* Discussion section */
.task-discussion {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px !important;
    margin-top: 16px;
    border: 1px solid var(--border);
    border-top: none;
}

.task-discussion .task-section-header {
    cursor: default;
}

/* Loom Video Embed */
.task-loom-embed {
    margin: 12px 0 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}

.task-loom-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.task-loom-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.task-loom-link {
    display: block;
    text-align: center;
    padding: 8px;
    font-size: 0.78rem;
    color: var(--primary);
    text-decoration: none;
    background: #fff;
    border-top: 1px solid var(--border);
    transition: background 0.15s ease;
}

.task-loom-link:hover {
    background: #eef2ff;
}

.task-loom-link-only {
    margin: 8px 0 12px;
}

.task-loom-link-only .task-loom-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    font-size: 0.82rem;
}

/* ── Idea / Task Detail Modal Layout ── */
.modal.idea-modal {
    max-width: 640px;
    width: 92%;
    max-height: 80vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
}

.modal.idea-modal .modal-header {
    flex-shrink: 0;
    padding: 16px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal.idea-modal .modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: white;
}

.modal.idea-modal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 0;
}

.modal.idea-modal .modal-footer {
    flex-shrink: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Task Detail Modal Footer Enhanced */
.task-detail-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   ROADMAP
   ══════════════════════════════════════════════════════════════ */

/* Toolbar */
.roadmap-toolbar {

    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.roadmap-toolbar h2 {
    margin: 0;
    font-size: 1.1rem;
}

.roadmap-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roadmap-sub-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--border);
}

.roadmap-sub-tab {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all var(--transition);
}

.roadmap-sub-tab:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.04);
}

.roadmap-sub-tab.active {
    background: var(--card);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Kanban Board Grid */
.roadmap-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 300px;
}

.kanban-column {
    background: var(--bg);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    border-bottom: 2px solid transparent;
}

.kanban-icon {
    font-size: 1.1rem;
}

.kanban-title {
    flex: 1;
}

.kanban-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 6px;
}

/* Column header colors */
.kanban-ideas {
    background: #fffbeb;
    border-bottom-color: #f59e0b;
    color: #92400e;
}

.kanban-ideas .kanban-count {
    background: #fde68a;
    color: #92400e;
}

.kanban-decided {
    background: #eff6ff;
    border-bottom-color: #3b82f6;
    color: #1e40af;
}

.kanban-decided .kanban-count {
    background: #bfdbfe;
    color: #1e40af;
}

.kanban-progress {
    background: #faf5ff;
    border-bottom-color: #8b5cf6;
    color: #6d28d9;
}

.kanban-progress .kanban-count {
    background: #ddd6fe;
    color: #6d28d9;
}

.kanban-complete {
    background: #ecfdf5;
    border-bottom-color: #10b981;
    color: #065f46;
}

.kanban-complete .kanban-count {
    background: #a7f3d0;
    color: #065f46;
}

/* Cards container */
.kanban-cards {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 65vh;
}

/* Individual card */
.kanban-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.kanban-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.kanban-card:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.kanban-card-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.3;
}

.kanban-card-brief {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-light);
}

.kanban-author {
    font-weight: 600;
    color: var(--text-muted);
}

.kanban-card-date {
    opacity: 0.7;
}

.kanban-date {
    display: block;
    margin-top: 8px;
    font-size: 0.72rem;
    color: #8b5cf6;
    font-weight: 600;
}

.kanban-date::before {
    content: '📅 ';
}

.kanban-completed {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #059669;
    font-weight: 600;
}

.kanban-completed::before {
    content: '✅ ';
}

.kanban-readmore {
    margin-top: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kanban-card:hover .kanban-readmore {
    opacity: 1;
}

.kanban-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* Card action buttons (move/discard) */
.kanban-card-actions {
    display: flex;
    gap: 4px;
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kanban-card:hover .kanban-card-actions {
    opacity: 1;
}

.kanban-action-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition);
}

.kanban-action-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-surface);
}

.kanban-action-discard:hover {
    border-color: #fca5a5;
    background: #fef2f2;
}

/* ═══ Idea Detail Modal ═══ */
.idea-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.idea-detail-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.idea-tag-idea {
    background: #fef3c7;
    color: #92400e;
}

.idea-tag-decided {
    background: #dbeafe;
    color: #1e40af;
}

.idea-tag-progress {
    background: #ede9fe;
    color: #6d28d9;
}

.idea-tag-complete {
    background: #d1fae5;
    color: #065f46;
}

.idea-tag-discarded {
    background: #fee2e2;
    color: #991b1b;
}

#idea-detail-title {
    font-size: 1.15rem;
    margin: 8px 0 12px;
}

.idea-detail-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.idea-detail-brief {
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.5;
    margin: 0 0 12px;
}

.idea-detail-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.idea-detail-description {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.7;
}

.idea-discard-reason {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: #fef2f2;
    border: 1px solid #fca5a5;
    font-size: 0.85rem;
    color: #991b1b;
    line-height: 1.5;
}

.idea-detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.idea-detail-actions:empty {
    display: none;
}

/* ═══ Discarded Ideas View ═══ */
.discarded-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.discarded-card {
    padding: 16px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid #ef4444;
}

.discarded-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.discarded-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.discarded-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}

.discarded-card-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.discarded-card-brief {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.45;
}

.discarded-card-reason {
    font-size: 0.8rem;
    color: #991b1b;
    background: #fef2f2;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.discarded-card-author {
    font-size: 0.72rem;
    color: var(--text-light);
    font-style: italic;
}

/* ═══ Responsive Kanban ═══ */
@media (max-width: 1100px) {
    .roadmap-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .roadmap-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .roadmap-toolbar-right {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .roadmap-sub-tabs {
        width: 100%;
    }

    .roadmap-sub-tab {
        flex: 1;
        text-align: center;
    }
}

/* ════ COMING SOON TABS ════ */
.coming-soon-badge {
    display: inline-block;
    padding: 0px 5px;
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fbbf24;
    color: #78350f;
    border-radius: 8px;
    line-height: 1.5;
    margin-left: 3px;
    vertical-align: middle;
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.coming-soon-wrapper {
    position: relative;
    min-height: 500px;
}

.coming-soon-preview {
    filter: blur(3px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.coming-soon-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, rgba(240, 244, 248, 0.6) 100%);
}

.coming-soon-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 48px 56px;
    max-width: 520px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease;
}

.coming-soon-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    line-height: 1;
}

.coming-soon-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.coming-soon-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.coming-soon-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.coming-soon-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-width: 380px;
    margin: 0 auto;
}

.cs-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text);
    padding: 8px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.cs-feature:hover {
    border-color: var(--primary-light);
    background: var(--primary-surface);
}

.cs-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: var(--ok-bg);
    color: var(--ok);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    .coming-soon-content {
        padding: 32px 24px;
        margin: 0 12px;
    }

    .coming-soon-content h2 {
        font-size: 1.3rem;
    }
}