
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
/* =============================================================================
   StratFlow - Application Stylesheet
   Professional blue-based palette with CSS custom properties.
   Covers: layout, typography, components, pricing, sidebar, responsive.
   ============================================================================= */

/* === Custom Properties ====================================================== */

:root {
    --primary: rgb(79, 70, 229);
    --primary-dark: rgb(67 56 202);
    --primary-light: rgb(238 242 255);
    --primary-hover: rgb(99, 102, 241);
    --secondary: rgb(100, 116, 139);
    --success: rgb(5 150 105);
    --danger: rgb(220, 38, 38);
    --warning: rgb(217, 119, 6);
    --info: rgb(8 145 178);
    --success-soft: rgb(220 252 231);
    --danger-soft: rgb(255 228 230);
    --warning-soft: rgb(255 237 213);
    --info-soft: rgb(224 242 254);
    --orange: rgb(234 88 12);
    --risk: rgb(225 29 72);
    --bg: rgb(248 250 252);
    --bg-secondary: rgb(241, 245, 249);
    --surface: rgb(255, 255, 255);
    --surface-2: rgb(249, 250, 252);
    --surface-hover: rgb(241, 245, 249);
    --bg-card: rgb(255, 255, 255);
    --bg-muted: rgb(248, 250, 252);
    --bg-hover: rgb(241, 245, 249);
    --text: rgb(15 23 42);
    --text-secondary: rgb(71, 85, 105);
    --text-light: rgb(100, 116, 139);
    --text-muted: rgb(100, 116, 139);
    --border: rgb(226, 232, 240);
    --border-color: rgb(226, 232, 240);
    --border-light: rgb(241, 245, 249);
    --success-light: rgb(220 252 231);
    --success-dark: rgb(21 128 61);
    --warning-light: rgb(254, 243, 199);
    --warning-dark: rgb(146, 64, 14);
    --danger-light: rgb(254, 226, 226);
    --danger-dark: rgb(185, 28, 28);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 60px;
    --topbar-height: 72px;
    --home-purple-bg: rgb(240 237 255);
    --home-blue-bg: rgb(234 242 255);
    --home-green-bg: rgb(233 248 241);
    --home-green-bg-strong: rgb(230 247 239);
    --home-orange-bg: rgb(255 244 228);
    --home-pro-tip-bg: rgb(238 251 247);
    --home-pro-tip-border: rgb(207 238 227);
    --home-link: rgb(0 103 255);
    --home-success-text: rgb(4 120 87);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary: rgb(129 140 248);
    --primary-dark: rgb(99 102 241);
    --primary-light: rgba(129, 140, 248, 0.16);
    --primary-hover: rgb(165 180 252);
    --secondary: rgb(148 163 184);
    --success: rgb(52 211 153);
    --danger: rgb(248 113 113);
    --warning: rgb(251 191 36);
    --info: rgb(56 189 248);
    --bg: rgb(13 21 36);
    --bg-secondary: rgb(17 24 39);
    --surface: rgb(22 33 51);
    --surface-2: rgb(17 24 39);
    --bg-card: rgb(22 33 51);
    --bg-muted: rgb(17 24 39);
    --surface-hover: rgba(148, 163, 184, 0.12);
    --text: rgb(248 250 252);
    --text-secondary: rgb(203 213 225);
    --text-light: rgb(148 163 184);
    --text-muted: rgb(148 163 184);
    --border: rgb(51 65 85);
    --border-color: rgb(51 65 85);
    --border-light: rgb(31 42 61);
    --bg-hover: rgba(148, 163, 184, 0.12);
    --success-soft: rgba(52, 211, 153, 0.16);
    --success-light: rgba(52, 211, 153, 0.16);
    --success-dark: rgb(167 243 208);
    --danger-soft: rgba(248, 113, 113, 0.16);
    --danger-light: rgba(248, 113, 113, 0.16);
    --danger-dark: rgb(254 202 202);
    --warning-soft: rgba(251, 191, 36, 0.16);
    --warning-light: rgba(251, 191, 36, 0.16);
    --warning-dark: rgb(253 230 138);
    --info-soft: rgba(56, 189, 248, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.32);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.32);
    --shadow-xl: 0 22px 48px rgba(0, 0, 0, 0.38);
    --home-purple-bg: rgba(129, 140, 248, 0.16);
    --home-blue-bg: rgba(37, 99, 235, 0.16);
    --home-green-bg: rgba(5, 150, 105, 0.16);
    --home-green-bg-strong: rgba(5, 150, 105, 0.22);
    --home-orange-bg: rgba(249, 115, 22, 0.18);
    --home-pro-tip-bg: rgba(5, 150, 105, 0.14);
    --home-pro-tip-border: rgba(5, 150, 105, 0.28);
    --home-link: rgb(96 165 250);
    --home-success-text: rgb(110 231 183);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Reset & Base =========================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

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

/* === Typography ============================================================= */

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    line-height: 1.25;
    font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
    color: var(--text);
}

p:last-child {
    margin-bottom: 0;
}

/* === Layout - Container ===================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* === Public Header ========================================================== */

.public-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    padding-block: 0.25rem;
    max-width: none;
    padding-left: clamp(1.5rem, 3vw, 3rem);
    padding-right: clamp(1.5rem, 3vw, 3rem);
}

.public-header .logo {
    align-items: center;
    display: inline-flex;
    font-size: 1.375rem;
    font-weight: 800;
    color: rgb(15, 23, 42);
    gap: 0.55rem;
    letter-spacing: 0;
    line-height: 1;
    text-decoration: none;
}

.public-header .logo:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.public-header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.public-header nav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.15s;
    text-decoration: none;
}

.public-header nav a:hover {
    color: var(--primary);
    text-decoration: none;
}

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

.public-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 1.5rem 0;
}

.public-footer .container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-footer p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin: 0;
}

.public-footer a {
    text-decoration: underline;
    text-underline-offset: 0.16em;
    text-decoration-thickness: 1px;
}

/* === Public Main ============================================================ */

main.container {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* === App Layout (Sidebar + Main) ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* === Admin / Superadmin page themes ======================================== */
.admin-theme,
.admin-theme .app-content,
.admin-theme .app-main {
    background: rgb(238 242 255);
}

.superadmin-theme,
.superadmin-theme .app-content,
.superadmin-theme .app-main {
    background: rgb(240, 253, 244);
}


/* === Sidebar ================================================================ */

.sidebar {
    width: var(--sidebar-width);
    background: rgb(15 23 42);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    color: rgb(203, 213, 225);
    /* Hide scrollbar entirely - scrolling still works, just invisible */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE / legacy Edge */
    transition: width 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed state - narrow, icon-only */
.sidebar.is-collapsed {
    width: var(--sidebar-width-collapsed);
}

html.sidebar-collapsed-preload .sidebar {
    width: var(--sidebar-width-collapsed);
}

/* Collapsed brand: show the compact mark, hide the full name */
.sidebar-brand-mark { display: none; }
.sidebar.is-collapsed .sidebar-brand-full { display: none; }
.sidebar.is-collapsed .sidebar-brand-mark  { display: inline-block; }

.sidebar-brand-mark {
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 8px;
    background: transparent;
    color: rgb(255, 255, 255);
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    margin: 0 auto;
}

/* Collapsed: hide project switcher, section labels, nav text, dividers */
.sidebar.is-collapsed .sidebar-project,
.sidebar.is-collapsed .sidebar-section-label,
.sidebar.is-collapsed .nav-label,
.sidebar.is-collapsed .nav-dot,
.sidebar.is-collapsed .sidebar-divider {
    display: none;
}

.sidebar.is-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

.sidebar.is-collapsed .sidebar-nav a {
    justify-content: center;
    padding: 0.55rem 0;
    gap: 0;
}

/* Rotate chevron when collapsed */
.sidebar.is-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* When collapsed, the browser's native title attribute (set via data-label)
   provides hover labels. CSS tooltip omitted because sidebar overflow clips it. */

/* Matching main-content offset shift */
.sidebar.is-collapsed ~ .app-main,
body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-width-collapsed);
}

html.sidebar-collapsed-preload .app-main {
    margin-left: var(--sidebar-width-collapsed);
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;                  /* Chromium, Safari */
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    padding: 0 1.25rem;
    background: rgb(255, 255, 255);
    border-bottom: 1px solid var(--border);
}

.sidebar-brand a {
    font-size: 1.25rem;
    font-weight: 800;
    color: rgb(255, 255, 255);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.sidebar-project {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-project-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(203, 213, 225);
    margin-bottom: 0.2rem;
}

.sidebar-project-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(226, 232, 240);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-project-select {
    width: 100%;
    background: rgba(255,255,255,0.08);
    color: rgb(226, 232, 240);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
    appearance: auto;
}

.sidebar-project-select:focus {
    outline: none;
    border-color: rgb(129 140 248);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.sidebar-project-select option {
    background: rgb(30, 41, 59);
    color: rgb(226, 232, 240);
}

.sidebar-nav {
    flex: 1;
    padding: 0.25rem 0 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.35rem 1.25rem;
    color: rgb(148, 163, 184);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0;
    text-decoration: none;
    transition: all 150ms ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: rgb(226, 232, 240);
    text-decoration: none;
}

.sidebar-nav a.active {
    background: rgba(79, 70, 229, 0.15);
    color: rgb(129 140 248);
    border-left: 3px solid rgb(129 140 248);
    border-right: none;
}

.sidebar-nav .nav-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-section-label {
    padding: 0.55rem 1.25rem 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgb(203, 213, 225);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.sidebar-section-label:first-child {
    padding-top: 0.35rem;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 0.45rem 1rem;
}

/* Nav link icon (inline SVG) */
.sidebar-nav .nav-icon {
    flex-shrink: 0;
    color: currentColor;
}

/* Completion dot shown on right of workflow nav items */
.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    margin-left: auto;
    flex-shrink: 0;
}
.nav-dot--done {
    background: rgb(16, 185, 129);
}

/* Collapse/expand toggle button at the bottom of the sidebar */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.55rem 1.25rem;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgb(148, 163, 184);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 150ms, color 150ms;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgb(226, 232, 240);
}

.sidebar-collapse-btn svg {
    transition: transform 200ms;
    flex-shrink: 0;
}

.sidebar.is-collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 0.55rem 0;
}

.nav-dot {
    flex-shrink: 0;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.app-topbar {
    height: 88px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-left: auto;
}

.user-name {
    font-weight: 600;
    color: var(--text);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.375rem 0.625rem;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text);
    line-height: 1;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: inline-flex;
        margin-right: auto;
    }
}

.app-content {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: none;
    width: 100%;
}

/* === Cards ================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card--allow-overflow {
    overflow: visible;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2,
.card-header h3 {
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* === Page Headers =========================================================== */

.page-header {
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    line-height: 1.2;
}

/* Small neutral count pill shown inside the page title */
.page-title-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 0.5rem;
    background: var(--primary-light, rgb(238 242 255));
    color: var(--primary-dark, rgb(67 56 202));
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 11px;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0.375rem 0 0;
    max-width: 720px;
}

/* === Dashboard ============================================================= */

.card + .card {
    margin-top: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.project-list {
    padding: 0;
}

.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.project-card:last-child {
    border-bottom: none;
}

.project-card:hover {
    background: var(--bg);
}

.project-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

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

.project-actions {
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-draft {
    background: rgb(254, 243, 199);
    color: rgb(146, 64, 14);
}

.status-active {
    background: rgb(209, 250, 229);
    color: rgb(6, 95, 70);
}

.status-completed {
    background: rgb(219 234 254);
    color: rgb(30 64 175);
}

.empty-state {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

.new-project-form {
    padding: 1.25rem 1.5rem;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

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

.form-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

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

@media (max-width: 600px) {
    .project-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .form-row {
        flex-direction: column;
    }
}

/* === Success Page =========================================================== */

.success-section {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.success-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    max-width: 560px;
    width: 100%;
    text-align: center;
}

.success-icon {
    margin-bottom: 1.5rem;
}

.success-icon svg {
    color: var(--success);
}

.success-heading {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.success-subheading {
    font-size: 1.125rem;
    color: var(--success);
    font-weight: 600;
    margin: 0 0 1rem;
}

.success-body {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 0 2rem;
}

.success-next-steps {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.success-next-steps h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--text);
}

.success-next-steps ol {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-light);
    line-height: 1.8;
}

.success-cta {
    display: inline-block;
    margin-bottom: 2rem;
}

.success-links {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.success-links p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin: 0 0 0.75rem;
}

.success-links-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* === Buttons ================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: rgb(255, 255, 255);
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    text-decoration: none;
    color: rgb(255, 255, 255);
}

.btn-secondary {
    background: var(--surface);
    color: var(--secondary);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: rgb(255, 255, 255);
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: rgb(185, 28, 28);
    border-color: rgb(185, 28, 28);
    text-decoration: none;
    color: rgb(255, 255, 255);
}

.btn-sm {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1.0625rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* === Forms ================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

input[type="text"],
input:not([type]),
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="time"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.form-error {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--danger);
}


.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.flash-message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9375rem;
    border: 1px solid transparent;
}

.flash-message__content {
    flex: 1;
}

.flash-message__dismiss {
    border: none;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0.125rem;
    border-radius: var(--radius);
}

.flash-message__dismiss:hover,
.flash-message__dismiss:focus {
    background: rgba(15, 23, 42, 0.08);
}

.flash-message--success,
.flash-message.success {
    background: rgb(220 252 231);
    color: rgb(21 128 61);
    border-color: rgb(187 247 208);
}

.flash-message--error,
.flash-message.error {
    background: rgb(254, 226, 226);
    color: rgb(185, 28, 28);
    border-color: rgb(254 202 202);
}

/* Default flash (no modifier) treated as success */
.flash-message:not(.error):not(.success) {
    background: rgb(220 252 231);
    color: rgb(21 128 61);
    border-color: rgb(187 247 208);
}

/* === Tables ================================================================= */

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

thead th {
    background: var(--bg);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg);
}

/* === Badges ================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-success   { background: rgb(220 252 231); color: rgb(21 128 61); }
.badge-danger    { background: rgb(254, 226, 226); color: rgb(185, 28, 28); }
.badge-warning   { background: rgb(254, 243, 199); color: rgb(146, 64, 14); }
.badge-secondary { background: var(--border); color: var(--secondary); }

/* === Dropdowns ============================================================== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 300;
    display: none;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    color: var(--text);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--bg);
    text-decoration: none;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.25rem 0;
}

/* === Modals ================================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    overflow-y: auto;
    backdrop-filter: blur(6px);
}

.modal-overlay.hidden {
    display: none;
}

.modal,
.modal-content {
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal:focus {
    outline: none;
}

.modal-header {
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal-header__main {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    min-width: 0;
}

.modal-header__icon {
    align-items: center;
    background: rgb(245, 243, 255);
    border-radius: 12px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 auto;
    height: 3rem;
    justify-content: center;
    width: 3rem;
}

.modal-header__icon svg {
    height: 1.25rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 1.25rem;
}

.modal-header__copy {
    min-width: 0;
}

.modal-title,
.modal-header h2,
.modal-header h3 {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0;
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.45;
    margin: 0.25rem 0 0;
}

.modal-close {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-light);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0;
    height: 2.25rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    width: 2.25rem;
}

.modal-close::before {
    content: "\00d7";
    font-size: 1.65rem;
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

/* Form inside modal must be flex so footer stays pinned at bottom */
.modal form,
.modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-body {
    padding: 1rem 1.75rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.75rem;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.modal .form-group {
    margin-bottom: 1rem;
}

.modal label {
    color: var(--text);
    display: inline-flex;
    font-size: 0.92rem;
    font-weight: 700;
    gap: 0.25rem;
    margin-bottom: 0.45rem;
}

.modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.modal select,
.modal textarea,
.modal-content input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.modal-content select,
.modal-content textarea {
    background: var(--surface);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    min-height: 2.75rem;
    padding: 0.7rem 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.modal textarea,
.modal-content textarea {
    line-height: 1.45;
    min-height: 6.75rem;
    resize: vertical;
}

.modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
.modal select:focus,
.modal textarea:focus,
.modal-content input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
.modal-content select:focus,
.modal-content textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
    outline: none;
}

.modal-field-grid {
    display: grid;
    gap: 0.25rem 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-field-wrap--full,
.wi-modal .modal-field-wrap[data-field="title"],
.wi-modal .modal-field-wrap[data-field="description"],
.wi-modal .modal-field-wrap[data-field="acceptance_criteria"],
.wi-modal .modal-field-wrap[data-field="kr_hypothesis"],
.wi-modal .modal-field-wrap[data-field="git_links"],
.story-modal .modal-field-wrap[data-field="title"],
.story-modal .modal-field-wrap[data-field="description"],
.story-modal .modal-field-wrap[data-field="acceptance_criteria"],
.story-modal .modal-field-wrap[data-field="kr_hypothesis"],
.story-modal .modal-field-wrap[data-field="blocked_by"],
.story-modal .modal-field-wrap[data-field="git_links"] {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .modal-overlay {
        align-items: flex-start;
        padding: 0.75rem;
    }

    .modal,
    .modal-content {
        border-radius: 14px;
        max-height: calc(100dvh - 24px);
    }

    .modal-header {
        padding: 1rem 1rem 0.75rem;
    }

    .modal-header__main {
        gap: 0.75rem;
    }

    .modal-header__icon {
        border-radius: 10px;
        height: 2.5rem;
        width: 2.5rem;
    }

    .modal-title,
    .modal-header h2,
    .modal-header h3 {
        font-size: 1.15rem;
    }

    .modal-subtitle {
        font-size: 0.88rem;
    }

    .modal-body {
        padding: 0.75rem 1rem 1rem;
    }

    .modal-field-grid {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-wrap: wrap;
        padding: 0.85rem 1rem;
    }

    .modal-footer .btn {
        flex: 1 1 8rem;
    }
}

/* === Drag Handles =========================================================== */

.drag-handle {
    cursor: grab;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    min-width: 1.75rem;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
    user-select: none;
}

.reorder-enabled .drag-handle {
    opacity: 0.7;
    visibility: visible;
    pointer-events: auto;
}

.reorder-enabled .drag-handle:hover {
    opacity: 1;
}

.reorder-enabled .drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-light);
}

.reorder-status-note {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    background: rgb(238 244 255);
    color: var(--text);
    font-size: 0.95rem;
}

/* === Pricing Section ======================================================== */

.pricing-section {
    padding: 3rem 0;
}

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.pricing-header p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0;
}

.pricing-cards {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    justify-content: center;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    flex: 1;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s;
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.pricing-card--featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg);
}

.pricing-card-badge {
    position: absolute;
    top: -0.875rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: rgb(255, 255, 255);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.875rem;
    border-radius: 9999px;
    white-space: nowrap;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pricing-card-header {
    margin-bottom: 2rem;
}

.pricing-tier {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.pricing-billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    margin: 0 0 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.pricing-billing-toggle-btn {
    min-width: 5.75rem;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.pricing-billing-toggle-btn:hover {
    color: var(--text);
}

.pricing-billing-toggle-btn.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.pricing-price {
    margin-bottom: 0.75rem;
}

.pricing-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.pricing-period {
    color: var(--text-light);
    font-size: 0.95rem;
}

.pricing-price-options {
    display: grid;
    gap: 0.75rem;
}

.pricing-price-option {
    margin: 0;
}

.pricing-price-option .btn {
    display: grid;
    gap: 0.15rem;
    min-height: 3rem;
    line-height: 1.25;
}

.pricing-button-meta {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.86;
}

.pricing-empty-state {
    max-width: 560px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.pricing-empty-state h2 {
    margin: 0 0 0.65rem;
    color: var(--text);
    font-size: 1.35rem;
}

.pricing-empty-state p {
    margin: 0 0 1.25rem;
    color: var(--text-light);
}

.pricing-description {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin: 0;
}

.pricing-features {
    flex: 1;
    margin-bottom: 2rem;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* Checkmark bullet via pseudo-element */
.pricing-features li::before {
    content: '?';
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

/* Extra features (consultancy-only) highlighted */
.pricing-features li.pricing-features__extra {
    color: var(--primary-dark);
    font-weight: 600;
}

.pricing-features li.pricing-features__extra::before {
    color: var(--primary);
}

/* === Auth Pages (Login, Forgot Password, Set Password) ===================== */

.auth-section {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-footer-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.auth-footer-link a {
    color: var(--text-light);
    text-decoration: none;
}

.auth-footer-link a:hover {
    color: var(--primary);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.25rem;
    }
}

/* === Utility Helpers ======================================================== */

.text-muted  { color: var(--text-light); }
.text-muted a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: 0.5rem; }
.gap-4        { gap: 1rem; }

.hidden { display: none !important; }

/* === Responsive ============================================================= */

@media (max-width: 768px) {
    .pricing-cards {
        flex-direction: column;
        align-items: stretch;
    }

    .pricing-card {
        max-width: 100%;
    }

    .pricing-header h1 {
        font-size: 1.75rem;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 199;
    }

    .app-topbar {
        justify-content: space-between;
    }

    .public-header nav {
        gap: 1rem;
    }

    h1 { font-size: 1.625rem; }
    h2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .pricing-card {
        padding: 1.75rem 1.25rem;
    }

    .pricing-header {
        margin-bottom: 2rem;
    }
}

/* === Upload Page ============================================================ */

:root {
    --upload-blue-bg: rgb(235 243 255);
    --upload-blue-bg-strong: rgb(219 234 254);
    --upload-blue-text: rgb(0 93 231);
    --upload-border-soft: rgb(218 225 236);
    --upload-drop-bg: rgb(250 252 255);
    --upload-success-bg: rgb(239 252 247);
    --upload-success-border: rgb(204 239 225);
    --upload-success-text: rgb(4 120 87);
    --upload-pro-tip-bg: rgb(238 251 247);
    --upload-pro-tip-border: rgb(207 238 227);
}

html[data-theme="dark"] {
    --upload-blue-bg: rgba(59, 130, 246, 0.16);
    --upload-blue-bg-strong: rgba(59, 130, 246, 0.22);
    --upload-blue-text: rgb(96 165 250);
    --upload-border-soft: rgba(148, 163, 184, 0.26);
    --upload-drop-bg: rgba(15, 23, 42, 0.82);
    --upload-success-bg: rgba(5, 150, 105, 0.16);
    --upload-success-border: rgba(5, 150, 105, 0.28);
    --upload-success-text: rgb(110 231 183);
    --upload-pro-tip-bg: rgba(5, 150, 105, 0.14);
    --upload-pro-tip-border: rgba(5, 150, 105, 0.28);
}

.upload-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1280px;
}

.app-content:has(> .upload-page) {
    max-width: none;
}

.upload-page__header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 2px;
}

.upload-page__header-actions {
    flex: 0 0 auto;
}

.upload-page__title {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0 0 8px;
}

.upload-page__subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.45;
    margin: 0;
}

.upload-context-card,
.upload-panel,
.upload-status-card,
.upload-documents-card,
.upload-pro-tip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.upload-context-card {
    align-items: center;
    display: grid;
    gap: 24px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 92px;
    padding: 18px 24px;
}

.upload-context-card__icon,
.upload-drop-zone__icon,
.upload-status-card__icon,
.upload-pro-tip__icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
}

.upload-context-card__icon {
    background: var(--upload-blue-bg);
    border-radius: 999px;
    color: var(--upload-blue-text);
    height: 54px;
    width: 54px;
}

.upload-context-card svg,
.upload-drop-zone svg,
.upload-status-card svg,
.upload-pro-tip svg,
.upload-primary-action svg,
.upload-ai-action svg,
.upload-doc-toggle-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.upload-context-card__icon svg {
    height: 28px;
    width: 28px;
}

.upload-context-card__copy h2,
.upload-panel__title,
.upload-status-card__copy h3,
.upload-doc-title {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    margin: 0;
}

.upload-context-card__copy p,
.upload-status-card__copy p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 6px 0 0;
}

.upload-context-card__action {
    border-color: var(--primary);
    color: var(--primary);
    min-height: 40px;
    padding-left: 18px;
    padding-right: 18px;
}

.info-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Drag-and-drop zone */
.drop-zone {
    background: var(--upload-drop-bg);
    border: 1px dashed var(--upload-border-soft);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-panel {
    padding: 20px 20px 18px;
}

.upload-panel__title {
    margin-bottom: 16px;
}

.upload-drop-zone {
    align-items: center;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    padding: 28px 24px 24px;
}

.drop-zone-icon {
    margin-bottom: 16px;
    position: relative;
}

.upload-drop-zone__icon {
    color: rgb(129 165 226);
    height: 58px;
    width: 58px;
}

.upload-drop-zone__icon > svg {
    height: 58px;
    width: 58px;
}

.upload-drop-zone__icon span {
    align-items: center;
    background: var(--primary);
    border-radius: 999px;
    bottom: -4px;
    color: rgb(255 255 255);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    position: absolute;
    right: -10px;
    width: 34px;
}

.upload-drop-zone__icon span svg {
    height: 19px;
    width: 19px;
}

.drop-zone-label {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    margin: 0 0 8px;
}

.upload-drop-zone__copy {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 18px;
}

.drop-zone-hint {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--primary-dark);
}

#selected-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Divider between upload zone and text paste */
.upload-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 13px;
    margin: 0;
    transform: translateY(50%);
    z-index: 1;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.upload-divider span {
    background: var(--surface);
    padding: 0 14px;
}

.upload-textarea-wrap {
    margin: 0;
}

.upload-textarea {
    border-color: var(--upload-border-soft);
    border-radius: 8px;
    color: var(--text);
    min-height: 96px;
    padding: 20px 14px;
    resize: vertical;
    width: 100%;
}

.upload-form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 16px 0 0;
}

.upload-primary-action,
.upload-ai-action {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
}

.upload-primary-action svg,
.upload-ai-action svg {
    height: 18px;
    width: 18px;
}

/* Document list */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.document-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.document-item:last-child {
    border-bottom: none;
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.document-name {
    font-weight: 600;
    color: var(--text);
}

.document-size,
.document-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

/* Extracted text preview */
.extracted-text-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.text-preview {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.text-full {
    margin-top: 0.5rem;
}

.text-full-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* AI summary box */
.ai-summary-box {
    background: rgb(240, 253, 244);
    border: 1px solid rgb(134 239 172);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-summary-box strong {
    color: rgb(21 128 61);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-summary-box p {
    color: var(--text);
    font-size: 0.9rem;
}

/* === Diagram Page =========================================================== */

.diagram-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.diagram-render {
    flex: 3;
    min-width: 0;
}

.diagram-render .card-body {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mermaid-output {
    width: 100%;
    overflow-x: auto;
    padding: 1rem 0.75rem;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.98));
    border-radius: var(--radius);
}

#mermaid-output svg {
    max-width: 100%;
    height: auto;
    min-width: 720px;
    display: block;
    margin: 0 auto;
}

/* Keep generated Mermaid roadmaps readable even when AI output includes styles. */
#mermaid-output svg .node rect,
#mermaid-output svg .node circle,
#mermaid-output svg .node ellipse,
#mermaid-output svg .node polygon,
#mermaid-output svg .node path {
    fill: #f8fbff !important;
    stroke: rgb(59 130 246) !important;
    stroke-width: 1.5px !important;
    filter: drop-shadow(0 5px 14px rgba(15, 23, 42, 0.08));
}

#mermaid-output svg .node:nth-of-type(3n + 1) rect,
#mermaid-output svg .node:nth-of-type(3n + 1) circle,
#mermaid-output svg .node:nth-of-type(3n + 1) ellipse,
#mermaid-output svg .node:nth-of-type(3n + 1) polygon,
#mermaid-output svg .node:nth-of-type(3n + 1) path {
    fill: #f8fbff !important;
    stroke: rgb(59 130 246) !important;
}

#mermaid-output svg .node:nth-of-type(3n + 2) rect,
#mermaid-output svg .node:nth-of-type(3n + 2) circle,
#mermaid-output svg .node:nth-of-type(3n + 2) ellipse,
#mermaid-output svg .node:nth-of-type(3n + 2) polygon,
#mermaid-output svg .node:nth-of-type(3n + 2) path {
    fill: rgb(236, 253, 245) !important;
    stroke: rgb(34 197 94) !important;
}

#mermaid-output svg .edgePath path,
#mermaid-output svg .flowchart-link {
    fill: none !important;
    stroke: rgb(148, 163, 184) !important;
    stroke-width: 1.5px !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

#mermaid-output svg marker path,
#mermaid-output svg .arrowheadPath {
    fill: rgb(148, 163, 184) !important;
    stroke: rgb(148, 163, 184) !important;
}

#mermaid-output svg .label,
#mermaid-output svg .nodeLabel,
#mermaid-output svg .nodeLabel p,
#mermaid-output svg foreignObject,
#mermaid-output svg foreignObject div,
#mermaid-output svg foreignObject span,
#mermaid-output svg text {
    fill: rgb(15 23 42) !important;
    color: rgb(15 23 42) !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
}

#mermaid-output svg .cluster rect {
    fill: rgb(248 250 252) !important;
    stroke: rgb(203, 213, 225) !important;
}

#mermaid-output .error {
    color: var(--danger);
    font-size: 0.9rem;
    padding: 1rem;
    background: rgb(254, 226, 226);
    border-radius: var(--radius);
}

.mermaid-editor-modal {
    max-width: 1180px;
}

.mermaid-editor-modal__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 1.25rem;
}

.mermaid-editor-modal__textarea {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: min(48vh, 430px);
    resize: none;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 2.05;
    min-width: 0;
    overflow: auto;
    padding: 1rem 1.25rem;
    white-space: pre;
}

.modal textarea.mermaid-editor-modal__textarea:focus {
    border-color: transparent;
    box-shadow: none;
}

.roadmap-modal-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.roadmap-modal-toolbar__label {
    margin: 0;
}

.roadmap-modal-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: flex-end;
}

.roadmap-tool-button {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    min-height: 2.35rem;
}

.roadmap-tool-button svg {
    fill: none;
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 1rem;
}

.roadmap-code-editor {
    border: 1px solid rgb(203, 213, 225);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    min-height: min(48vh, 430px);
    overflow: hidden;
}

.roadmap-code-line-numbers {
    background: rgb(248 250 252);
    border-right: 1px solid rgb(226 232 240);
    color: var(--text-muted);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 2.05;
    margin: 0;
    overflow: hidden;
    padding: 1rem 1.25rem 1rem 0;
    text-align: right;
    user-select: none;
}

.roadmap-editor-status {
    align-items: center;
    border: 1px solid rgb(226 232 240);
    border-radius: 8px;
    color: var(--text-light);
    display: flex;
    gap: 1rem;
    min-height: 5.25rem;
    padding: 1rem 1.25rem;
}

.roadmap-editor-status strong {
    color: var(--text);
}

.roadmap-editor-status__icon {
    align-items: center;
    border: 2px solid currentColor;
    border-radius: 999px;
    color: var(--text-muted);
    display: inline-flex;
    flex: 0 0 auto;
    height: 1.5rem;
    justify-content: center;
    width: 1.5rem;
}

.roadmap-editor-status__icon::before {
    content: "i";
    font-size: 0.8rem;
    font-weight: 800;
}

.roadmap-editor-status--success {
    background: rgb(248 253 250);
    border-color: rgb(187 247 208);
}

.roadmap-editor-status--success .roadmap-editor-status__icon {
    color: rgb(22 163 74);
}

.roadmap-editor-status--success .roadmap-editor-status__icon::before {
    content: "";
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    height: 0.55rem;
    transform: rotate(45deg) translateY(-1px);
    width: 0.3rem;
}

.roadmap-editor-status--error {
    background: rgb(255 251 251);
    border-color: rgb(254 202 202);
}

.roadmap-editor-status--error .roadmap-editor-status__icon {
    color: var(--danger);
}

.roadmap-editor-status--error .roadmap-editor-status__icon::before {
    content: "!";
}
.diagram-editor {
    flex: 2;
    min-width: 0;
}

.diagram-editor textarea {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    min-height: 280px;
    resize: vertical;
}

/* Node OKR List */
.node-okr-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.node-okr-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    background: var(--bg);
}

.node-okr-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.node-okr-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.node-okr-fields .form-group {
    margin-bottom: 0.5rem;
}

.node-okr-fields .form-group:last-of-type {
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .diagram-container {
        flex-direction: column;
    }

    .diagram-render,
    .diagram-editor {
        flex: none;
        width: 100%;
    }
}

/* === Work Items Page ======================================================= */

.work-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.work-item-row:last-child,
.story-row-details:last-child > summary.work-item-row {
    border-bottom: none;
}

.work-item-row:hover {
    background: var(--bg);
}

.work-item-info {
    flex: 1;
    min-width: 0;
}

.work-item-info strong {
    display: block;
    color: var(--text);
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
}

.work-item-desc-preview {
    color: var(--text-light);
    font-size: 0.8125rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 500px;
}

.priority-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.work-item-owner {
    font-size: 0.8125rem;
    color: var(--text-light);
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.work-item-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* Compact roadmap preview on the work items page */
.diagram-thumbnail {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.diagram-thumbnail-inner {
    align-items: center;
    background: #fbfdff;
    display: flex;
    height: 240px;
    justify-content: center;
    overflow: hidden;
    padding: 0.75rem;
}

.diagram-thumbnail-inner svg {
    display: block;
    height: auto;
    margin: 0 auto;
    max-height: none;
    max-width: none;
    min-width: 100%;
    width: 100%;
}

.diagram-thumbnail__actions {
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.75rem;
}

.diagram-thumbnail__link {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.diagram-thumbnail__link:focus,
.diagram-thumbnail__link:hover {
    color: var(--primary-dark);
}

.diagram-thumbnail-inner svg .node rect,
.diagram-thumbnail-inner svg .node circle,
.diagram-thumbnail-inner svg .node ellipse,
.diagram-thumbnail-inner svg .node polygon,
.diagram-thumbnail-inner svg .node path {
    fill: #f8fbff !important;
    stroke: rgb(59 130 246) !important;
    stroke-width: 1.5px !important;
}

.roadmap-mermaid-svg .roadmap-node-shape {
    stroke-width: 1.5px !important;
    filter: drop-shadow(0 5px 14px rgba(15, 23, 42, 0.08)) !important;
}

.roadmap-mermaid-svg .roadmap-node-shape--0 {
    fill: #f8fbff !important;
    stroke: rgb(59 130 246) !important;
}

.roadmap-mermaid-svg .roadmap-node-shape--1 {
    fill: rgb(240, 253, 244) !important;
    stroke: rgb(34 197 94) !important;
}

.roadmap-mermaid-svg .roadmap-node-shape--2 {
    fill: rgb(250 245 255) !important;
    stroke: rgb(168 85 247) !important;
}

.roadmap-mermaid-svg .roadmap-node-shape--3 {
    fill: rgb(255, 255, 255) !important;
    stroke: rgb(249 115 22) !important;
}

.diagram-thumbnail-inner svg .edgePath path,
.diagram-thumbnail-inner svg .flowchart-link,
.roadmap-mermaid-svg .roadmap-mermaid-edge {
    fill: none !important;
    stroke: rgb(148, 163, 184) !important;
    stroke-width: 1.5px !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    filter: none !important;
}

.diagram-thumbnail-inner svg marker path,
.diagram-thumbnail-inner svg .arrowheadPath,
.roadmap-mermaid-svg .roadmap-mermaid-arrow {
    fill: rgb(148, 163, 184) !important;
    stroke: rgb(148, 163, 184) !important;
}

.diagram-thumbnail-inner svg .label,
.diagram-thumbnail-inner svg .nodeLabel,
.diagram-thumbnail-inner svg .nodeLabel p,
.diagram-thumbnail-inner svg foreignObject,
.diagram-thumbnail-inner svg foreignObject div,
.diagram-thumbnail-inner svg foreignObject span,
.diagram-thumbnail-inner svg text,
.roadmap-mermaid-svg .roadmap-mermaid-label {
    fill: rgb(15 23 42) !important;
    color: rgb(15 23 42) !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
}

.diagram-thumbnail-inner .roadmap-mermaid-label {
    font-size: 12px !important;
}

.mermaid-thumb-error {
    font-size: 0.75rem;
}

.work-items-roadmap-coverage {
    overflow: hidden;
}

.roadmap-coverage__header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.roadmap-coverage__title-group {
    min-width: 0;
}

.roadmap-coverage__summary {
    margin: 0.25rem 0 0;
}

.roadmap-coverage__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.roadmap-coverage__metrics {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.roadmap-coverage__metric {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.roadmap-coverage__metric-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.1;
}

.roadmap-coverage__metric-label {
    color: var(--text-muted);
    display: block;
    font-size: 0.78rem;
    line-height: 1.3;
    margin-top: 0.2rem;
}

.roadmap-coverage__nodes {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.roadmap-coverage__node {
    background: var(--surface);
}

.roadmap-coverage__nodes.accordion-list {
    gap: 0.75rem;
    padding-left: 0;
    padding-right: 0;
}

.roadmap-coverage__node-toggle.accordion-header {
    align-items: center;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: minmax(0, 1fr) 6.75rem 1rem;
    padding: 0.85rem 1rem;
}

.roadmap-coverage__node-main {
    display: block;
    flex: 1;
    min-width: 0;
}

.roadmap-coverage__node-heading {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.roadmap-coverage__node-title.accordion-title {
    flex: initial;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.roadmap-coverage__node-subtitle {
    font-size: 0.84rem;
    line-height: 1.35;
}

.roadmap-coverage__node-details {
    display: none;
}

.roadmap-coverage__node-context {
    margin-bottom: 0.85rem;
}

.roadmap-coverage__node-context p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.25rem 0 0;
}

.roadmap-coverage__detail-label {
    color: var(--text);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.roadmap-coverage__work-items {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
}

.roadmap-coverage__work-items li {
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.4;
}

.roadmap-coverage__priority {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 0.35rem;
}

.roadmap-coverage__empty {
    font-size: 0.875rem;
    margin: 0.65rem 0 0;
}

.roadmap-coverage__status {
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 700;
    justify-content: flex-end;
    justify-self: end;
    line-height: 1.2;
    min-width: 6.75rem;
    padding: 0.3rem 0.55rem;
    text-align: right;
    width: auto;
    white-space: normal;
}

.roadmap-coverage__chevron {
    align-self: center;
    justify-self: end;
}

.roadmap-coverage__status--covered {
    background: var(--success-light, rgb(236, 253, 245));
    border-color: var(--success, rgb(22, 163, 74));
    color: var(--success-dark, rgb(22 101 52));
}

.roadmap-coverage__status--partial {
    background: var(--warning-light, rgb(255, 255, 255)beb);
    border-color: var(--warning, rgb(217, 119, 6));
    color: var(--warning-dark, rgb(146, 64, 14));
}

.roadmap-coverage__status--uncovered {
    background: var(--bg);
    color: var(--text-muted);
}

.roadmap-coverage__unmapped {
    background: var(--surface);
    margin-top: 0.25rem;
}

/* Export section */
.export-section {
    display: flex;
    flex-direction: column;
}

/* === Prioritisation Page ==================================================== */

.prio-row td {
    vertical-align: middle;
}

.score-dropdown {
    width: 58px;
    padding: 0.25rem 0.25rem;
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s;
}

.score-dropdown:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.score-select {
    padding: 0.375rem 0.75rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
}

.final-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.25rem 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-radius: var(--radius);
}

.ai-suggest-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

@media (max-width: 768px) {
    .work-item-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .work-item-desc-preview {
        max-width: 100%;
    }

    .work-item-info {
        flex-basis: 100%;
        order: 2;
    }

    .work-item-actions {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-end;
    }

    .diagram-thumbnail {
        float: none;
        position: static;
        width: 100%;
        max-height: 150px;
        margin: 0 0 1rem 0;
    }

    .roadmap-coverage__header {
        align-items: stretch;
        flex-direction: column;
    }

    .roadmap-coverage__node {
        width: 100%;
    }

    .roadmap-coverage__node-toggle.accordion-header {
        gap: 0.65rem;
        grid-template-columns: minmax(0, 1fr) 5.75rem 1rem;
    }

    .roadmap-coverage__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .roadmap-coverage__status {
        margin-left: 0;
        min-width: 5.75rem;
    }
}

/* === Work Items Page Redesign ============================================= */

.app-content:has(> .work-items-page) {
    max-width: none;
}

.work-items-page {
    --wi-blue: rgb(37 99 235);
    --wi-blue-bg: rgb(232 241 255);
    --wi-border: rgb(223 231 242);
    --wi-border-strong: rgb(219 227 239);
    --wi-border-soft: rgb(230 237 245);
    --wi-control-border: rgb(215 225 239);
    --wi-green-bg: rgb(216 247 232);
    --wi-ink: rgb(7 21 48);
    --wi-muted: rgb(79 99 133);
    --wi-orange-bg: rgb(255 240 216);
    --wi-primary-dark: rgb(49 46 129);
    --wi-secondary-bg: rgb(238 242 247);
    --wi-slate: rgb(38 59 96);
    --wi-surface-soft: rgb(251 253 255);
    --wi-warning-bg: rgb(255 248 237);
    --wi-warning-border: rgb(254 215 170);
    color: var(--wi-ink);
    display: flex;
    flex-direction: column;
    gap: 1.45rem;
    margin: 0;
    max-width: none;
    padding: 0 0 1.75rem;
    width: 100%;
}

.work-items-page__header {
    align-items: flex-start;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin: 0.15rem 0 0.2rem;
}

.work-items-page__heading h1 {
    align-items: center;
    display: flex;
    font-size: 1.72rem;
    font-weight: 750;
    gap: 0.55rem;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
}

.work-items-page__heading p {
    color: var(--wi-muted);
    font-size: 0.93rem;
    line-height: 1.45;
    margin: 0.65rem 0 0;
}

.work-items-page .page-info-popover {
    left: auto;
    max-width: min(320px, calc(100vw - 2rem));
    right: 0;
}

.work-items-page .page-info-popover::before {
    left: auto;
    right: 14px;
}

.work-items-page__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: flex-end;
    padding-top: 0.2rem;
}

.work-items-page__actions .btn,
.work-items-generation-panel .btn,
.work-items-panel .btn {
    border-radius: 8px;
    font-weight: 700;
    min-height: 38px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.work-items-generation-panel .btn svg,
.roadmap-coverage__okr-action .btn svg,
.work-items-export-links svg {
    flex: 0 0 auto;
    height: 14px;
    width: 14px;
}

.work-items-panel,
.work-items-generation-panel,
.work-items-table-panel {
    background: var(--surface);
    border: 1px solid var(--wi-border-strong);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

.work-items-panel__header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.4rem 1.45rem 1rem;
}

.work-items-panel__header h2,
.work-items-generation-panel h2 {
    font-size: 1.08rem;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0;
}

.work-items-panel__header p,
.work-items-generation-panel p {
    color: var(--wi-muted);
    font-size: 0.86rem;
    line-height: 1.45;
    margin: 0.3rem 0 0;
}

.work-items-coverage-metrics {
    gap: 1.05rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 1.45rem 1.15rem;
}

.work-items-coverage-metric {
    align-items: center;
    border-color: var(--wi-border);
    border-radius: 8px;
    display: flex;
    gap: 0.85rem;
    min-height: 76px;
    padding: 0.85rem 1rem;
}

.work-items-coverage-metric__icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.work-items-coverage-metric__icon svg {
    height: 20px;
    width: 20px;
}

.work-items-coverage-metric--covered .work-items-coverage-metric__icon {
    background: var(--wi-green-bg);
    color: var(--success);
}

.work-items-coverage-metric--partial .work-items-coverage-metric__icon {
    background: var(--wi-orange-bg);
    color: var(--warning);
}

.work-items-coverage-metric--empty .work-items-coverage-metric__icon {
    background: var(--wi-blue-bg);
    color: var(--wi-blue);
}

.work-items-coverage-metric--unmapped .work-items-coverage-metric__icon {
    background: var(--wi-secondary-bg);
    color: var(--text-secondary);
}

.work-items-coverage-metric .roadmap-coverage__metric-value {
    color: var(--wi-ink);
    font-size: 1.22rem;
    font-weight: 780;
}

.work-items-coverage-metric .roadmap-coverage__metric-label {
    color: var(--wi-muted);
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.work-items-okr-links {
    border-top: 1px solid var(--wi-border-soft);
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1fr);
    margin: 0 1.45rem;
    padding: 1rem 0 1.45rem;
}

.work-items-okr-link {
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--wi-border);
    border-radius: 8px;
    color: var(--wi-slate);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 100%;
    min-height: 54px;
    overflow: hidden;
    padding: 0;
    text-decoration: none;
    width: 100%;
}

.work-items-okr-link:hover {
    border-color: rgb(182 195 214);
}

.work-items-okr-link__summary {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    min-height: 58px;
    padding: 0.8rem 1rem;
    text-align: left;
    width: 100%;
}

.work-items-okr-link__summary.roadmap-coverage__node-toggle {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 34px minmax(150px, 1fr) auto 72px 18px;
    width: 100%;
}

.work-items-okr-link__marker {
    align-items: center;
    background: var(--primary);
    border-radius: 999px;
    color: var(--surface);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    min-width: 28px;
    padding: 0 0.2rem;
}

.work-items-okr-link__heading {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.work-items-okr-link__title {
    color: var(--wi-slate);
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    white-space: nowrap;
}

.work-items-okr-link__subtitle {
    color: var(--wi-muted);
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-items-okr-link .roadmap-coverage__status {
    justify-content: flex-end;
    font-size: 0.72rem;
    min-width: 88px;
    padding: 0.32rem 0.55rem;
    text-align: right;
}

.work-items-okr-link__linked-count {
    color: var(--wi-muted);
    font-size: 0.78rem;
    font-weight: 750;
    justify-self: end;
    white-space: nowrap;
}

.work-items-okr-link .roadmap-coverage__chevron {
    align-self: center;
    color: var(--text-muted);
}

.roadmap-coverage__chevron-wrap {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    transition: transform 200ms ease;
}

.work-items-okr-link.accordion-item--open > .accordion-header .roadmap-coverage__chevron-wrap {
    transform: rotate(90deg);
}

.work-items-okr-link__items {
    gap: 0.2rem;
    margin: 0;
}

.work-items-okr-link__items li,
.work-items-okr-link__items a {
    color: var(--wi-muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.25;
    max-width: 20rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-items-okr-link .roadmap-coverage__empty {
    align-items: center;
    display: inline-flex;
    gap: 0.65rem;
    margin: 0;
}

.work-items-okr-link .roadmap-coverage__empty svg {
    color: var(--wi-slate);
    height: 18px;
    width: 18px;
}

.work-items-okr-link .roadmap-coverage__node-details {
    border-top: 1px solid var(--wi-border-soft);
    padding: 1.05rem 1.25rem 1.15rem;
}

.work-items-okr-link .roadmap-coverage__okr-action {
    margin-top: 0;
}

.work-items-okr-link__body-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.work-items-okr-link__body-row > *:first-child {
    min-width: 0;
}

.work-items-generation-panel {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(220px, 1fr) auto;
    overflow: hidden;
    padding: 1.35rem 1.45rem;
}

.work-items-generation-panel__intro,
.work-items-generation-panel__actions {
    align-items: center;
    display: flex;
    gap: 0.9rem;
    min-height: 0;
    padding: 0;
}

.work-items-generation-panel__spark {
    color: var(--primary);
    flex: 0 0 auto;
}

.work-items-generation-panel__spark svg {
    height: 19px;
    width: 19px;
}

.work-items-generation-panel__okr {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
}

.work-items-generation-panel__okr span {
    color: var(--wi-muted);
    font-size: 0.73rem;
    font-weight: 750;
}

.work-items-generation-panel__okr strong {
    background: var(--primary-light);
    border-radius: 8px;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 750;
    max-width: 100%;
    overflow: hidden;
    padding: 0.42rem 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-items-generation-panel__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.work-items-generation-panel__actions form {
    display: inline-flex;
}

.work-items-generation-panel__actions .btn {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
}

.work-items-generation-panel__warning {
    background: var(--wi-warning-bg);
    border: 1px solid var(--wi-warning-border);
    border-radius: 7px;
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 600;
    grid-column: 1 / -1;
    margin: 0;
    padding: 0.68rem 0.9rem;
}

.work-items-table-panel {
    overflow: hidden;
}

.work-items-table-toolbar {
    align-items: center;
    border-bottom: 1px solid var(--wi-border-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.1rem;
}

.work-items-table-toolbar__left,
.work-items-table-toolbar__right {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.work-items-table-toolbar__right {
    color: var(--wi-muted);
    font-size: 0.78rem;
}

.work-items-filter-select,
.work-items-show-select,
.work-items-search {
    background: var(--surface);
    border: 1px solid var(--wi-control-border);
    border-radius: 8px;
    color: var(--wi-slate);
    min-height: 34px;
}

.work-items-filter-select,
.work-items-show-select {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 0.75rem;
}

.work-items-search {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    min-width: 300px;
    padding: 0 0.65rem;
}

.work-items-search svg,
.work-items-filter-button svg {
    color: var(--text-muted);
    height: 16px;
    width: 16px;
}

.work-items-search input {
    border: 0;
    color: var(--wi-slate);
    font-size: 0.78rem;
    min-width: 0;
    outline: 0;
    width: 100%;
}

.work-items-filter-button,
.work-items-page-arrow,
.work-items-page-number {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--wi-control-border);
    border-radius: 8px;
    color: var(--wi-slate);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    min-width: 34px;
}

.work-items-page-number {
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 800;
}

.work-items-page-arrow {
    font-size: 1.2rem;
    text-decoration: none;
}

.work-items-page-arrow.is-disabled {
    color: var(--text-muted);
}

.work-items-table {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    width: 100%;
}

.work-items-table__head,
.work-items-table-row {
    display: grid;
    grid-template-columns: 66px minmax(340px, 2.05fr) minmax(100px, 0.52fr) minmax(96px, 0.48fr) minmax(84px, 0.42fr) minmax(78px, 0.4fr) minmax(132px, 0.62fr) minmax(130px, 0.62fr) 44px;
}

.work-items-table__head {
    align-items: center;
    background: var(--wi-surface-soft);
    border-bottom: 1px solid var(--wi-border-soft);
    color: var(--wi-muted);
    font-size: 0.73rem;
    font-weight: 800;
    min-height: 46px;
    padding: 0 1.1rem;
}

.work-items-table-row-details {
    border-bottom: 1px solid var(--wi-border-soft);
}

.work-items-table-row-details:last-child {
    border-bottom: 0;
}

.work-items-table-row {
    align-items: center;
    cursor: default;
    gap: 0;
    list-style: none;
    min-height: 108px;
    padding: 1.05rem 1.1rem;
}

.work-items-table-row::-webkit-details-marker {
    display: none;
}

.work-items-table-row:hover {
    background: var(--wi-surface-soft);
}

.work-items-row-index {
    align-items: center;
    align-self: center;
    display: inline-flex;
    gap: 0.5rem;
    justify-self: start;
}

.work-items-row-drag {
    align-self: center;
    color: var(--text-muted);
    cursor: grab;
    font-size: 1rem;
    justify-self: start;
}

.work-items-row-number {
    align-items: center;
    align-self: center;
    background: var(--primary-light);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.work-items-row-main {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.work-items-row-main strong {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.3;
}

.work-items-row-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.work-items-row-badges .badge {
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 800;
    line-height: 1.15;
    padding: 0.24rem 0.46rem;
}

.work-items-okr-badge {
    background: var(--secondary);
    color: var(--surface);
}

.work-items-row-main .work-item-desc-preview {
    color: var(--wi-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    margin: 0;
    max-width: 46rem;
}

.work-items-row-okr-link {
    color: var(--wi-blue);
    font-size: 0.72rem;
    font-weight: 750;
    text-decoration: none;
}

.work-items-row-okr-link:hover,
.work-items-row-okr-link:focus {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.work-items-status-pill,
.work-items-sprints-pill,
.work-items-sizing-pill,
.work-items-score-pill {
    align-self: center;
    justify-self: start;
}

.work-items-status-pill {
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.15;
    padding: 0.32rem 0.55rem;
}

.work-items-status-pill--backlog {
    background: var(--wi-secondary-bg);
    color: var(--text-secondary);
}

.work-items-status-pill--in_progress,
.work-items-status-pill--in-review,
.work-items-status-pill--in_review {
    background: var(--wi-blue-bg);
    color: var(--wi-blue);
}

.work-items-status-pill--done,
.work-items-status-pill--closed {
    background: var(--home-green-bg-strong);
    color: var(--home-success-text);
}

.work-items-sprints-pill {
    background: var(--primary);
    color: var(--surface);
}

.work-items-sizing-pill {
    align-items: center;
    background: var(--wi-blue-bg);
    border-radius: 999px;
    color: var(--wi-blue);
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.15;
    min-height: 1.45rem;
    padding: 0.32rem 0.55rem;
    white-space: nowrap;
}

.work-items-score-pill {
    min-width: 38px;
}

.work-items-row-owner,
.work-items-row-updated {
    align-self: center;
    color: var(--wi-muted);
    font-size: 0.76rem;
    justify-self: start;
    line-height: 1.35;
    text-align: left;
}

.work-items-table-row .row-actions-menu {
    align-self: center;
    justify-self: end;
}

.work-items-table-row .row-actions-toggle {
    color: var(--wi-slate);
}

.work-items-table-row-details .story-row-expand {
    border-top: 1px solid var(--wi-border-soft);
    padding: 1rem 1.25rem;
}

.work-items-table__empty {
    align-items: center;
    color: var(--wi-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
    min-height: 180px;
}

.work-items-table__empty[hidden] {
    display: none;
}

.work-items-export-links {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin: 0;
}

.work-items-export-links a {
    align-items: center;
    color: var(--wi-blue);
    display: inline-flex;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
}

.work-items-table-footer {
    align-items: center;
    border-top: 1px solid var(--wi-border-soft);
    color: var(--wi-muted);
    display: flex;
    font-size: 0.78rem;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 1.1rem;
}

.work-items-page .workflow-nav {
    align-items: center;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    margin-top: 0.25rem;
}

.work-items-page .workflow-nav .btn {
    justify-self: start;
    max-width: max-content;
    min-width: 150px;
    width: auto;
}

.work-items-page .workflow-nav .btn:last-child {
    justify-self: end;
}

@media (max-width: 1180px) {
    .work-items-page__header,
    .work-items-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .work-items-page__actions,
    .work-items-table-toolbar__right {
        justify-content: flex-start;
    }

    .work-items-generation-panel {
        grid-template-columns: 1fr;
    }

    .work-items-generation-panel__actions {
        justify-content: flex-start;
    }

    .work-items-table {
        overflow-x: auto;
    }

    .work-items-table__head,
    .work-items-table-row {
        min-width: 1160px;
    }
}

@media (max-width: 768px) {
    .work-items-page {
        gap: 1rem;
    }

    .work-items-page__heading h1 {
        font-size: 1.35rem;
    }

    .work-items-coverage-metrics {
        grid-template-columns: 1fr;
    }

    .work-items-okr-link__summary.roadmap-coverage__node-toggle {
        grid-template-columns: 32px minmax(120px, 1fr) minmax(88px, auto) 18px;
    }

    .work-items-okr-link__linked-count {
        display: none;
    }

    .work-items-okr-link__body-row,
    .work-items-table-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .work-items-table-toolbar__left,
    .work-items-table-toolbar__right,
    .work-items-page__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .work-items-table {
        overflow-x: visible;
    }

    .work-items-table__head {
        display: none;
    }

    .work-items-table-row {
        gap: 0.65rem;
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        min-width: 0;
    }

    .work-items-row-index {
        grid-column: 1;
        grid-row: 1;
    }

    .work-items-row-main {
        grid-column: 2 / -1;
        grid-row: 1;
        padding-right: 2.2rem;
    }

    .work-items-status-pill,
    .work-items-sprints-pill,
    .work-items-sizing-pill,
    .work-items-score-pill,
    .work-items-row-owner,
    .work-items-row-updated {
        grid-column: 2 / -1;
        justify-self: start;
    }

    .work-items-table-row .row-actions-menu {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .work-items-search {
        min-width: 0;
        width: 100%;
    }

    .work-items-page .workflow-nav {
        grid-template-columns: 1fr;
        row-gap: 0.75rem;
    }

    .work-items-page .workflow-nav .btn {
        max-width: none;
        width: 100%;
    }

    .work-items-page .workflow-nav .btn:last-child {
        justify-self: stretch;
    }
}

/* === Risk Modelling ========================================================= */

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

.risk-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

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

.risk-row:hover {
    background: var(--bg);
}

.risk-row.risk-highlighted {
    background: var(--primary-light);
    box-shadow: inset 3px 0 0 var(--primary);
}

.heatmap-cell--interactive {
    cursor: pointer;
}

.heatmap-cell--selected {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
    z-index: 2;
    position: relative;
}

.heatmap-filter-banner {
    padding: 0.75rem 1rem;
    background: rgb(239 246 255);
    border: 1px solid rgb(191 219 254);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.risk-info {
    flex: 1;
    min-width: 0;
}

.risk-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.risk-desc-preview {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.risk-linked-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.risk-linked-items .badge {
    font-size: 0.6875rem;
}

.risk-scores {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* Likelihood colours */
.likelihood-1 { background: rgb(220 252 231); color: rgb(22 101 52); }
.likelihood-2 { background: rgb(254 249 195); color: rgb(133 77 14); }
.likelihood-3 { background: rgb(254 215 170); color: rgb(154 52 18); }
.likelihood-4 { background: rgb(254 202 202); color: rgb(153 27 27); }
.likelihood-5 { background: rgb(252 165 165); color: rgb(127 29 29); }

/* Impact colours */
.impact-1 { background: rgb(220 252 231); color: rgb(22 101 52); }
.impact-2 { background: rgb(254 249 195); color: rgb(133 77 14); }
.impact-3 { background: rgb(254 215 170); color: rgb(154 52 18); }
.impact-4 { background: rgb(254 202 202); color: rgb(153 27 27); }
.impact-5 { background: rgb(252 165 165); color: rgb(127 29 29); }

.risk-rpn {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    white-space: nowrap;
}

.risk-mitigation {
    flex: 1;
    min-width: 0;
}

.mitigation-text {
    font-size: 0.8125rem;
    color: var(--text-light);
    line-height: 1.5;
}

.risk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* === Checkbox Group (for risk work-item linking) ============================ */

.checkbox-group {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

/* === Heatmap ================================================================ */

.heatmap-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.heatmap-y-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.heatmap-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: 32px repeat(5, 56px);
    grid-template-rows: repeat(5, 56px) 24px;
    gap: 3px;
}

.heatmap-row-label,
.heatmap-col-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.heatmap-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.7);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.heatmap-cell.has-risks {
    cursor: pointer;
}

.heatmap-cell.has-risks:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.heatmap-cell.low      { background: rgb(187 247 208); }
.heatmap-cell.medium   { background: rgb(254 240 138); }
.heatmap-cell.high     { background: rgb(254 215 170); }
.heatmap-cell.critical { background: rgb(252 165 165); }

.heatmap-x-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.heatmap-legend {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-swatch.low      { background: rgb(187 247 208); }
.legend-swatch.medium   { background: rgb(254 240 138); }
.legend-swatch.high     { background: rgb(254 215 170); }
.legend-swatch.critical { background: rgb(252 165 165); }

/* === Risk Responsive ======================================================== */

@media (max-width: 768px) {
    .risk-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .risk-info {
        flex-basis: 100%;
    }

    .risk-mitigation {
        flex-basis: 100%;
    }

    .risk-actions {
        flex-basis: 100%;
        justify-content: flex-end;
    }

    .heatmap-grid {
        grid-template-columns: 24px repeat(5, 44px);
        grid-template-rows: repeat(5, 44px) 20px;
    }
}

/* === User Stories Page ====================================================== */

.story-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.story-row:last-child,
.story-row-details:last-child > summary.story-row {
    border-bottom: none;
}

.story-row:hover {
    background: var(--bg);
}

.story-info {
    flex: 1;
    min-width: 0;
}

.story-info strong {
    display: block;
    color: var(--text);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.story-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.story-team {
    font-size: 0.8125rem;
    color: var(--text-light);
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.story-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.hl-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .story-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .story-info {
        flex-basis: calc(100% - 80px);
    }

    .story-size,
    .story-team {
        font-size: 0.75rem;
    }

    .story-actions {
        flex-basis: 100%;
        justify-content: flex-end;
    }
}

/* === Story / Work Item Expandable Rows ====================================== */

/* Remove default <details> marker and make summary look like the existing rows */
.story-row-details {
    list-style: none;
}

.story-row-details > summary {
    cursor: pointer;
}

.story-row-details > summary::-webkit-details-marker,
.story-row-details > summary::marker {
    display: none;
}

/* Expand indicator on the drag handle area */
.story-row-details[open] > summary .drag-handle::after,
.story-row-details > summary .drag-handle::after {
    content: '';
}

/* Strip the bottom border from the summary when expanded so the expand panel flows */
.story-row-details[open] > summary.story-row,
.story-row-details[open] > summary.work-item-row {
    border-bottom: none;
    background: rgb(248 250 252);
}

/* Expand panel */
.story-row-expand {
    padding: 0.75rem 1rem 0.875rem 3.25rem;
    background: rgb(248 250 252);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.story-expand-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.story-expand-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: rgb(148, 163, 184);
    display: block;
    margin-bottom: 0.15rem;
}

.story-ac-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.82rem;
    color: rgb(55, 65, 81);
    line-height: 1.5;
}

.story-ac-list li {
    margin-bottom: 0.2rem;
}

.story-expand-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.story-expand-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.82rem;
    color: rgb(55, 65, 81);
}

.work-item-okr-detail {
    max-width: 72rem;
}

.work-item-okr-detail__title {
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.work-item-okr-detail__description {
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.5;
    margin: 0;
    overflow-wrap: anywhere;
}

/* === Sprint Allocation ====================================================== */

.sprint-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.backlog-panel {
    flex: 0 0 40%;
    max-width: 40%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sprints-panel {
    flex: 0 0 58%;
    max-width: 58%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.backlog-stories {
    padding: 0.5rem;
    min-height: 200px;
}

.sprint-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sprint-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.sprint-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sprint-title-row h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.sprint-dates {
    font-size: 0.8rem;
    color: var(--text-light);
}

.capacity-bar {
    position: relative;
    height: 22px;
    background: rgb(229, 231, 235);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), rgb(34 197 94));
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
}

.capacity-fill.over-capacity {
    background: linear-gradient(90deg, var(--danger), rgb(239, 68, 68));
}

.capacity-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.sprint-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sprint-stories {
    padding: 0.5rem;
    min-height: 60px;
}

.sprint-story-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: grab;
    font-size: 0.85rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.sprint-story-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.12);
}

.sprint-story-item:active {
    cursor: grabbing;
}

.sprint-story-item .story-title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sprint-story-item .badge {
    flex-shrink: 0;
}

.story-parent-tag {
    font-size: 0.7rem;
    color: var(--text-light);
    background: var(--primary-light);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

.sprint-creation-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sprint-edit-form {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgb(254 252 232);
}

.sprint-form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-muted {
    background: var(--secondary);
    color: rgb(255, 255, 255);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* SortableJS ghost styling */
.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-light);
    border: 2px dashed var(--primary);
}

.sortable-chosen {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Responsive sprint layout */
@media (max-width: 900px) {
    .sprint-layout {
        flex-direction: column;
    }

    .backlog-panel,
    .sprints-panel {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .sprint-creation-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* === Admin Area ============================================================ */

.app-content:has(> .admin-dashboard-page) {
    max-width: none;
    padding: 28px 32px 32px;
}

.admin-dashboard-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0;
}

.admin-dashboard-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.admin-dashboard-title {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0;
}

.admin-dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    margin: 8px 0 0;
}

.admin-dashboard-cards {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-dashboard-card,
.admin-dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.admin-dashboard-card {
    color: var(--text);
    display: grid;
    gap: 16px;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 148px;
    padding: 20px;
    text-decoration: none;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.admin-dashboard-card:hover,
.admin-dashboard-card:focus-visible {
    background: var(--bg-secondary);
    border-color: var(--primary);
    text-decoration: none;
}

.admin-dashboard-card__icon,
.admin-dashboard-activity__icon {
    align-items: center;
    background: var(--primary-light);
    border-radius: var(--radius);
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
}

.admin-dashboard-card__icon {
    height: 48px;
    width: 48px;
}

.admin-dashboard-card__icon svg,
.admin-dashboard-activity__icon svg {
    fill: none;
    height: 24px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 24px;
}

.admin-dashboard-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-dashboard-card__label {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.admin-dashboard-card__value {
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 4px;
}

.admin-dashboard-card__meta {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
    margin-top: 8px;
}

.admin-dashboard-card__action,
.admin-dashboard-panel__link,
.admin-dashboard-button {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    text-decoration: none;
}

.admin-dashboard-card__action {
    margin-top: auto;
    padding-top: 16px;
}

.admin-dashboard-panel {
    padding: 20px;
}

.admin-dashboard-panel__header {
    align-items: center;
    display: flex;
    margin-bottom: 16px;
}

.admin-dashboard-panel__header--split {
    gap: 16px;
    justify-content: space-between;
}

.admin-dashboard-panel__header h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0;
}

.admin-dashboard-subscription__layout {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(260px, 0.4fr) minmax(0, 1fr);
}

.admin-dashboard-plan-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.admin-dashboard-plan-summary h3 {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 8px;
}

.admin-dashboard-plan-summary p,
.admin-dashboard-empty p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.admin-dashboard-button {
    align-self: flex-start;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 40px;
    padding: 0 16px;
}

.admin-dashboard-button:hover,
.admin-dashboard-panel__link:hover {
    color: var(--primary-dark);
}

.admin-dashboard-definition-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.admin-dashboard-definition-list div {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(132px, 0.22fr) minmax(0, 1fr);
    min-height: 52px;
}

.admin-dashboard-definition-list div:last-child {
    border-bottom: 0;
}

.admin-dashboard-definition-list dt {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.admin-dashboard-definition-list dd {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.admin-dashboard-status {
    align-items: center;
    border-radius: var(--radius-full);
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    min-height: 24px;
    padding: 0 8px;
    width: fit-content;
}

.admin-dashboard-status--success {
    background: var(--success-soft);
    color: var(--success);
}

.admin-dashboard-status--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.admin-dashboard-activity {
    padding-bottom: 0;
}

.admin-dashboard-activity__list {
    border-top: 1px solid var(--border);
    margin: 0 -20px;
}

.admin-dashboard-activity__row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 12px;
    grid-template-columns: 32px minmax(104px, 0.18fr) minmax(120px, 0.18fr) minmax(0, 1fr) auto;
    min-height: 52px;
    padding: 8px 20px;
}

.admin-dashboard-activity__row:last-child {
    border-bottom: 0;
}

.admin-dashboard-activity__icon {
    background: transparent;
    border-radius: var(--radius-full);
    color: var(--success);
    height: 28px;
    width: 28px;
}

.admin-dashboard-activity__icon svg {
    height: 20px;
    width: 20px;
}

.admin-dashboard-activity__event {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    justify-self: start;
    min-height: 24px;
    padding: 5px 8px;
}

.admin-dashboard-activity__actor {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.admin-dashboard-activity__details,
.admin-dashboard-activity__time {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.admin-dashboard-activity__time {
    white-space: nowrap;
}

.admin-dashboard-empty {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 20px;
}

.app-content:has(> .admin-users-page) {
    max-width: none;
}

.admin-users-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0 0 28px;
}

.admin-users-header {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.admin-users-header__copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.admin-users-title-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.admin-users-title-row h1 {
    color: rgb(7 21 48);
    font-size: 1.62rem;
    font-weight: 750;
    line-height: 1.18;
    margin: 0;
}

.admin-users-page .page-info-popover {
    left: auto;
    max-width: min(320px, calc(100vw - 32px));
    right: 0;
}

.admin-users-page .page-info-popover::before {
    left: auto;
    right: 6px;
}

.admin-users-back {
    color: rgb(79 70 229);
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.admin-users-back::before {
    content: "< ";
}

.admin-users-back:hover {
    color: rgb(49 46 129);
    text-decoration: none;
}

.admin-users-header p,
.admin-users-panel p,
.admin-users-field p,
.admin-users-form-note {
    color: rgb(79 99 133);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.admin-users-header__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

.admin-users-primary-button,
.admin-users-secondary-button {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 750;
    gap: 6px;
    justify-content: center;
    line-height: 1;
    min-height: 36px;
    padding: 0 14px;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.admin-users-primary-button {
    background: rgb(79 70 229);
    border: 1px solid rgb(79 70 229);
    color: rgb(255 255 255);
}

.admin-users-primary-button:hover,
.admin-users-primary-button:focus-visible {
    background: rgb(67 56 202);
    border-color: rgb(67 56 202);
    color: rgb(255 255 255);
}

.admin-users-secondary-button {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    color: rgb(38 59 96);
}

.admin-users-secondary-button:hover,
.admin-users-secondary-button:focus-visible {
    background: rgb(248 250 252);
    border-color: rgb(190 202 220);
    color: rgb(7 21 48);
}

.admin-users-secondary-button svg {
    fill: none;
    height: 15px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 15px;
}

.admin-users-seat-pill {
    align-items: center;
    background: rgb(238 236 255);
    border: 1px solid rgb(215 212 255);
    border-radius: 6px;
    color: rgb(67 56 202);
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 750;
    min-height: 36px;
    padding: 0 14px;
    white-space: nowrap;
}

.admin-users-layout {
    align-items: start;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
}

.admin-users-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

.admin-users-panel {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
}

.admin-users-panel__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 70px;
    padding: 0 22px;
}

.admin-users-panel__header h2 {
    color: rgb(7 21 48);
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.25;
    margin: 0;
}

.admin-users-panel--table {
    overflow: visible;
}

.admin-users-empty {
    border-top: 1px solid rgb(229 231 235);
    padding: 24px 22px;
}

.admin-users-table-wrap {
    overflow: visible;
}

.admin-users-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.admin-users-table th {
    background: rgb(248 250 252);
    border-top: 1px solid rgb(229 231 235);
    color: rgb(93 111 143);
    font-size: 0.74rem;
    font-weight: 750;
    padding: 14px 22px;
    text-align: left;
    text-transform: uppercase;
}

.admin-users-table th:nth-child(1) {
    width: 26%;
}

.admin-users-table th:nth-child(2) {
    width: 14%;
}

.admin-users-table th:nth-child(3) {
    width: 9%;
}

.admin-users-table th:nth-child(4) {
    width: 13%;
}

.admin-users-table th:nth-child(5) {
    width: 25%;
}

.admin-users-table th:nth-child(6) {
    width: 13%;
    text-align: right;
}

.admin-users-table td {
    border-top: 1px solid rgb(229 231 235);
    color: rgb(38 59 96);
    font-size: 0.86rem;
    padding: 22px;
    vertical-align: middle;
}

.admin-users-usercell {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.admin-users-avatar {
    align-items: center;
    background: rgb(79 70 229);
    border-radius: 999px;
    color: rgb(255 255 255);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 750;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.admin-users-usercell__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-users-usercell__text strong {
    color: rgb(7 21 48);
    font-size: 0.9rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-users-usercell__text span,
.admin-users-meta {
    color: rgb(93 111 143);
    font-size: 0.78rem;
    line-height: 1.45;
}

.admin-users-usercell__text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-users-meta {
    display: block;
    margin-top: 8px;
}

.admin-users-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1;
    min-height: 23px;
    padding: 0 9px;
    white-space: nowrap;
}

.admin-users-badge--warning {
    background: rgb(255 237 213);
    color: rgb(194 65 12);
}

.admin-users-badge--primary {
    background: rgb(238 236 255);
    color: rgb(67 56 202);
}

.admin-users-badge--info {
    background: rgb(219 234 254);
    color: rgb(29 78 216);
}

.admin-users-badge--success {
    background: rgb(209 250 229);
    color: rgb(4 120 87);
}

.admin-users-badge--slate,
.admin-users-badge--neutral {
    background: rgb(100 116 139);
    color: rgb(255 255 255);
}

.admin-users-badge--muted {
    background: rgb(226 232 240);
    color: rgb(71 85 105);
}

.admin-users-access-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-users-actions-cell {
    text-align: right;
}

.admin-users-actions-cell .row-actions-menu {
    justify-content: flex-end;
}

.admin-users-actions-cell .row-actions-dropdown {
    text-align: left;
}

.admin-users-menu-note {
    color: rgb(93 111 143);
    display: block;
    font-size: 0.76rem;
    line-height: 1.35;
    padding: 5px 11px 7px;
}

.admin-users-edit-row td {
    background: rgb(248 250 252);
    padding: 18px 22px 22px;
}

.admin-users-edit-form {
    background: rgb(255 255 255);
    border: 1px solid rgb(229 231 235);
    border-radius: 8px;
    padding: 18px;
}

.admin-users-edit-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-users-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-users-field > span {
    align-items: center;
    color: rgb(7 21 48);
    display: flex;
    font-size: 0.82rem;
    font-weight: 750;
    gap: 6px;
}

.admin-users-field--wide {
    grid-column: span 2;
}

.admin-users-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-users-checkbox-list label {
    align-items: flex-start;
    color: rgb(7 21 48);
    display: flex;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 8px;
    line-height: 1.35;
}

.admin-users-checkbox-list input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 1px;
}

.admin-users-edit-actions,
.admin-users-create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.admin-users-create-panel {
    position: sticky;
    top: 84px;
}

.admin-users-create-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 22px 22px;
}

.admin-users-form-note {
    background: rgb(248 250 252);
    border: 1px solid rgb(229 231 235);
    border-radius: 6px;
    padding: 12px 14px;
}

.admin-users-jira-directory {
    padding-bottom: 24px;
}

.admin-users-jira-directory > p,
.admin-users-jira-directory > .admin-users-field,
.admin-users-jira-directory > .jira-directory-results {
    margin-left: 22px;
    margin-right: 22px;
}

.admin-users-jira-directory > p + p {
    margin-top: 10px;
}

.admin-users-jira-directory > .admin-users-field {
    margin-top: 24px;
}

.jira-user-picker {
    position: relative;
}

.jira-suggestions {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    position: absolute;
    width: 100%;
    z-index: 200;
}

.jira-suggestions li {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    padding: 8px 10px;
}

.jira-suggestions li:hover,
.jira-suggestions li.active {
    background: rgb(238 236 255);
}

.jira-suggestions li img {
    border-radius: 999px;
    height: 20px;
    width: 20px;
}

.jira-suggestions li .js-name {
    color: rgb(7 21 48);
    font-size: 0.85rem;
    font-weight: 650;
}

.jira-suggestions li .js-email {
    color: rgb(93 111 143);
    font-size: 0.78rem;
    margin-left: 4px;
}

.jira-suggestions li.jira-suggestions-error,
.jira-directory-error {
    color: rgb(185 28 28);
}

.jira-directory-results {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.jira-directory-empty {
    color: rgb(79 99 133);
    font-size: 0.9rem;
    margin: 0;
}

.jira-directory-card {
    align-items: center;
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 12px 14px;
}

.jira-directory-card-main {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.jira-directory-card-main img {
    border-radius: 999px;
    flex-shrink: 0;
    height: 32px;
    width: 32px;
}

.jira-directory-card-name {
    color: rgb(7 21 48);
    font-size: 0.88rem;
    font-weight: 750;
}

.jira-directory-card-email {
    color: rgb(93 111 143);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.jira-directory-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.app-content:has(> .admin-settings-page) {
    max-width: none;
    padding: 28px 32px 32px;
}

.admin-settings-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0;
}

.admin-settings-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.admin-settings-header h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 8px;
}

.admin-settings-header p,
.admin-settings-section__body > p,
.admin-settings-field small {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.admin-settings-back,
.admin-settings-profile-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.admin-settings-back::before {
    content: "< ";
}

.admin-settings-profile-link {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: inline-flex;
    height: 40px;
    padding: 0 16px;
    white-space: nowrap;
}

.admin-settings-back:hover,
.admin-settings-profile-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.admin-settings-form,
.admin-settings-stack {
    display: flex;
    flex-direction: column;
}

.admin-settings-stack {
    gap: 16px;
}

.admin-settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    overflow: visible;
}

.admin-settings-section.accordion-item--open {
    background: var(--surface);
    border-color: var(--border);
}

.admin-settings-section__header {
    align-items: center;
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    color: var(--text);
    display: flex;
    gap: 12px;
    min-height: 56px;
    padding: 0 20px;
    width: 100%;
}

.admin-settings-section__header:hover {
    background: var(--bg-secondary);
}

.admin-settings-section__title {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    font-size: 16px;
    font-weight: 700;
    gap: 8px;
    min-width: 0;
}

.admin-settings-section__title svg {
    color: var(--primary);
    flex: 0 0 auto;
    height: 16px;
    width: 16px;
}

.admin-settings-section__meta {
    color: var(--text-muted);
    flex: 0 1 auto;
    font-size: 12px;
    font-weight: 400;
    text-align: right;
}

.admin-settings-section__body {
    border-top: 0;
    display: block;
    padding: 20px;
}

.admin-settings-section.accordion-item:not(.accordion-item--open) > .admin-settings-section__body {
    display: none;
}

.admin-settings-section.accordion-item--open > .admin-settings-section__body {
    display: block;
}

.admin-settings-persona-grid,
.admin-settings-field-order-grid {
    display: grid;
    gap: 16px 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.admin-settings-grid-3,
.admin-settings-defaults-grid,
.admin-settings-tripwire-grid {
    display: grid;
    gap: 16px 24px;
    margin-top: 16px;
}

.admin-settings-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-settings-defaults-grid,
.admin-settings-tripwire-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-settings-field--wide {
    margin-top: 16px;
    max-width: 760px;
}

.admin-settings-field > span {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
}

.admin-settings-field .form-input,
.admin-settings-field input[type="text"],
.admin-settings-field input[type="number"],
.admin-settings-field input[type="password"],
.admin-settings-field select {
    font-size: 14px;
    min-height: 40px;
    padding: 0 12px;
}

.admin-settings-field textarea.form-input {
    font-size: 14px;
    min-height: 96px;
    padding: 10px 12px;
    resize: vertical;
}

.admin-settings-actions-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* === AI evaluation samples policy ========================================== */

.admin-settings-section.admin-settings-sample-panel {
    border: 2px solid var(--primary);
    border-radius: 8px;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.admin-settings-section.admin-settings-sample-panel:has(.admin-settings-sample-feature-picker[open]) {
    z-index: 20;
}

.admin-settings-sample-panel .admin-settings-section__body {
    padding: 16px;
}

.admin-settings-sample-panel__heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-settings-sample-panel__title {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 16px;
    font-weight: 700;
    gap: 8px;
    line-height: 1.25;
    margin: 0;
}

.admin-settings-sample-panel__title svg {
    color: var(--primary);
    flex: 0 0 auto;
    height: 16px;
    width: 16px;
}

.admin-settings-sample-panel__heading p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
}

.admin-settings-sample-panel__learn-more {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 5px;
    line-height: 1.3;
    text-decoration: none;
    width: fit-content;
}

.admin-settings-sample-panel__learn-more:hover,
.admin-settings-sample-panel__learn-more:focus-visible {
    color: var(--primary-dark);
    text-decoration: underline;
}

.admin-settings-sample-panel__learn-more svg {
    height: 13px;
    width: 13px;
}

.admin-settings-sample-form {
    margin-top: 12px;
}

.admin-settings-sample-toggle-row {
    min-height: 20px;
}

.admin-settings-sample-toggle {
    align-items: center;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 12px;
    line-height: 1.35;
}

.admin-settings-sample-toggle input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.admin-settings-sample-toggle__track {
    align-items: center;
    background: rgb(203 213 225);
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 18px;
    padding: 2px;
    transition: background-color 0.16s ease;
    width: 32px;
}

.admin-settings-sample-toggle__track span {
    background: var(--surface);
    border-radius: 50%;
    display: block;
    height: 14px;
    transform: translateX(0);
    transition: transform 0.16s ease;
    width: 14px;
}

.admin-settings-sample-toggle input:checked + .admin-settings-sample-toggle__track {
    background: var(--primary);
}

.admin-settings-sample-toggle input:checked + .admin-settings-sample-toggle__track span {
    transform: translateX(14px);
}

.admin-settings-sample-toggle input:focus-visible + .admin-settings-sample-toggle__track {
    outline: 3px solid rgba(79, 70, 229, 0.2);
    outline-offset: 2px;
}

.admin-settings-sample-fields {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 8px;
    overflow: visible;
}

.admin-settings-sample-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 12px;
}

.admin-settings-sample-field + .admin-settings-sample-field {
    border-left: 1px solid var(--border);
}

.admin-settings-sample-field__label {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    line-height: 1.3;
}

.admin-settings-sample-field__info {
    margin-left: 0;
}

.admin-settings-sample-field__info .page-info-btn {
    font-family: var(--font-sans);
    font-style: normal;
    height: 16px;
    width: 16px;
}

.admin-settings-sample-field__info .page-info-popover {
    max-width: min(380px, calc(100vw - 32px));
}

.admin-settings-sample-field__info--right .page-info-popover {
    left: auto;
    right: -8px;
}

.admin-settings-sample-field__info--right .page-info-popover::before {
    left: auto;
    right: 14px;
}

.admin-settings-sample-field > input[type="number"],
.admin-settings-sample-input-suffix {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    height: 34px;
    min-height: 34px;
}

.admin-settings-sample-field > input[type="number"] {
    padding: 0 12px;
    width: 100%;
}

.admin-settings-sample-field > input[type="number"]:focus,
.admin-settings-sample-input-suffix:focus-within,
.admin-settings-sample-feature-picker[open] > summary {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

.admin-settings-sample-field small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
}

.admin-settings-sample-input-suffix {
    align-items: center;
    display: flex;
    overflow: hidden;
    padding-right: 12px;
}

.admin-settings-sample-input-suffix input {
    background: transparent;
    border: 0;
    color: inherit;
    flex: 1 1 auto;
    font: inherit;
    height: 32px;
    min-width: 0;
    outline: 0;
    padding: 0 12px;
}

.admin-settings-sample-input-suffix > span {
    color: var(--text-secondary);
    flex: 0 0 auto;
    font-size: 14px;
}

.admin-settings-sample-feature-picker {
    min-width: 0;
    position: relative;
}

.admin-settings-sample-feature-picker > summary {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 14px;
    height: 34px;
    justify-content: space-between;
    list-style: none;
    min-width: 0;
    padding: 0 12px;
    user-select: none;
}

.admin-settings-sample-feature-picker > summary::-webkit-details-marker {
    display: none;
}

.admin-settings-sample-feature-picker > summary::after {
    border-bottom: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    content: "";
    flex: 0 0 auto;
    height: 6px;
    margin-left: 12px;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.16s ease;
    width: 6px;
}

.admin-settings-sample-feature-picker[open] > summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.admin-settings-sample-feature-picker[open] > summary::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

.admin-settings-sample-feature-picker__options {
    background: var(--surface);
    border: 1px solid var(--primary);
    border-top: 0;
    border-radius: 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    left: 0;
    max-height: min(220px, var(--sample-feature-picker-max-height, 220px));
    overflow-y: auto;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 34px;
    z-index: 300;
}

.admin-settings-sample-feature-picker--opens-up .admin-settings-sample-feature-picker__options {
    border-bottom: 0;
    border-radius: 8px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top: 1px solid var(--primary);
    bottom: 34px;
    top: auto;
}

.admin-settings-sample-feature-picker--opens-up[open] > summary {
    border-radius: 8px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.admin-settings-sample-feature-picker__options label {
    align-items: flex-start;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 13px;
    gap: 8px;
    line-height: 1.35;
    padding: 8px;
}

.admin-settings-sample-feature-picker__option-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-settings-sample-feature-picker__option-copy small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.admin-settings-sample-feature-picker__options label:hover,
.admin-settings-sample-feature-picker__options label:focus-within {
    background: var(--bg-secondary);
}

.admin-settings-sample-feature-picker__options input {
    flex: 0 0 auto;
    margin: 0;
}

.admin-settings-sample-actions {
    display: flex;
    grid-column: 1 / -1;
    margin-top: 0;
    padding: 0 4px 8px;
}

.admin-settings-sample-actions .admin-settings-primary-button {
    font-size: 12px;
    height: 34px;
    padding-left: 8px;
    padding-right: 8px;
}

.admin-settings-sample-panel__security-note {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 12px;
    gap: 6px;
    line-height: 1.35;
    margin: 12px 0 0;
}

.admin-settings-sample-panel__security-note svg {
    flex: 0 0 auto;
    height: 14px;
    width: 14px;
}

.admin-settings-primary-button,
.admin-settings-secondary-button {
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    line-height: 1;
    height: 40px;
    padding: 0 16px;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.admin-settings-primary-button {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--surface);
}

.admin-settings-primary-button:hover,
.admin-settings-primary-button:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--surface);
}

.admin-settings-secondary-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.admin-settings-secondary-button:hover,
.admin-settings-secondary-button:focus-visible {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text);
}

.admin-settings-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.admin-settings-checkbox-list label,
.admin-settings-inline-checkbox {
    align-items: flex-start;
    color: var(--text);
    display: flex;
    font-size: 14px;
    font-weight: 400;
    gap: 8px;
    line-height: 1.45;
}

.admin-settings-checkbox-list input[type="checkbox"],
.admin-settings-inline-checkbox input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 2px;
}

.admin-settings-group-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.admin-settings-field-order-grid .field-sort-list {
    gap: 8px;
}

.admin-settings-field-order-grid .field-sort-item {
    background: var(--surface);
    border-color: var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    min-height: 32px;
    padding: 6px 8px;
}

.admin-settings-field-order-grid .field-sort-handle,
.admin-settings-field-order-grid .field-sort-num {
    color: var(--text-muted);
}

.admin-settings-quality-row {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(260px, 0.45fr) minmax(260px, 0.45fr);
    margin-top: 16px;
}

.admin-settings-slider-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 48px;
}

.admin-settings-slider {
    width: 100%;
}

.admin-settings-slider-output {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.admin-settings-save-row {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.admin-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    text-decoration: none;
}

.admin-card-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.admin-card-count {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.admin-card-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.admin-card-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Seat counter badge */
.seat-counter {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    white-space: nowrap;
}

/* Admin tables */
.user-table,
.team-table {
    width: 100%;
}

.user-table th,
.team-table th {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.user-table tbody td {
    vertical-align: top;
}

/* Admin inline edit form rows */
.admin-inline-form .form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    padding: 0.75rem 0;
}

.admin-inline-form .form-group {
    flex: 1;
    min-width: 140px;
}

/* Team member list */
.team-member-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.team-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.team-member-row:last-child {
    border-bottom: none;
}

/* Persona textarea group */
.persona-editor textarea {
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
}

/* Settings section spacing */
.settings-section .card-body {
    padding: 1.5rem;
}

/* Sidebar divider */
.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 0.75rem 1rem;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
}

.table-responsive--popovers {
    overflow: visible;
}

@media (max-width: 1024px) {
    .table-responsive--popovers {
        overflow-x: auto;
        overflow-y: visible;
    }
}

/* Badge variants */
.badge-primary {
    background: var(--primary);
    color: rgb(255, 255, 255);
}

.badge-success {
    background: var(--success);
    color: rgb(255, 255, 255);
}

.badge-warning {
    background: var(--warning);
    color: rgb(255, 255, 255);
}

.badge-secondary {
    background: var(--secondary);
    color: rgb(255, 255, 255);
}

.badge-muted {
    background: rgb(148, 163, 184);
    color: rgb(255, 255, 255);
}

@media (max-width: 768px) {
    .admin-dashboard-cards,
    .admin-dashboard-subscription__layout {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-card {
        min-height: 0;
    }

    .admin-dashboard-activity__row {
        align-items: flex-start;
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .admin-dashboard-activity__event,
    .admin-dashboard-activity__actor,
    .admin-dashboard-activity__details,
    .admin-dashboard-activity__time {
        grid-column: 2;
    }

    .admin-dashboard-activity__time {
        white-space: normal;
    }

    .admin-cards {
        grid-template-columns: 1fr;
    }

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

    .admin-inline-form .form-group {
        min-width: 100%;
    }
}

@media (max-width: 1180px) {
    .admin-users-layout {
        grid-template-columns: 1fr;
    }

    .admin-users-create-panel {
        position: static;
    }

    .admin-settings-grid-3,
    .admin-settings-defaults-grid,
    .admin-settings-tripwire-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-users-header {
        flex-direction: column;
    }

    .admin-users-header__actions {
        justify-content: flex-start;
        padding-top: 0;
    }

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

    .admin-users-table {
        min-width: 920px;
    }

    .admin-users-edit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-settings-header,
    .admin-settings-section__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-settings-section__header {
        gap: 8px;
        justify-content: center;
        padding-bottom: 14px;
        padding-top: 14px;
    }

    .admin-settings-section__meta {
        text-align: left;
    }

    .admin-settings-persona-grid,
    .admin-settings-field-order-grid,
    .admin-settings-quality-row,
    .admin-settings-sample-fields {
        grid-template-columns: 1fr;
    }

    .admin-settings-sample-field + .admin-settings-sample-field {
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 640px) {
    .admin-users-panel__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        justify-content: center;
        padding-bottom: 16px;
        padding-top: 16px;
    }

    .admin-users-header__actions,
    .admin-users-edit-actions,
    .admin-users-create-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .admin-users-primary-button,
    .admin-users-secondary-button,
    .admin-users-seat-pill {
        width: 100%;
    }

    .admin-users-edit-grid {
        grid-template-columns: 1fr;
    }

    .admin-users-field--wide {
        grid-column: auto;
    }

    .admin-settings-grid-3,
    .admin-settings-defaults-grid,
    .admin-settings-tripwire-grid {
        grid-template-columns: 1fr;
    }

    .admin-settings-profile-link,
    .admin-settings-primary-button,
    .admin-settings-secondary-button {
        width: 100%;
    }

    .admin-settings-sample-panel .admin-settings-section__body {
        padding: 12px;
    }

    .admin-settings-sample-field {
        padding: 12px;
    }

    .admin-settings-save-row {
        justify-content: stretch;
    }
}

/* === Sounding Board ======================================================== */

.sounding-board-modal .modal-content {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 940px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sounding-board-modal .modal-content.modal-lg {
    max-width: 940px;
}

.sb-config {
    flex: 1;
    min-height: 14.5rem;
    padding: 2.5rem 2.5rem 3rem;
}

.sb-config-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sb-config .form-group {
    margin-bottom: 0;
}

.sb-config .form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.sb-modal-footer {
    padding-inline: 2.5rem;
}
.sb-loading {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-light);
}

.sb-loading p {
    margin-bottom: 1rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

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

.sb-results {
    padding: 1.25rem 1.75rem 1.75rem;
    overflow-y: auto;
    max-height: 70vh;
}

.sb-results h4 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    color: var(--text);
}

.persona-result {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.375rem;
    overflow: hidden;
}

.sb-accordion-item {
    display: block;
}

/* Accordion header (replaces .persona-header) */
.sb-accordion-item .sb-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 56px;
    padding: 0.5625rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    text-align: left;
    gap: 0.75rem;
    list-style: none;
}

.sb-accordion-item .sb-accordion-header:hover {
    background: var(--surface-hover, rgba(0,0,0,0.04));
}

.sb-accordion-item .sb-accordion-header::-webkit-details-marker {
    display: none;
}

.sb-accordion-title {
    font-weight: 600;
    font-size: 1rem;
}

.sb-reviewer-title {
    align-items: center;
    display: inline-flex;
    flex: 1 1 auto;
    gap: 0.875rem;
    min-width: 0;
}

.sb-reviewer-avatar {
    align-items: center;
    background: rgba(79, 70, 229, 0.12);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 36px;
    font-size: 0.875rem;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.sb-reviewer-copy {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.sb-reviewer-subtitle {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.3;
}

.sb-accordion-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sb-accordion-meta .badge {
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    min-width: 64px;
    padding: 0.375rem 0.625rem;
    text-align: center;
}

.sb-accordion-meta .persona-status {
    background: rgb(148 163 184);
    color: rgb(255 255 255);
}

.sb-accordion-chevron {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
    display: inline-block;
    transform: rotate(0deg);
    color: var(--text-muted, rgb(102 102 102));
}

.sb-accordion-item[open] .sb-accordion-chevron,
.sb-accordion-item.sb-open .sb-accordion-chevron {
    transform: rotate(90deg);
}

/* Accordion body */
.sb-accordion-body {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
}

.sb-accordion-item[open] .sb-accordion-body,
.sb-accordion-item.sb-open .sb-accordion-body {
    display: block;
}

.persona-response {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.persona-response p {
    margin: 0 0 0.4rem;
}

.persona-response ul,
.persona-response ol {
    margin: 0.25rem 0 0.5rem 1.25rem;
    padding: 0;
}

.persona-response li {
    margin-bottom: 0.2rem;
}

.sb-section-heading {
    font-weight: 600;
    color: var(--text);
    margin: 0.6rem 0 0.2rem;
    font-size: 0.875rem;
}

.persona-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

/* Conclusion panel */
.sb-conclusion {
    background: var(--surface);
    border-color: transparent;
    margin-top: 0.875rem;
}

.sb-conclusion .sb-accordion-header {
    background: rgba(79,70,229,0.07);
    min-height: 40px;
}

.sb-conclusion .sb-accordion-title {
    color: var(--primary, rgb(79, 70, 229));
}

.sb-conclusion-summary {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

.sb-conclusion-hint {
    font-size: 0.8125rem;
    color: var(--text-muted, rgb(102 102 102));
    margin: 0.5rem 0 0;
    font-style: italic;
}

.sb-conclusion .js-sounding-board-apply-recommendations {
    margin-top: 1rem;
    min-width: 292px;
}

.sb-how-it-works {
    align-items: flex-start;
    background: rgba(79, 70, 229, 0.04);
    border: 1px solid rgba(79, 70, 229, 0.28);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
}

.sb-how-it-works__icon {
    align-items: center;
    border: 2px solid var(--primary);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 22px;
    font-size: 0.875rem;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    margin-top: 0.125rem;
    width: 22px;
}

.sb-how-it-works h4 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.25rem;
}

.sb-how-it-works p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0;
}

.confirmation-modal,
.sb-apply-confirmation {
    background: rgba(15, 23, 42, 0.64);
    z-index: 1000;
}

.confirmation-modal__dialog,
.sb-apply-confirmation__dialog {
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 42px 1fr;
    max-width: min(560px, calc(100vw - 32px));
    min-height: 208px;
    padding: 28px;
    width: 100%;
}

.confirmation-modal__icon,
.sb-apply-confirmation__icon {
    color: rgb(234 88 12);
    height: 38px;
    position: relative;
    width: 38px;
    z-index: 0;
}

.confirmation-modal__icon::before,
.sb-apply-confirmation__icon::before {
    border-bottom: 36px solid rgb(234 88 12);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    content: "";
    left: -1px;
    position: absolute;
    top: 0;
    z-index: -2;
}

.confirmation-modal__icon::after,
.sb-apply-confirmation__icon::after {
    border-bottom: 29px solid var(--surface);
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    content: "";
    left: 3px;
    position: absolute;
    top: 5px;
    z-index: -1;
}

.confirmation-modal__icon-mark {
    color: rgb(234 88 12);
    font-size: 1rem;
    font-weight: 700;
    left: 50%;
    line-height: 1;
    position: absolute;
    top: 19px;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.confirmation-modal__content,
.sb-apply-confirmation__content {
    min-width: 0;
}

.confirmation-modal__header,
.sb-apply-confirmation__header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.confirmation-modal__header h3,
.sb-apply-confirmation__header h3 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.confirmation-modal__close,
.sb-apply-confirmation__close {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 32px;
    font-size: 1.75rem;
    height: 32px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 32px;
}

.confirmation-modal__message,
.sb-apply-confirmation__message {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

.confirmation-modal__message p,
.sb-apply-confirmation__message p {
    margin: 0 0 1.25rem;
}

.confirmation-modal__message p:last-child,
.sb-apply-confirmation__message p:last-child {
    margin-bottom: 0;
}

.confirmation-modal__actions,
.sb-apply-confirmation__actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.confirmation-modal__actions .btn,
.sb-apply-confirmation__actions .btn {
    min-height: 40px;
    min-width: 96px;
}

/* === Board Review =========================================================== */

.br-modal .modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.br-config {
    padding: 1.5rem;
}

.br-config .form-group {
    margin-bottom: 1rem;
}

.br-config .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.br-loading {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-light);
}

.br-loading p {
    margin-bottom: 1rem;
}

.br-results {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 70vh;
}

.br-results h4 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    color: var(--text);
}

.br-conversation-list {
    margin-bottom: 1.5rem;
}

.br-turn {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}

.br-turn:last-child {
    border-bottom: none;
}

.br-speaker {
    min-width: 6rem;
    color: var(--primary);
    font-size: 0.875rem;
    padding-top: 0.125rem;
}

.br-message {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

.br-recommendation {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.br-recommendation h4 {
    margin: 0 0 0.75rem;
}

.br-recommendation p {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.br-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.br-responded {
    padding: 2rem 1.5rem;
    text-align: center;
}

.br-response-msg {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    color: var(--text);
}

.story-modal {
    max-width: 760px;
}

.story-ai-size-reasoning {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.git-links-section {
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
    padding-top: 1.25rem;
}

.git-links-section__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.git-links-section__title {
    color: var(--text-muted, rgb(107, 114, 128));
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.git-links-section__loading {
    color: var(--text-muted, rgb(107, 114, 128));
    font-size: 0.8rem;
}

.git-links-section__list {
    margin-bottom: 0.75rem;
}

.git-links-section__form {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.git-links-section__input {
    flex: 1;
    font-size: 0.8125rem;
}

.git-links-section__error {
    color: var(--danger, rgb(220 53 69));
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.onboarding-dot {
    background: var(--border);
    border-radius: 50%;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.onboarding-dot--active {
    background: var(--primary);
}

.onboarding-modal {
    align-items: center;
    backdrop-filter: blur(4px);
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 2000;
}

.onboarding-card {
    margin: 0;
    max-width: 620px;
    width: 90%;
}

.onboarding-card-body {
    padding: 2rem;
}

.onboarding-hero,
.onboarding-finish {
    text-align: center;
}

.onboarding-hero {
    margin-bottom: 1.5rem;
}

.onboarding-hero-icon {
    align-items: center;
    background: linear-gradient(135deg, rgb(79, 70, 229), rgb(99, 102, 241));
    border-radius: 16px;
    display: inline-flex;
    height: 72px;
    justify-content: center;
    margin-bottom: 1rem;
    width: 72px;
}

.onboarding-finish-icon {
    align-items: center;
    background: rgb(209, 250, 229);
    border-radius: 50%;
    display: inline-flex;
    height: 64px;
    justify-content: center;
    margin-bottom: 1rem;
    width: 64px;
}

.onboarding-title {
    font-size: 1.35rem;
    margin: 0 0 1rem;
}

.onboarding-title--welcome {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.onboarding-copy--intro {
    font-size: 0.95rem;
    margin: 0;
}

.onboarding-role-card {
    background: rgb(248 250 252);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
}

.onboarding-role-copy {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.onboarding-copy--section {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.onboarding-list {
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.onboarding-list-item {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.onboarding-step-badge {
    align-items: center;
    display: inline-flex;
    height: 24px;
    justify-content: center;
    padding: 0;
    width: 24px;
}

.onboarding-copy--jira {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.onboarding-jira-list {
    font-size: 0.875rem;
    line-height: 1.8;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.onboarding-copy--small {
    font-size: 0.85rem;
    margin: 0;
}

.onboarding-copy--finish {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 440px;
}

.onboarding-copy--tiny {
    font-size: 0.8rem;
    margin: 0;
}

.onboarding-nav {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.25rem;
}

.onboarding-step-indicator {
    display: flex;
    gap: 0.4rem;
}

.kr-editor-title {
    color: rgb(55, 65, 81);
    font-size: 0.875rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.kr-editor-title-note {
    color: rgb(107, 114, 128);
    font-size: 0.8rem;
    font-weight: 400;
}

.kr-editor-table {
    border-collapse: collapse;
    font-size: 0.8rem;
    width: 100%;
}

.kr-editor-head-row {
    border-bottom: 1px solid rgb(229, 231, 235);
    color: rgb(107, 114, 128);
}

.kr-editor-head {
    padding: 4px 6px;
    text-align: left;
}

.kr-editor-head--title {
    width: 35%;
}

.kr-editor-head--number {
    width: 15%;
}

.kr-editor-head--unit,
.kr-editor-head--status {
    width: 10%;
}

.kr-editor-head--actions {
    width: 30px;
}

.kr-editor-row {
    border-bottom: 1px solid rgb(243, 244, 246);
}

.kr-editor-cell {
    padding: 4px 6px;
}

.kr-editor-cell--actions {
    text-align: center;
}

.kr-editor-input,
.kr-editor-select {
    border: 1px solid rgb(209 213 219);
    border-radius: 4px;
    padding: 3px 6px;
    width: 100%;
}

.kr-editor-select {
    padding: 3px 4px;
}

.kr-editor-delete {
    background: none;
    border: none;
    color: rgb(239, 68, 68);
    cursor: pointer;
    font-size: 1rem;
}

.kr-editor-actions {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.kr-editor-add,
.kr-editor-save {
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 12px;
}

.kr-editor-add {
    background: none;
    border: 1px dashed rgb(199 210 254);
    color: rgb(99, 102, 241);
}

.kr-editor-save {
    background: rgb(99, 102, 241);
    border: none;
    color: rgb(255, 255, 255);
}

.kr-editor-status {
    color: rgb(107, 114, 128);
    font-size: 0.75rem;
}

.home-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.home-dashboard__header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
}

.home-subtitle {
    margin: 8px 0 0;
}

.home-metrics {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-metric-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    gap: 14px;
    min-height: 126px;
    padding: 22px;
}

.home-metric-icon,
.home-start-icon,
.home-document-icon,
.home-activity-icon,
.home-pro-tip__icon {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
}

.home-metric-icon {
    height: 56px;
    width: 56px;
}

.home-metric-icon--purple,
.home-metric-icon--violet {
    background: var(--home-purple-bg);
    color: var(--primary);
}

.home-metric-icon--green {
    background: var(--home-green-bg);
    color: var(--success);
}

.home-metric-icon--blue {
    background: var(--home-blue-bg);
    color: var(--info);
}

.home-metric-icon--orange {
    background: var(--home-orange-bg);
    color: var(--warning);
}

.home-metric-copy {
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    font-size: 14px;
    gap: 6px;
}

.home-metric-copy strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.home-metric-value {
    color: var(--text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.home-dashboard__grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.9fr);
}

.home-dashboard__grid--lower {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.home-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.home-panel__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.home-panel__header h2 {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.home-panel__header h2 span {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 400;
}

.home-panel__header a,
.home-link-action {
    align-items: center;
    color: var(--home-link);
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    gap: 6px;
    text-decoration: none;
}

.home-panel__header a svg,
.home-link-action svg {
    height: 16px;
    width: 16px;
}

.home-project-list,
.home-document-list,
.home-activity-list,
.home-start-list {
    display: flex;
    flex-direction: column;
}

.home-project-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1fr) auto;
    min-height: 92px;
    padding: 14px 0;
}

.home-project-row:first-child {
    padding-top: 4px;
}

.home-project-row:last-child {
    border-bottom: 0;
}

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

.home-project-title-row h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.home-project-name-link {
    color: var(--text);
    text-decoration: none;
}

.home-project-name-link:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.home-project-date {
    color: var(--text-light);
    font-size: 13px;
}

.home-project-progress {
    align-items: center;
    display: flex;
    gap: 18px;
    min-width: 0;
    overflow: hidden;
}

.home-project-progress-bars {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 6px;
}

.home-step-bar {
    background: var(--border);
    border-radius: 999px;
    display: inline-block;
    height: 4px;
    width: 18px;
}

.home-step-bar--done {
    background: var(--success);
}

.home-step-meta {
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    font-size: 13px;
    line-height: 1.2;
    min-width: 0;
}

.home-step-meta small {
    color: var(--text-light);
    font-size: 12px;
    max-width: 132px;
    overflow-wrap: normal;
}

.home-project-actions {
    justify-self: end;
}

.home-project-actions .row-actions-toggle {
    background: var(--surface);
    border-color: var(--border);
    height: 34px;
    width: 34px;
}

.home-project-actions .row-actions-dropdown {
    min-width: 154px;
}

.home-start-item {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 16px;
    grid-template-columns: auto 1fr auto;
    min-height: 62px;
    padding: 12px 16px;
    text-decoration: none;
}

.home-start-item + .home-start-item {
    margin-top: 10px;
}

.home-start-item > svg {
    color: var(--text-secondary);
    height: 18px;
    width: 18px;
}

.home-start-icon {
    border-radius: 8px;
    height: 36px;
    width: 36px;
}

.home-start-icon--purple {
    background: var(--home-purple-bg);
    color: var(--primary);
}

.home-start-icon--green {
    background: var(--home-green-bg);
    color: var(--success);
}

.home-start-item strong,
.home-document-row strong,
.home-activity-row strong {
    color: var(--text);
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.home-start-item small,
.home-document-row small,
.home-activity-row small {
    color: var(--text-light);
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.home-panel--getting-started .home-link-action {
    margin-top: 16px;
}

.home-document-row,
.home-activity-row {
    align-items: center;
    display: grid;
    gap: 14px;
    padding: 12px 0;
}

.home-document-row {
    border-bottom: 1px solid var(--border);
    grid-template-columns: auto 1fr auto;
}

.home-document-row:last-child,
.home-activity-row:last-child {
    border-bottom: 0;
}

.home-document-icon {
    background: var(--home-green-bg);
    border-radius: 8px;
    color: var(--success);
    height: 34px;
    width: 34px;
}

.home-status-pill {
    background: var(--home-green-bg-strong);
    border-radius: 8px;
    color: var(--home-success-text);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
}

.home-activity-row {
    grid-template-columns: auto 1fr auto;
}

.home-activity-icon {
    border-radius: 999px;
    height: 34px;
    width: 34px;
}

.home-activity-icon--success {
    background: var(--home-green-bg);
    color: var(--success);
}

.home-activity-icon--primary {
    background: var(--primary-light);
    color: var(--info);
}

.home-activity-icon--warning {
    background: var(--home-orange-bg);
    color: var(--warning);
}

.home-activity-icon--neutral {
    background: var(--bg-secondary);
    color: var(--text-light);
}

.home-activity-row time {
    align-self: start;
    color: var(--text-light);
    font-size: 12px;
    white-space: nowrap;
}

.home-project-search {
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    max-width: 260px;
    padding: 8px 12px;
}

.home-empty-state,
.home-empty-compact {
    color: var(--text-light);
    padding: 24px 0;
}

.home-empty-title {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.home-empty-copy {
    font-size: 14px;
}

.home-pro-tip {
    align-items: center;
    background: var(--home-pro-tip-bg);
    border: 1px solid var(--home-pro-tip-border);
    border-radius: 8px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    min-height: 54px;
    padding: 0 18px;
}

.home-pro-tip__icon {
    color: var(--success);
    height: 28px;
    width: 28px;
}

.home-pro-tip strong {
    color: var(--home-success-text);
}

.home-pro-tip kbd {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-secondary);
    font: inherit;
    padding: 2px 8px;
}

.home-pro-tip button {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    margin-left: auto;
}

.home-project-modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 1000;
}

.home-project-modal-card {
    margin: 0;
    max-width: 520px;
    width: 90%;
}

.home-modal-title {
    margin: 0;
}

.home-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

.home-modal-actions {
    margin-top: 1rem;
}

@media (max-width: 1280px) {
    .home-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-dashboard__grid,
    .home-dashboard__grid--lower {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .home-dashboard__header,
    .home-project-progress,
    .home-pro-tip {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-metrics {
        grid-template-columns: 1fr;
    }

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

    .home-project-actions {
        justify-self: start;
    }
}

.audit-log-filter {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.audit-log-filter-label {
    font-weight: 600;
}

.audit-log-filter-select {
    max-width: 220px;
}

.audit-log-filter-select--wide {
    max-width: 250px;
}

.audit-log-count {
    font-size: 0.85rem;
    margin-left: auto;
}

.audit-log-table-wrap {
    overflow-x: auto;
}

.audit-log-table-wrap--flush {
    padding: 0;
}

.audit-log-empty {
    color: rgb(102 102 102);
    padding: 1rem;
}

.audit-log-table {
    border-collapse: collapse;
    width: 100%;
}

.audit-log-head {
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.75rem;
    text-align: left;
    text-transform: uppercase;
}

.audit-log-row {
    border-bottom: 1px solid var(--border);
}

.audit-log-cell {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

.audit-log-cell--time {
    font-size: 0.85rem;
    white-space: nowrap;
}

.audit-log-cell--user {
    font-size: 0.85rem;
}

.audit-log-cell--user-large {
    font-size: 0.9rem;
}

.audit-log-cell--mono {
    font-family: monospace;
    font-size: 0.8rem;
}

.audit-log-cell--mono-large {
    font-size: 0.85rem;
}

.audit-log-cell--details {
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-log-cell--details-sm {
    font-size: 0.85rem;
    max-width: 300px;
}

.audit-log-badge {
    font-size: 0.75rem;
}

.audit-log-email {
    color: rgb(136 136 136);
}

.audit-log-fallback {
    color: rgb(153 153 153);
}

.app-content:has(> .admin-audit-page) {
    max-width: none;
}

.admin-audit-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0 0 28px;
}

.admin-audit-header {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.admin-audit-header h1 {
    color: rgb(7 21 48);
    font-size: 1.62rem;
    font-weight: 750;
    line-height: 1.18;
    margin: 0 0 10px;
}

.admin-audit-back {
    color: rgb(79 70 229);
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.admin-audit-back::before {
    content: "< ";
}

.admin-audit-back:hover,
.admin-audit-back:focus-visible {
    color: rgb(49 46 129);
    text-decoration: none;
}

.admin-audit-primary-button,
.admin-audit-secondary-button {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 750;
    gap: 6px;
    justify-content: center;
    line-height: 1;
    min-height: 36px;
    padding: 0 14px;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.admin-audit-primary-button {
    background: rgb(79 70 229);
    border: 1px solid rgb(79 70 229);
    color: rgb(255 255 255);
}

.admin-audit-primary-button:hover,
.admin-audit-primary-button:focus-visible {
    background: rgb(67 56 202);
    border-color: rgb(67 56 202);
    color: rgb(255 255 255);
    text-decoration: none;
}

.admin-audit-secondary-button {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    color: rgb(7 21 48);
}

.admin-audit-secondary-button:hover,
.admin-audit-secondary-button:focus-visible {
    background: rgb(248 250 252);
    border-color: rgb(188 201 221);
    color: rgb(7 21 48);
    text-decoration: none;
}

.admin-audit-secondary-button--compact {
    min-height: 34px;
    padding: 0 12px;
}

.admin-audit-alert {
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 650;
    padding: 12px 14px;
}

.admin-audit-alert--danger {
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
    color: rgb(185 28 28);
}

.admin-audit-alert--success {
    background: rgb(240 253 244);
    border-color: rgb(187 247 208);
    color: rgb(21 128 61);
}

.admin-audit-filter-panel,
.admin-audit-table-panel {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    overflow: hidden;
}

.admin-audit-evidence-header {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 24px 26px 18px;
}

.admin-audit-evidence-header h2 {
    color: rgb(7 21 48);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.admin-audit-evidence-header p,
.admin-audit-evidence-note {
    color: rgb(79 99 133);
    font-size: 0.875rem;
    margin: 0;
}

.admin-audit-evidence-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.admin-audit-evidence-grid {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0;
    padding: 0 26px 18px;
}

.admin-audit-evidence-grid div {
    border-top: 1px solid rgb(226 232 240);
    padding: 14px 12px 0 0;
}

.admin-audit-evidence-grid dt {
    color: rgb(79 99 133);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-audit-evidence-grid dd {
    color: rgb(7 21 48);
    font-size: 1rem;
    font-weight: 600;
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.admin-audit-evidence-note {
    padding: 0 26px 12px;
}

.admin-audit-evidence-note:last-child {
    padding-bottom: 24px;
}

.admin-audit-filter-form {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: auto minmax(220px, 260px) auto minmax(88px, 110px) auto 1fr;
    padding: 24px 26px;
}

.admin-audit-filter-form label {
    color: rgb(7 21 48);
    font-size: 0.9rem;
    font-weight: 750;
}

.admin-audit-total {
    color: rgb(79 99 133);
    font-size: 0.9rem;
    justify-self: end;
}

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

.admin-audit-table {
    border-collapse: collapse;
    min-width: 1120px;
    width: 100%;
}

.admin-audit-table th,
.admin-audit-table td {
    border-bottom: 1px solid rgb(226 232 240);
    padding: 16px 22px;
    text-align: left;
    vertical-align: middle;
}

.admin-audit-table th {
    background: rgb(248 250 252);
    color: rgb(79 99 133);
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-audit-time,
.admin-audit-ip,
.admin-audit-details {
    color: rgb(7 21 48);
    font-size: 0.86rem;
}

.admin-audit-time,
.admin-audit-ip {
    white-space: nowrap;
}

.admin-audit-details {
    max-width: 520px;
}

.admin-audit-user {
    display: grid;
    gap: 3px;
}

.admin-audit-user strong {
    color: rgb(7 21 48);
    font-size: 0.86rem;
}

.admin-audit-user span {
    color: rgb(79 99 133);
    font-size: 0.8rem;
}

.admin-audit-badge {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 750;
    gap: 8px;
    justify-content: center;
    line-height: 1;
    min-height: 32px;
    padding: 0 12px;
}

.admin-audit-badge span {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.62rem;
    height: 16px;
    justify-content: center;
    width: 16px;
}

.admin-audit-badge--success {
    background: rgb(220 252 231);
    border: 1px solid rgb(187 247 208);
    color: rgb(5 150 105);
}

.admin-audit-badge--neutral {
    background: rgb(241 245 249);
    border: 1px solid rgb(226 232 240);
    color: rgb(79 99 133);
}

.admin-audit-badge--warning {
    background: rgb(255 237 213);
    border: 1px solid rgb(253 186 116);
    color: rgb(194 65 12);
}

.admin-audit-badge--danger {
    background: rgb(254 242 242);
    border: 1px solid rgb(254 202 202);
    color: rgb(185 28 28);
}

.admin-audit-empty {
    color: rgb(79 99 133);
    font-size: 0.9rem;
    margin: 0;
    padding: 24px 26px;
}

.admin-audit-pagination {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr auto auto;
    padding: 20px 24px;
}

.admin-audit-pagination > span {
    color: rgb(79 99 133);
    font-size: 0.84rem;
}

.admin-audit-per-page {
    align-items: center;
    display: flex;
    gap: 8px;
}

.admin-audit-per-page select {
    min-width: 150px;
}

.admin-audit-pages {
    align-items: center;
    display: flex;
    gap: 7px;
}

.admin-audit-pages a,
.admin-audit-pages span {
    align-items: center;
    border: 1px solid rgb(215 225 239);
    border-radius: 6px;
    color: rgb(7 21 48);
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 750;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    padding: 0 10px;
    text-decoration: none;
}

.admin-audit-pages span {
    border-color: transparent;
    color: rgb(79 99 133);
}

.admin-audit-pages a.is-active {
    background: rgb(79 70 229);
    border-color: rgb(79 70 229);
    color: rgb(255 255 255);
}

.admin-audit-pages a.is-disabled {
    color: rgb(148 163 184);
    pointer-events: none;
}

@media (max-width: 940px) {
    .admin-audit-header,
    .admin-audit-filter-form,
    .admin-audit-pagination {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .admin-audit-header {
        flex-direction: column;
    }

    .admin-audit-total {
        justify-self: start;
    }

    .admin-audit-evidence-header {
        display: grid;
    }

    .admin-audit-evidence-actions {
        justify-content: flex-start;
    }

    .admin-audit-evidence-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-audit-pages {
        flex-wrap: wrap;
    }
}

.invoice-admin-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
}

.invoice-admin-actions {
    display: flex;
    gap: 0.5rem;
}

.invoice-admin-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr 120px 100px;
    margin-bottom: 1rem;
}

.invoice-admin-form-group {
    margin: 0;
}

.invoice-admin-form-group--grow {
    flex: 1;
}

.invoice-admin-required {
    color: var(--danger);
}

.invoice-admin-form-row {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
}

.invoice-admin-optional {
    font-weight: 400;
}

.invoice-admin-submit {
    white-space: nowrap;
}

.invoice-admin-help {
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

.invoice-admin-due--warning {
    color: var(--danger);
    font-weight: 600;
}

.invoice-admin-card-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.invoice-admin-empty {
    padding: 3rem;
    text-align: center;
}

.invoice-admin-empty-copy {
    margin-bottom: 1rem;
}

.story-rules-copy {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.story-rules-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
    margin-top: 1.5rem;
}

.story-rules-empty {
    color: rgb(156, 163, 175);
    font-size: 0.875rem;
}

.story-rules-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.story-rules-item {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.story-rules-default {
    border: 1px solid rgb(199 210 254);
    border-radius: 999px;
    color: rgb(99, 102, 241);
    font-size: 0.7rem;
    margin-left: 6px;
    padding: 1px 7px;
}

.story-rules-remove {
    background: none;
    border: none;
    color: rgb(239, 68, 68);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}

.story-rules-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.story-rules-input {
    border: 1px solid var(--border);
    border-radius: 4px;
    flex: 1;
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem;
}

.story-rules-label {
    font-size: 0.875rem;
}

.team-admin-form-group-end {
    align-self: flex-end;
}

.team-admin-title {
    margin: 0;
}

.team-admin-badge {
    font-weight: normal;
    margin-left: 0.25rem;
}

.team-admin-badge--first {
    margin-left: 0.5rem;
}

.team-admin-description {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.team-admin-edit {
    background: rgb(254 252 232);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
}

.team-admin-body {
    flex-wrap: wrap;
}

.team-admin-members {
    flex: 2;
    min-width: 250px;
}

.team-admin-add-member {
    flex: 1;
    min-width: 200px;
}

.team-admin-section-title {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.team-admin-empty-copy {
    font-size: 0.875rem;
}

.team-admin-member-email {
    font-size: 0.8rem;
}

.team-admin-capacity {
    font-size: 0.8125rem;
}

.wi-modal {
    max-width: 920px;
}

.wi-modal-sizing-select {
    max-width: 160px;
}

.wi-modal-sizing-input {
    max-width: 120px;
}

.modal-inline-control {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.modal-detail,
.wi-modal-detail {
    border: 1px solid rgb(209, 213, 219);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.modal-detail--success,
.wi-modal-detail--success {
    background: rgb(236, 253, 245);
    border-color: rgb(167, 243, 208);
}

.modal-detail--primary,
.wi-modal-detail--primary {
    background: rgb(245, 243, 255);
    border-color: rgb(196, 181, 253);
}

.modal-summary,
.wi-modal-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 0.75rem;
    justify-content: space-between;
    list-style: none;
    padding: 0.85rem 1rem;
    user-select: none;
}

.modal-summary--success,
.wi-modal-summary--success {
    color: rgb(5, 122, 85);
}

.modal-summary--primary,
.wi-modal-summary--primary {
    color: var(--primary);
}

.modal-summary-note,
.modal-summary-chevron,
.wi-modal-summary-note,
.wi-modal-summary-chevron {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 400;
}

.modal-summary-note,
.wi-modal-summary-note {
    font-size: 0.9rem;
}

.modal-detail-body,
.wi-modal-detail-body {
    background: rgba(255, 255, 255, 0.72);
    padding: 0 1rem 1rem;
}

.modal-detail-input,
.modal-detail-textarea,
.wi-modal-detail-input,
.wi-modal-detail-textarea {
    background: var(--surface);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 8px;
    font-size: 0.92rem;
    padding: 0.7rem 0.9rem;
    width: 100%;
}

.modal-detail-textarea,
.wi-modal-detail-textarea {
    font-family: inherit;
    resize: vertical;
}

.prio-page-toolbar,
.prio-page-actions {
    flex-wrap: wrap;
    gap: 1rem;
}

.prio-page-framework-label {
    margin-bottom: 0;
    white-space: nowrap;
}

.prio-page-framework-select {
    min-width: 120px;
    width: auto;
}

.prio-page-framework-list {
    list-style: disc;
    padding-left: 1.25rem;
}

.prio-page-framework-list--spaced {
    margin-bottom: 1.25rem;
}

.prio-page-formula {
    font-size: 0.8125rem;
}

.prio-page-table-wrap {
    max-height: calc(100vh - 260px);
    overflow-x: hidden;
    padding: 0;
}

.prio-page-table {
    width: 100%;
}

.prio-page-col-rank {
    width: 32px;
}

.prio-page-col-score {
    text-align: center;
    width: 68px;
}

.prio-page-col-final {
    background: var(--bg, rgb(255, 255, 255));
    position: sticky;
    right: 0;
    text-align: center;
    width: 58px;
    z-index: 1;
}

.prio-page-empty {
    padding: 3rem;
}

.prio-page-empty-copy {
    font-size: 1.125rem;
}

.superadmin-test-ai-result {
    font-size: 0.875rem;
}

.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-accordion-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    margin-right: 0.5rem;
}

.settings-intro {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.settings-grid-2 {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr 1fr;
}

.settings-grid-2-wide {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
}

.settings-flex-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}


.settings-defaults-row-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.settings-flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.settings-field-flex {
    flex: 1;
    min-width: 180px;
}

.settings-field-flex-lg {
    flex: 1;
    min-width: 200px;
}

.settings-inline-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.settings-inline-muted-strong {
    color: var(--text-muted);
    font-weight: 400;
}

.settings-inline-help {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0 0 0.75rem;
}

.settings-inline-help-note {
    color: rgb(148, 163, 184);
    font-size: 0.75rem;
}

.settings-save-row {
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
}

.settings-input-width-xs {
    max-width: 100px;
}

.settings-input-width-sm {
    max-width: 120px;
}

.field-sort-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.field-sort-item {
    align-items: center;
    background: var(--bg, rgb(255, 255, 255));
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: grab;
    display: flex;
    font-size: 0.875rem;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    transition: box-shadow 100ms ease, background 100ms ease;
    user-select: none;
}

.field-sort-item:active {
    cursor: grabbing;
}

.field-sort-item.drag-over {
    background: rgba(79, 70, 229, 0.04);
    border-color: var(--primary);
}

.field-sort-item.dragging {
    opacity: 0.4;
}

.field-sort-handle {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}

.field-sort-num {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 0.75rem;
    text-align: right;
    width: 1.25rem;
}

.settings-field-sort-heading {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    margin-bottom: 0.625rem;
    text-transform: uppercase;
}

.settings-quality-toggle {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.settings-quality-toggle-label {
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}

.settings-quality-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.settings-slider-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.settings-slider {
    flex: 1;
}

.settings-slider-output {
    font-size: 1rem;
    font-weight: 700;
    min-width: 3rem;
}

.settings-checkbox-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.settings-checkbox-label {
    cursor: pointer;
    font-weight: 400;
}

.settings-checkbox-card-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
}

.settings-checkbox-card {
    align-items: flex-start;
    background: rgb(249, 250, 251);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
}

.settings-checkbox-card__input {
    flex-shrink: 0;
    height: 16px;
    margin-top: 3px;
    width: 16px;
}

.settings-checkbox-card__title {
    font-size: 0.875rem;
    font-weight: 600;
}

.settings-checkbox-card__desc {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.settings-provider-grid {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr 1fr;
}

.settings-metric-grid {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: grid;
    gap: 0.45rem 0.75rem;
    grid-template-columns: 1fr auto;
    padding: 0.75rem;
}

.settings-metric-grid span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.settings-metric-grid strong {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.settings-hidden-panel {
    display: none;
}

.settings-readonly-input {
    background: var(--bg-muted, rgb(248 250 252));
    cursor: default;
    font-family: monospace;
}

.settings-divider-row {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

.settings-grid-4 {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(4, 1fr);
}

.settings-inline-currency-row {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.settings-input-width-md {
    width: 110px;
}

.settings-rates-grid {
    align-items: center;
    display: grid;
    gap: 0 1.5rem;
    grid-template-columns: 180px 1fr;
    max-width: 600px;
}

.settings-rates-label {
    border-bottom: 1px solid var(--border);
    margin: 0;
    padding: 0.625rem 0;
}

.settings-rates-cell {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

.settings-rates-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.settings-rates-subtext {
    color: var(--text-muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
}

.settings-rates-per-month {
    color: rgb(107, 114, 128);
    font-size: 0.78rem;
}

.settings-callout {
    background: rgb(248 250 252);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 1rem;
    max-width: 600px;
    padding: 0.75rem 1rem;
}

.billing-overview {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 1.5rem;
}

.billing-overview--ai {
    grid-template-columns: repeat(3, 1fr);
}

.billing-overview .card + .card,
.billing-detail .card + .card {
    margin-top: 0;
}

.billing-stat {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.billing-stat-label {
    color: rgb(148, 163, 184);
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.billing-stat-value {
    color: rgb(30, 41, 59);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.billing-stat-sub {
    color: rgb(100, 116, 139);
    font-size: 0.78rem;
    min-height: 1.2em;
    text-align: center;
    width: 100%;
}

.billing-stat-topup {
    margin-top: 0.9rem;
}

.btn.billing-stat-topup {
    display: inline-flex;
}

.billing-stat-topup .btn {
    min-width: 126px;
}

.billing-stat-subnote-danger {
    color: var(--danger);
    display: block;
    font-size: 0.75rem;
    margin-top: 2px;
}

.billing-seat-meter {
    background: var(--border);
    border-radius: 4px;
    margin-bottom: 4px;
    width: 100%;
}

.billing-seat-meter__progress {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    display: block;
    height: 5px;
    width: 100%;
}

.billing-seat-meter__progress::-webkit-progress-bar {
    background: var(--border);
    border-radius: 4px;
}

.billing-seat-meter__progress::-webkit-progress-value {
    border-radius: 4px;
}

.billing-seat-meter__progress::-moz-progress-bar {
    border-radius: 4px;
}

.billing-seat-meter__progress--primary {
    accent-color: var(--primary);
}

.billing-seat-meter__progress--warning {
    accent-color: rgb(240 173 78);
}

.billing-seat-meter__progress--danger {
    accent-color: var(--danger);
}

.billing-stat-value-subtle {
    font-size: 0.85rem;
    font-weight: 400;
}

.billing-detail {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 2rem;
}

.billing-table {
    border-collapse: collapse;
    width: 100%;
}

.billing-table__row {
    border-bottom: 1px solid var(--border);
}

.billing-table__row--muted td {
    color: var(--text-muted);
    font-size: 0.875rem;
}


.billing-table__row--header {
    border-bottom: 2px solid var(--border);
}

.billing-table__cell {
    padding: 0.75rem 1.25rem;
}

.billing-table__cell--compact {
    padding: 0.6rem 1.25rem;
}

.billing-table__cell--y-only {
    padding: 0.6rem 0;
}

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

.billing-table__cell--strong {
    font-weight: 600;
}

.billing-table__cell--center {
    text-align: center;
}

.billing-table__cell--right {
    text-align: right;
}

.billing-table__cell--top {
    vertical-align: top;
}

.billing-table__heading {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.billing-table__heading--blank {
    width: 1%;
}

.billing-table__org-col {
    width: 40%;
}

.billing-manage-copy {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.billing-manage-copy--tight {
    margin-bottom: 0.75rem;
}

.billing-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.billing-action-link {
    text-align: center;
    width: 100%;
}

.billing-next-invoice {
    background: rgb(239 246 255);
    border: 1px solid rgb(191 219 254);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
}

.billing-next-invoice__label {
    color: rgb(29 78 216);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.billing-next-invoice__date {
    color: rgb(30 64 175);
    font-size: 1.25rem;
    font-weight: 800;
}

.billing-next-invoice__meta {
    color: rgb(37 99 235);
    font-size: 0.85rem;
    margin-top: 4px;
}

.billing-help-copy {
    font-size: 0.85rem;
}

.billing-help-copy--small {
    font-size: 0.8rem;
}

.billing-purchase-copy {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.billing-inline-row {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.billing-inline-form {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.billing-inline-form .form-control {
    box-sizing: border-box;
    min-height: 2.5rem;
    width: 100%;
}

.billing-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.billing-form-grid--compact {
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.billing-field-label {
    color: var(--text-muted);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.billing-seat-input {
    width: 110px;
}

.billing-seat-preview {
    color: rgb(37 99 235);
    font-size: 0.875rem;
    padding-bottom: 0.5rem;
}

.billing-alert-danger {
    color: var(--danger);
    font-size: 0.875rem;
}

.billing-card-body--flush {
    padding: 0;
}

.billing-line-item-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.billing-line-item-subtitle {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.billing-total-row {
    background: rgb(249, 250, 251);
}

.billing-total-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.billing-total-value {
    color: rgb(30, 41, 59);
    font-size: 1.1rem;
    font-weight: 800;
}

.billing-contact-copy {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.billing-contact-input--name {
    min-width: 220px;
}

.billing-contact-input--email {
    min-width: 260px;
}

.billing-header-actions {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.billing-card-header--split {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.billing-card-title-reset {
    margin: 0;
}

.billing-xero-badge {
    font-size: 0.82rem;
    padding: 4px 10px;
}

.billing-empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1.25rem;
}

.billing-status-note-danger {
    color: var(--danger);
    font-size: 0.75rem;
    margin-left: 0.4rem;
}

.billing-status-note-success {
    color: rgb(34 197 94);
    font-size: 0.8rem;
    font-weight: 600;
}

.billing-pdf-link {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 0.75rem;
}

.billing-actions-cell {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .billing-overview {
        grid-template-columns: 1fr;
    }

    .billing-form-grid--compact {
        grid-template-columns: 1fr;
    }
}

.app-content:has(> .admin-billing-page) {
    max-width: none;
}

.admin-billing-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0 0 28px;
}

.admin-billing-header {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.admin-billing-header__copy h1 {
    color: rgb(7 21 48);
    font-size: 1.58rem;
    font-weight: 750;
    line-height: 1.18;
    margin: 0 0 8px;
}

.admin-billing-header__copy p,
.admin-billing-panel p,
.admin-billing-muted {
    color: rgb(79 99 133);
    font-size: 0.84rem;
    line-height: 1.45;
    margin: 0;
}

.admin-billing-header__actions,
.admin-billing-inline-actions,
.admin-billing-xero__actions,
.admin-billing-contact-form__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-billing-header__actions {
    justify-content: flex-end;
    padding-top: 6px;
}

.admin-billing-primary-button,
.admin-billing-secondary-button,
.admin-billing-danger-button {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 750;
    gap: 6px;
    justify-content: center;
    line-height: 1;
    min-height: 36px;
    padding: 0 14px;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.admin-billing-primary-button {
    background: rgb(79 70 229);
    border: 1px solid rgb(79 70 229);
    color: rgb(255 255 255);
}

.admin-billing-primary-button:hover,
.admin-billing-primary-button:focus-visible {
    background: rgb(67 56 202);
    border-color: rgb(67 56 202);
    color: rgb(255 255 255);
    text-decoration: none;
}

.admin-billing-secondary-button {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    color: rgb(7 21 48);
}

.admin-billing-secondary-button:hover,
.admin-billing-secondary-button:focus-visible {
    background: rgb(248 250 252);
    border-color: rgb(188 201 221);
    color: rgb(7 21 48);
    text-decoration: none;
}

.admin-billing-danger-button {
    background: rgb(255 255 255);
    border: 1px solid rgb(248 113 113);
    color: rgb(220 38 38);
}

.admin-billing-danger-button:hover,
.admin-billing-danger-button:focus-visible {
    background: rgb(254 242 242);
    color: rgb(185 28 28);
    text-decoration: none;
}

.admin-billing-secondary-button--small {
    min-height: 32px;
    padding: 0 12px;
}

.admin-billing-menu-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: rgb(7 21 48);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 750;
    height: 32px;
    justify-content: center;
    line-height: 1;
    width: 32px;
}

.admin-billing-alert {
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 650;
    padding: 12px 14px;
}

.admin-billing-alert--warning {
    background: rgb(255 251 235);
    border-color: rgb(253 230 138);
    color: rgb(146 64 14);
}

.admin-billing-alert--danger {
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
    color: rgb(185 28 28);
}

.admin-billing-alert--success {
    background: rgb(240 253 244);
    border-color: rgb(187 247 208);
    color: rgb(21 128 61);
}

.admin-billing-kpis {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-billing-kpi,
.admin-billing-panel {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
}

.admin-billing-kpi {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 22px;
}

.admin-billing-kpi__icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 0.66rem;
    font-weight: 850;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.admin-billing-kpi__icon--purple {
    background: rgb(239 235 255);
    color: rgb(79 70 229);
}

.admin-billing-kpi__icon--green {
    background: rgb(220 252 231);
    color: rgb(5 150 105);
}

.admin-billing-kpi__icon--blue {
    background: rgb(219 234 254);
    color: rgb(37 99 235);
}

.admin-billing-kpi__label {
    color: rgb(79 99 133);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-billing-kpi strong {
    color: rgb(7 21 48);
    font-size: 1.44rem;
    font-weight: 750;
    line-height: 1.12;
}

.admin-billing-kpi strong small {
    color: rgb(38 59 96);
    font-size: 0.8rem;
    font-weight: 650;
}

.admin-billing-kpi__note {
    color: rgb(79 99 133);
    font-size: 0.82rem;
}

.admin-billing-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    justify-content: center;
    padding: 4px 9px;
    width: max-content;
}

.admin-billing-status--success {
    background: rgb(220 252 231);
    border: 1px solid rgb(134 239 172);
    color: rgb(21 128 61);
}

.admin-billing-status--warning {
    background: rgb(255 237 213);
    border: 1px solid rgb(253 186 116);
    color: rgb(194 65 12);
}

.admin-billing-status--neutral {
    background: rgb(238 242 247);
    border: 1px solid rgb(215 225 239);
    color: rgb(79 99 133);
}

.admin-billing-progress {
    appearance: none;
    border: 0;
    height: 8px;
    width: 100%;
}

.admin-billing-progress::-webkit-progress-bar {
    background: rgb(226 232 240);
    border-radius: 999px;
}

.admin-billing-progress::-webkit-progress-value {
    background: rgb(16 185 129);
    border-radius: 999px;
}

.admin-billing-progress::-moz-progress-bar {
    background: rgb(16 185 129);
    border-radius: 999px;
}

.admin-billing-progress--purple::-webkit-progress-value,
.admin-billing-usage-row progress::-webkit-progress-value {
    background: rgb(79 70 229);
}

.admin-billing-progress--purple::-moz-progress-bar,
.admin-billing-usage-row progress::-moz-progress-bar {
    background: rgb(79 70 229);
}

.admin-billing-inline-link {
    color: rgb(79 70 229);
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

.admin-billing-inline-link:hover,
.admin-billing-inline-link:focus-visible {
    color: rgb(49 46 129);
    text-decoration: none;
}

.admin-billing-grid {
    align-items: start;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.admin-billing-main,
.admin-billing-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.admin-billing-panel {
    padding: 22px;
}

.admin-billing-panel__header {
    margin-bottom: 18px;
}

.admin-billing-panel__header--split {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.admin-billing-panel h2 {
    color: rgb(7 21 48);
    font-size: 1rem;
    font-weight: 750;
    margin: 0;
}

.admin-billing-definition-grid,
.admin-billing-mini-list,
.admin-billing-xero__meta {
    display: grid;
    gap: 14px;
    margin: 0;
}

.admin-billing-definition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-billing-definition-grid div,
.admin-billing-mini-list div,
.admin-billing-xero__meta div {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
}

.admin-billing-definition-grid dt,
.admin-billing-mini-list dt,
.admin-billing-xero__meta dt {
    color: rgb(79 99 133);
    font-size: 0.82rem;
    font-weight: 650;
}

.admin-billing-definition-grid dd,
.admin-billing-mini-list dd,
.admin-billing-xero__meta dd {
    color: rgb(7 21 48);
    font-size: 0.86rem;
    font-weight: 700;
    margin: 0;
}

.admin-billing-chip {
    background: rgb(219 234 254);
    border-radius: 999px;
    color: rgb(37 99 235);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    margin: 0 5px 5px 0;
    padding: 4px 9px;
}

.admin-billing-chip--success {
    background: rgb(220 252 231);
    color: rgb(21 128 61);
}

.admin-billing-deactivate-form {
    margin-top: 18px;
}

.admin-billing-seat-bar {
    display: grid;
    gap: 10px;
}

.admin-billing-seat-bar meter {
    height: 28px;
    width: 100%;
}

.admin-billing-seat-bar span {
    color: rgb(79 99 133);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-billing-seat-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 14px 0 20px;
}

.admin-billing-seat-legend span {
    align-items: center;
    color: rgb(79 99 133);
    display: inline-flex;
    font-size: 0.78rem;
    gap: 7px;
}

.admin-billing-dot {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.admin-billing-dot--green {
    background: rgb(16 185 129);
}

.admin-billing-dot--muted {
    background: rgb(226 232 240);
}

.admin-billing-dot--purple {
    background: rgb(196 181 253);
}

.admin-billing-seat-forms {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-billing-seat-form {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(90px, 120px) minmax(130px, 1fr) auto;
}

.admin-billing-seat-form label,
.admin-billing-contact-form span {
    color: rgb(7 21 48);
    font-size: 0.8rem;
    font-weight: 750;
}

.admin-billing-seat-form input {
    max-width: 120px;
}

.admin-billing-seat-form__estimate {
    color: rgb(79 99 133);
    font-size: 0.78rem;
    line-height: 1.35;
    padding-bottom: 8px;
}

.admin-billing-note {
    background: rgb(239 246 255);
    border: 1px solid rgb(191 219 254);
    border-radius: 7px;
    color: rgb(37 99 235);
    font-size: 0.78rem;
    margin-top: 18px;
    padding: 10px 12px;
}

.admin-billing-seat-copy {
    margin-top: 14px;
}

.admin-billing-contact-form {
    display: grid;
    gap: 16px 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.admin-billing-contact-form label {
    display: grid;
    gap: 8px;
}

.admin-billing-contact-form__tax-note {
    grid-column: 1 / -1;
    margin-top: -6px;
}

.admin-billing-contact-form__actions {
    grid-column: 1 / -1;
}

.admin-billing-next-invoice {
    background: rgb(245 243 255);
    border: 1px solid rgb(221 214 254);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
    padding: 18px;
}

.admin-billing-next-invoice span {
    color: rgb(79 70 229);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-billing-next-invoice strong {
    color: rgb(79 70 229);
    font-size: 1.5rem;
    font-weight: 800;
}

.admin-billing-payment-card {
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 16px;
}

.admin-billing-payment-card strong {
    color: rgb(7 21 48);
    font-size: 0.9rem;
}

.admin-billing-payment-card span {
    color: rgb(21 128 61);
    font-size: 0.72rem;
    font-weight: 800;
}

.admin-billing-payment-card dl {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.admin-billing-payment-card dt {
    color: rgb(79 99 133);
    font-size: 0.72rem;
}

.admin-billing-payment-card dd {
    color: rgb(7 21 48);
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0;
}

.admin-billing-ai {
    align-items: center;
    display: grid;
    gap: 20px;
    grid-template-columns: 136px minmax(0, 1fr);
}

.admin-billing-ai__ring {
    align-items: center;
    background: rgb(255 255 255);
    border: 12px solid rgb(79 70 229);
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    height: 132px;
    justify-content: center;
    width: 132px;
}

.admin-billing-ai__ring strong {
    color: rgb(7 21 48);
    font-size: 1.8rem;
    font-weight: 800;
}

.admin-billing-ai__ring span,
.admin-billing-ai__summary span,
.admin-billing-ai__summary small {
    color: rgb(79 99 133);
    font-size: 0.82rem;
}

.admin-billing-ai__summary {
    display: grid;
    gap: 8px;
}

.admin-billing-ai__summary strong {
    color: rgb(79 70 229);
    font-size: 1.05rem;
}

.admin-billing-ai__summary strong span {
    color: rgb(79 99 133);
    font-weight: 650;
}

.admin-billing-usage-list {
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    margin: 18px 0;
    padding: 12px;
}

.admin-billing-usage-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(120px, 1fr) minmax(90px, 1fr) 72px;
}

.admin-billing-usage-row span,
.admin-billing-usage-row strong {
    color: rgb(7 21 48);
    font-size: 0.78rem;
}

.admin-billing-usage-row progress {
    appearance: none;
    border: 0;
    height: 7px;
    width: 100%;
}

.admin-billing-usage-row progress::-webkit-progress-bar {
    background: rgb(226 232 240);
    border-radius: 999px;
}

.admin-billing-usage-row progress::-webkit-progress-value {
    border-radius: 999px;
}

.admin-billing-usage-row progress::-moz-progress-bar {
    border-radius: 999px;
}

.admin-billing-invoices {
    padding: 0;
}

.admin-billing-invoices .admin-billing-panel__header {
    align-items: center;
    margin: 0;
    padding: 20px 22px;
}

.admin-billing-invoice-filters {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.5fr) minmax(130px, 0.45fr) auto;
    max-width: 720px;
}

.admin-billing-table-wrap {
    overflow-x: auto;
    padding: 0 18px;
}

.admin-billing-table {
    border-collapse: collapse;
    min-width: 920px;
    width: 100%;
}

.admin-billing-table th,
.admin-billing-table td {
    border-top: 1px solid rgb(226 232 240);
    color: rgb(7 21 48);
    font-size: 0.82rem;
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
}

.admin-billing-table th {
    background: rgb(248 250 252);
    color: rgb(79 99 133);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-billing-table-link {
    color: rgb(79 70 229);
    font-weight: 750;
    text-decoration: none;
}

.admin-billing-empty {
    color: rgb(79 99 133);
    font-size: 0.84rem;
    margin: 0;
    padding: 18px 4px 22px;
}

.admin-billing-pagination {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 16px 22px 20px;
}

.admin-billing-pagination span {
    color: rgb(79 99 133);
    font-size: 0.82rem;
}

.admin-billing-pagination div {
    display: flex;
    gap: 6px;
}

.admin-billing-pagination a {
    align-items: center;
    border: 1px solid rgb(215 225 239);
    border-radius: 6px;
    color: rgb(7 21 48);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 750;
    height: 32px;
    justify-content: center;
    text-decoration: none;
    width: 32px;
}

.admin-billing-pagination a.is-active {
    background: rgb(79 70 229);
    border-color: rgb(79 70 229);
    color: rgb(255 255 255);
}

.admin-billing-xero {
    align-items: center;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr) auto;
}

.admin-billing-xero__identity {
    align-items: center;
    display: flex;
    gap: 14px;
}

.admin-billing-xero__mark {
    align-items: center;
    background: rgb(14 165 233);
    border-radius: 999px;
    color: rgb(255 255 255);
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 850;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.admin-billing-xero__identity h2 {
    margin-bottom: 8px;
}

@media (max-width: 1240px) {
    .admin-billing-kpis,
    .admin-billing-grid,
    .admin-billing-xero {
        grid-template-columns: 1fr;
    }

    .admin-billing-seat-forms {
        grid-template-columns: 1fr;
    }

    .admin-billing-xero__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .admin-billing-page {
        gap: 16px;
    }

    .admin-billing-header,
    .admin-billing-panel__header--split,
    .admin-billing-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-billing-header__actions,
    .admin-billing-inline-actions,
    .admin-billing-contact-form__actions {
        justify-content: flex-start;
    }

    .admin-billing-kpis,
    .admin-billing-definition-grid,
    .admin-billing-contact-form,
    .admin-billing-ai,
    .admin-billing-payment-card dl,
    .admin-billing-invoice-filters {
        grid-template-columns: 1fr;
    }

    .admin-billing-definition-grid div,
    .admin-billing-mini-list div,
    .admin-billing-xero__meta div,
    .admin-billing-seat-form {
        grid-template-columns: 1fr;
    }

    .admin-billing-seat-form input {
        max-width: none;
    }

    .admin-billing-ai__ring {
        height: 112px;
        width: 112px;
    }
}

.app-content:has(> .admin-ai-usage-page) {
    box-sizing: border-box;
    max-width: none;
}

.admin-ai-usage-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1532px;
    width: 100%;
}

.admin-ai-usage-header {
    align-items: flex-start;
}

.admin-ai-usage-kpis {
    display: grid;
    gap: 20px;
    grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr));
}

.admin-ai-usage-kpi {
    display: grid;
    gap: 12px;
    min-height: 176px;
}

.admin-ai-usage-kpi--wide {
    align-items: center;
    grid-template-columns: 44px minmax(130px, 0.7fr) minmax(0, 1fr);
}

.admin-ai-usage-kpi__detail,
.admin-ai-usage-kpi__detail dl,
.admin-ai-usage-activity-row div,
.admin-ai-usage-health-list,
.admin-ai-usage-trend-summary {
    display: grid;
    gap: 10px;
}

.admin-ai-usage-kpi__detail strong {
    color: rgb(79 70 229);
    font-size: 1.28rem;
    line-height: 1.15;
}

.admin-ai-usage-kpi__detail small {
    color: rgb(79 99 133);
    font-size: 0.8rem;
}

.admin-ai-usage-kpi__detail dt,
.admin-ai-usage-mini-metrics dt,
.admin-ai-usage-trend-summary dt {
    color: rgb(79 99 133);
    font-size: 0.72rem;
}

.admin-ai-usage-kpi__detail dd,
.admin-ai-usage-mini-metrics dd,
.admin-ai-usage-trend-summary dd {
    color: rgb(7 21 48);
    font-size: 0.84rem;
    font-weight: 750;
    margin: 0;
}

.admin-ai-usage-ring {
    display: grid;
    height: 124px;
    place-items: center;
    position: relative;
    width: 124px;
}

.admin-ai-usage-ring svg {
    height: 124px;
    inset: 0;
    position: absolute;
    transform: rotate(-90deg);
    width: 124px;
}

.admin-ai-usage-ring circle {
    fill: none;
    stroke-width: 12;
}

.admin-ai-usage-ring__track {
    stroke: rgb(226 232 240);
}

.admin-ai-usage-ring__value {
    stroke: rgb(79 70 229);
    stroke-linecap: round;
}

.admin-ai-usage-ring strong {
    font-size: 1.46rem;
    font-weight: 800;
    line-height: 1;
}

.admin-ai-usage-ring span {
    color: rgb(79 99 133);
    font-size: 0.74rem;
    margin-top: 46px;
    position: absolute;
}

.admin-ai-usage-sparkline,
.admin-ai-usage-trend-chart {
    display: block;
    width: 100%;
}

.admin-ai-usage-sparkline {
    height: 80px;
}

.admin-ai-usage-sparkline polyline,
.admin-ai-usage-trend-chart polyline {
    fill: none;
    stroke: rgb(79 70 229);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.admin-ai-usage-mini-metrics {
    border-top: 1px solid rgb(226 232 240);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 8px 0 0;
    padding-top: 12px;
}

.admin-ai-usage-kpi__alert {
    font-size: 0.78rem;
    padding: 9px 10px;
}

.admin-ai-usage-grid {
    display: grid;
    gap: 20px 28px;
    grid-template-columns: minmax(0, 0.98fr) minmax(360px, 1.02fr);
}

.admin-ai-usage-kpis > *,
.admin-ai-usage-grid > * {
    min-width: 0;
}

.admin-ai-usage-activity,
.admin-ai-usage-trend {
    grid-column: 1 / -1;
}

.admin-ai-usage-view-form label {
    align-items: center;
    display: flex;
    gap: 8px;
}

.admin-ai-usage-view-form span {
    color: rgb(79 99 133);
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-ai-usage-view-form select,
.admin-ai-usage-filters input,
.admin-ai-usage-filters select {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 7px;
    color: rgb(7 21 48);
    font-size: 0.82rem;
    min-height: 38px;
    padding: 0 12px;
}

.admin-ai-usage-breakdown-list {
    display: grid;
    gap: 12px;
}

.admin-ai-usage-breakdown-row {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1fr) 88px 64px 64px;
}

.admin-ai-usage-breakdown-row span,
.admin-ai-usage-breakdown-row strong,
.admin-ai-usage-breakdown-row em,
.admin-ai-usage-breakdown-row small {
    color: rgb(7 21 48);
    font-size: 0.82rem;
    font-style: normal;
}

.admin-ai-usage-breakdown-row progress {
    appearance: none;
    border: 0;
    height: 7px;
    width: 100%;
}

.admin-ai-usage-breakdown-row progress::-webkit-progress-bar {
    background: rgb(226 232 240);
    border-radius: 999px;
}

.admin-ai-usage-breakdown-row progress::-webkit-progress-value {
    background: rgb(79 70 229);
    border-radius: 999px;
}

.admin-ai-usage-breakdown-row progress::-moz-progress-bar {
    background: rgb(79 70 229);
    border-radius: 999px;
}

.admin-ai-usage-table-wrap {
    padding: 0;
}

.admin-ai-usage-table-wrap .admin-billing-table {
    min-width: 680px;
}

.admin-ai-usage-filters {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.5fr) minmax(150px, 0.5fr) minmax(130px, 0.45fr) auto;
    margin-bottom: 14px;
}

.admin-ai-usage-activity-list {
    border-top: 1px solid rgb(226 232 240);
    display: grid;
}

.admin-ai-usage-activity-row {
    align-items: center;
    border-bottom: 1px solid rgb(226 232 240);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 1.2fr) minmax(90px, 0.45fr) minmax(130px, 0.7fr) minmax(92px, 0.45fr) minmax(150px, 0.7fr) auto;
    min-height: 58px;
    padding: 12px 0;
}

.admin-ai-usage-activity-row strong {
    color: rgb(7 21 48);
    font-size: 0.84rem;
}

.admin-ai-usage-activity-row span,
.admin-ai-usage-activity-row time {
    color: rgb(79 99 133);
    font-size: 0.78rem;
}

.admin-ai-usage-model-layout {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: 150px minmax(0, 1fr);
}

.admin-ai-usage-model-total {
    align-items: center;
    border: 12px solid rgb(79 70 229);
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    height: 128px;
    justify-content: center;
    width: 128px;
}

.admin-ai-usage-model-total strong {
    color: rgb(7 21 48);
    font-size: 1rem;
}

.admin-ai-usage-model-total span {
    color: rgb(79 99 133);
    font-size: 0.72rem;
}

.admin-ai-usage-health-list div,
.admin-ai-usage-trend-summary {
    align-items: center;
    display: grid;
}

.admin-ai-usage-health-list div {
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-ai-usage-health-list span {
    color: rgb(7 21 48);
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-ai-usage-trend-chart {
    border-bottom: 1px solid rgb(226 232 240);
    height: 240px;
    margin-top: 6px;
}

.admin-ai-usage-trend-summary {
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0 0;
}

@media (max-width: 1240px) {
    .admin-ai-usage-kpis,
    .admin-ai-usage-grid,
    .admin-ai-usage-model-layout {
        grid-template-columns: 1fr;
    }

    .admin-ai-usage-activity,
    .admin-ai-usage-trend {
        grid-column: auto;
    }

    .admin-ai-usage-kpi--wide {
        grid-template-columns: 44px minmax(130px, 0.45fr) minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .admin-ai-usage-kpi--wide,
    .admin-ai-usage-breakdown-row,
    .admin-ai-usage-filters,
    .admin-ai-usage-activity-row,
    .admin-ai-usage-trend-summary {
        grid-template-columns: 1fr;
    }

    .admin-ai-usage-header {
        align-items: stretch;
        flex-direction: column;
    }
}

.sounding-board-trigger {
    white-space: nowrap;
}

/* === Superadmin ============================================================ */

.app-content:has(> .superadmin-dashboard-page) {
    max-width: none;
}

.superadmin-dashboard-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin: 0 auto;
    max-width: 1516px;
    padding: 42px 0 28px;
}

.superadmin-dashboard-header {
    padding: 0;
}

.superadmin-dashboard-title {
    color: rgb(7 21 48);
    font-size: 1.82rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.superadmin-dashboard-subtitle {
    color: rgb(79 99 133);
    font-size: 1rem;
    line-height: 1.45;
    margin: 0.5rem 0 0;
}

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

.superadmin-dashboard-stat.admin-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    color: rgb(7 21 48);
    display: grid;
    gap: 22px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 154px;
    padding: 28px 34px;
    text-align: left;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.superadmin-dashboard-stat.admin-card:hover,
.superadmin-dashboard-stat.admin-card:focus-visible,
.superadmin-dashboard-link:hover,
.superadmin-dashboard-link:focus-visible {
    border-color: rgb(99 102 241);
    box-shadow: var(--shadow-md);
    outline: none;
    text-decoration: none;
}

.superadmin-dashboard-icon {
    align-items: center;
    background: rgb(245 243 255);
    border-radius: 8px;
    color: rgb(79 70 229);
    display: inline-flex;
    flex: 0 0 auto;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.superadmin-dashboard-icon--success {
    background: rgb(220 252 231);
    color: rgb(5 150 105);
}

.superadmin-dashboard-icon--info {
    background: rgb(239 246 255);
    color: rgb(37 99 235);
}

.superadmin-dashboard-icon svg {
    height: 24px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 24px;
}

.superadmin-dashboard-stat__copy,
.superadmin-dashboard-link__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.superadmin-dashboard-stat__label,
.superadmin-dashboard-link__label {
    color: rgb(38 56 88);
    font-size: 0.94rem;
    font-weight: 750;
    line-height: 1.25;
}

.superadmin-dashboard-stat__value {
    color: rgb(79 70 229);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
    margin-top: 14px;
}

.superadmin-dashboard-stat__hint,
.superadmin-dashboard-link__description {
    color: rgb(79 99 133);
    font-size: 0.95rem;
    line-height: 1.45;
    margin-top: 12px;
}

.superadmin-dashboard-chevron {
    color: rgb(50 73 111);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}

.superadmin-dashboard-panel {
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 28px 34px;
}

.superadmin-dashboard-panel__header {
    margin-bottom: 26px;
}

.superadmin-dashboard-panel__header h2 {
    color: rgb(7 21 48);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.superadmin-dashboard-panel__header p {
    color: rgb(79 99 133);
    font-size: 0.98rem;
    line-height: 1.45;
    margin: 0.5rem 0 0;
}

.superadmin-dashboard-quick-grid.quick-links {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.superadmin-dashboard-link {
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    color: rgb(7 21 48);
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 176px;
    padding: 22px;
    position: relative;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.superadmin-dashboard-link .superadmin-dashboard-icon {
    grid-column: 1;
}

.superadmin-dashboard-link .superadmin-dashboard-chevron {
    grid-column: 2;
    grid-row: 1;
}

.superadmin-dashboard-link__copy {
    grid-column: 1 / -1;
}

.superadmin-dashboard-overview {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.superadmin-dashboard-overview__item {
    border-left: 1px solid rgb(214 225 238);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 78px;
    padding: 4px 28px;
}

.superadmin-dashboard-overview__item:first-child {
    border-left: 0;
    padding-left: 0;
}

.superadmin-dashboard-overview__item span {
    color: rgb(79 99 133);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.25;
}

.superadmin-dashboard-overview__item strong {
    color: rgb(7 21 48);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.superadmin-dashboard-overview__item small {
    color: rgb(79 99 133);
    font-size: 0.9rem;
    line-height: 1.3;
}

.superadmin-dashboard-positive {
    color: rgb(5 150 105) !important;
    font-weight: 700;
}

.superadmin-dashboard-negative {
    color: rgb(185 28 28) !important;
    font-weight: 700;
}

.superadmin-dashboard-health {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 0.95rem !important;
    gap: 8px;
    justify-content: center;
    padding: 0.55rem 0.8rem;
    width: fit-content;
}

.superadmin-dashboard-health span {
    background: currentColor;
    border-radius: 999px;
    height: 6px;
    width: 6px;
}

.superadmin-dashboard-health--healthy {
    background: rgb(220 252 231);
    color: rgb(5 150 105) !important;
}

.superadmin-dashboard-health--degraded,
.superadmin-dashboard-health--needs_attention {
    background: rgb(254 249 195);
    color: rgb(161 98 7) !important;
}

@media (max-width: 1200px) {
    .superadmin-dashboard-quick-grid.quick-links {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .superadmin-dashboard-overview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 22px;
    }

    .superadmin-dashboard-overview__item:nth-child(4) {
        border-left: 0;
        padding-left: 0;
    }
}

@media (max-width: 900px) {
    .superadmin-dashboard-stats {
        grid-template-columns: 1fr;
    }

    .superadmin-dashboard-quick-grid.quick-links,
    .superadmin-dashboard-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .superadmin-dashboard-overview__item:nth-child(odd) {
        border-left: 0;
        padding-left: 0;
    }
}

@media (max-width: 640px) {
    .superadmin-dashboard-page {
        gap: 18px;
    }

    .superadmin-dashboard-title {
        font-size: 1.45rem;
    }

    .superadmin-dashboard-stat.admin-card,
    .superadmin-dashboard-panel {
        padding: 20px;
    }

    .superadmin-dashboard-stat.admin-card {
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 0;
    }

    .superadmin-dashboard-stat.admin-card > .superadmin-dashboard-chevron {
        display: none;
    }

    .superadmin-dashboard-quick-grid.quick-links,
    .superadmin-dashboard-overview {
        grid-template-columns: 1fr;
    }

    .superadmin-dashboard-link {
        min-height: 132px;
    }

    .superadmin-dashboard-overview__item {
        border-left: 0;
        border-top: 1px solid rgb(214 225 238);
        padding: 18px 0 0;
    }

    .superadmin-dashboard-overview__item:first-child {
        border-top: 0;
        padding-top: 0;
    }
}

.org-table {
    width: 100%;
    border-collapse: collapse;
}

.org-table th {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.org-table td,
.org-table th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.org-table tbody tr:hover {
    background: var(--primary-light);
}

.org-actions {
    white-space: nowrap;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-warning {
    background: var(--warning);
    color: rgb(255, 255, 255);
    border-color: var(--warning);
}

.btn-warning:hover:not(:disabled) {
    background: rgb(180 83 9);
    border-color: rgb(180 83 9);
    color: rgb(255, 255, 255);
}

.btn-success {
    background: var(--success);
    color: rgb(255, 255, 255);
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: rgb(21 128 61);
    border-color: rgb(21 128 61);
    color: rgb(255, 255, 255);
}

/* === Governance Dashboard ==================================================== */

.governance-section {
    margin-bottom: 2rem;
}

.governance-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.alert-list,
.governance-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-card,
.governance-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--secondary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.alert-card.severity-info {
    border-left-color: var(--primary);
}

.alert-card.severity-warning {
    border-left-color: var(--warning);
}

.alert-card.severity-critical {
    border-left-color: var(--danger);
}

.governance-item {
    border-left-color: var(--primary);
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.alert-type {
    text-transform: capitalize;
}

.alert-date {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-left: auto;
}

.alert-details {
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.alert-details p {
    margin: 0;
}

.alert-actions {
    display: flex;
    gap: 0.5rem;
}

.badge-info {
    background: var(--primary);
    color: rgb(255, 255, 255);
}

.badge-critical {
    background: var(--danger);
    color: rgb(255, 255, 255);
}

.baseline-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.baseline-table th,
.baseline-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.baseline-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.baseline-table tbody tr:last-child td {
    border-bottom: none;
}

.baseline-table tbody tr:hover {
    background: var(--bg);
}

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

/* === Governance Page ======================================================= */

.app-content:has(> .governance-page) {
    max-width: none;
    padding: 2rem 3rem 1.75rem;
}

.governance-page {
    --governance-canvas: rgb(245 247 251);
    --governance-surface: rgb(255 255 255);
    --governance-surface-soft: rgb(249 250 252);
    --governance-border: rgb(226 232 240);
    --governance-border-strong: rgb(214 218 225);
    --governance-text: rgb(15 23 42);
    --governance-muted: rgb(71 85 105);
    --governance-blue: rgb(79 70 229);
    --governance-blue-hover: rgb(91 82 240);
    --governance-green: rgb(5 150 105);
    --governance-green-soft: rgb(232 248 241);
    --governance-amber: rgb(217 119 6);
    --governance-amber-soft: rgb(255 247 237);
    --governance-red: rgb(220 38 38);
    --governance-red-soft: rgb(255 241 242);
    --governance-purple-soft: rgb(238 242 255);
    color: var(--governance-text);
    display: grid;
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 1500px;
}

.governance-page svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.governance-page__header,
.governance-page__actions,
.governance-page__title-row,
.governance-panel__intro,
.governance-panel__heading,
.governance-history__heading,
.governance-history__actions,
.governance-summary-card__value-row,
.governance-review-row,
.governance-review-row__main,
.governance-review-row__actions,
.governance-reviewer,
.governance-workflow-footer {
    align-items: center;
    display: flex;
}

.governance-page__header {
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 0.125rem;
}

.governance-page__heading {
    display: grid;
    gap: 0.25rem;
}

.governance-page__title-row {
    gap: 0.625rem;
}

.governance-page__heading h1 {
    color: var(--governance-text);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

.governance-page__heading p,
.governance-panel__intro p,
.governance-summary-card__note,
.governance-review-row__copy span,
.governance-review-row__due {
    color: var(--governance-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.governance-page__info .page-info-btn {
    align-items: center;
    background: rgb(242 246 252);
    border: 1px solid var(--governance-border);
    border-radius: 9999px;
    color: var(--governance-muted);
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.25rem;
    justify-content: center;
    width: 1.25rem;
}

.governance-page__actions,
.governance-history__actions {
    gap: 0.875rem;
    justify-content: flex-end;
}

.governance-button,
.governance-small-button,
.governance-footer-button {
    align-items: center;
    border-radius: 0.75rem;
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 600;
    gap: 0.5rem;
    justify-content: center;
    line-height: 1;
    min-height: 2.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.governance-button {
    border: 1px solid var(--governance-border-strong);
    padding: 0 1rem;
}

.governance-button svg {
    height: 1rem;
    width: 1rem;
}

.governance-button--secondary,
.governance-small-button--secondary,
.governance-footer-button--secondary {
    background: var(--governance-surface);
    color: rgb(30 41 59);
}

.governance-button--secondary:hover,
.governance-small-button--secondary:hover,
.governance-footer-button--secondary:hover {
    background: var(--governance-surface-soft);
    text-decoration: none;
}

.governance-button--primary,
.governance-small-button--primary,
.governance-footer-button--primary {
    background: var(--governance-blue);
    border-color: var(--governance-blue);
    color: rgb(255 255 255);
}

.governance-button--primary:hover,
.governance-small-button--primary:hover,
.governance-footer-button--primary:hover {
    background: var(--governance-blue-hover);
    color: rgb(255 255 255);
    text-decoration: none;
}

.governance-panel {
    background: var(--governance-surface);
    border: 1px solid var(--governance-border);
    border-radius: 0.875rem;
    box-shadow: 0 1px 2px rgb(16 24 40 / 0.04);
}

.governance-summary {
    padding: 1.375rem 1.375rem 1.5rem;
}

.governance-panel__intro {
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.governance-panel__intro h2,
.governance-panel__heading h2,
.governance-history__heading h2 {
    color: var(--governance-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.governance-panel__intro p {
    margin: 0.25rem 0 0;
}

.governance-panel__icon {
    align-items: center;
    border-radius: 9999px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.governance-panel__icon svg {
    height: 1rem;
    width: 1rem;
}

.governance-panel__icon--blue {
    background: var(--governance-purple-soft);
    color: var(--governance-blue);
}

.governance-panel__icon--purple {
    background: var(--governance-purple-soft);
    color: var(--governance-blue);
}

.governance-summary__grid {
    display: grid;
    gap: 1.125rem;
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(12.5rem, 1.15fr);
}

.governance-summary-card {
    background: var(--governance-surface);
    border: 1px solid var(--governance-border);
    border-radius: 0.625rem;
    display: grid;
    gap: 0.55rem;
    min-height: 7rem;
    padding: 1rem;
}

.governance-summary-card--amber {
    background: rgb(255 251 235);
    border-color: rgb(252 211 77);
}

.governance-summary-card--red {
    background: var(--governance-red-soft);
    border-color: rgb(254 205 211);
}

.governance-summary-card__label {
    color: rgb(51 65 85);
    font-size: 0.8125rem;
    font-weight: 600;
}

.governance-summary-card strong {
    color: var(--governance-text);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.governance-summary-card__value-row {
    gap: 0.625rem;
}

.governance-status {
    align-items: center;
    border-radius: 9999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    min-height: 1.35rem;
    padding: 0 0.5rem;
}

.governance-status::before {
    content: "";
    border-radius: 9999px;
    height: 0.35rem;
    margin-right: 0.35rem;
    width: 0.35rem;
}

.governance-status--good {
    background: var(--governance-green-soft);
    color: var(--governance-green);
}

.governance-status--good::before {
    background: var(--governance-green);
}

.governance-status--fair,
.governance-status--attention {
    background: var(--governance-amber-soft);
    color: var(--governance-amber);
}

.governance-status--fair::before,
.governance-status--attention::before {
    background: var(--governance-amber);
}

.governance-status--poor {
    background: var(--governance-red-soft);
    color: var(--governance-red);
}

.governance-status--poor::before {
    background: var(--governance-red);
}

.governance-progress {
    accent-color: var(--governance-green);
    height: 0.45rem;
    width: 100%;
}

.governance-summary-card__date {
    align-items: center;
    display: inline-flex;
    font-size: 1.25rem;
    gap: 0.4rem;
    white-space: nowrap;
}

.governance-summary-card__date svg {
    color: rgb(30 64 175);
    height: 1.125rem;
    width: 1.125rem;
}

.governance-summary-card a,
.governance-section-link {
    color: rgb(29 78 216);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.governance-pending {
    display: grid;
    gap: 1.125rem;
    padding: 1.375rem;
}

.governance-panel__heading {
    justify-content: space-between;
}

.governance-review-list {
    display: grid;
    gap: 0.75rem;
}

.governance-review-row {
    border: 1px solid var(--governance-border);
    border-radius: 0.625rem;
    gap: 1rem;
    justify-content: space-between;
    min-height: 4.25rem;
    padding: 0.875rem 1rem;
}

.governance-review-row__main {
    gap: 0.75rem;
    min-width: 0;
}

.governance-review-row__copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.governance-review-row__copy strong,
.governance-history-table td {
    color: var(--governance-text);
    font-size: 0.875rem;
}

.governance-review-pill {
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.625rem;
    white-space: nowrap;
}

.governance-review-pill--purple {
    background: var(--governance-blue);
    color: rgb(255 255 255);
}

.governance-review-pill--red {
    background: var(--governance-red-soft);
    color: var(--governance-red);
}

.governance-review-row__due {
    margin-left: auto;
    white-space: nowrap;
}

.governance-review-row__actions {
    gap: 0.625rem;
}

.governance-small-button {
    border: 1px solid var(--governance-border-strong);
    padding: 0 0.875rem;
}

.governance-icon-button {
    align-items: center;
    background: var(--governance-surface);
    border: 1px solid var(--governance-border);
    border-radius: 0.625rem;
    color: rgb(51 65 85);
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    width: 2.25rem;
}

.governance-icon-button svg {
    height: 1rem;
    width: 1rem;
}

.governance-history {
    overflow: hidden;
}

.governance-history__heading {
    border-bottom: 1px solid var(--governance-border);
    justify-content: space-between;
    padding: 1.375rem;
}

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

.governance-history-table {
    border-collapse: collapse;
    min-width: 1020px;
    width: 100%;
}

.governance-history-table th {
    background: var(--governance-surface-soft);
    border-bottom: 1px solid var(--governance-border);
    color: rgb(71 85 105);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.875rem 1rem;
    text-align: left;
}

.governance-history-table td {
    border-bottom: 1px solid var(--governance-border);
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

.governance-history-table tbody tr:last-child td {
    border-bottom: 0;
}

.governance-history-score,
.governance-reviewer {
    gap: 0.5rem;
}

.governance-reviewer > span {
    align-items: center;
    background: rgb(241 245 249);
    border-radius: 9999px;
    color: rgb(51 65 85);
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.5rem;
    justify-content: center;
    width: 1.5rem;
}

.governance-empty-state {
    background: var(--governance-surface-soft);
    border: 1px dashed var(--governance-border);
    border-radius: 0.75rem;
    color: var(--governance-muted);
    font-size: 0.875rem;
    margin: 0;
    padding: 1.25rem;
}

.governance-workflow-footer {
    justify-content: space-between;
    margin-top: 0.75rem;
}

.governance-workflow-footer > span {
    color: var(--governance-muted);
    font-size: 0.875rem;
}

.governance-footer-button {
    border: 1px solid var(--governance-border-strong);
    min-width: 9rem;
    padding: 0 1rem;
}

html[data-theme="dark"] .governance-page {
    --governance-canvas: var(--bg);
    --governance-surface: var(--surface);
    --governance-surface-soft: var(--surface-2);
    --governance-border: var(--border);
    --governance-border-strong: var(--border);
    --governance-text: var(--text);
    --governance-muted: var(--text-secondary);
    --governance-blue: var(--primary-dark);
    --governance-blue-hover: var(--primary);
    --governance-green-soft: rgba(5, 150, 105, 0.18);
    --governance-amber-soft: rgba(217, 119, 6, 0.18);
    --governance-red-soft: rgba(220, 38, 38, 0.18);
    --governance-purple-soft: rgba(129, 140, 248, 0.16);
}

html[data-theme="dark"] .governance-page__info .page-info-btn,
html[data-theme="dark"] .governance-reviewer > span {
    background: var(--surface-hover);
}

html[data-theme="dark"] .governance-summary-card--amber,
html[data-theme="dark"] .governance-summary-card--red {
    background: var(--governance-surface);
}

@media (max-width: 1280px) {
    .governance-summary__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .app-content:has(> .governance-page) {
        padding: 1.5rem;
    }

    .governance-page__header,
    .governance-history__heading,
    .governance-review-row {
        align-items: stretch;
        flex-direction: column;
    }

    .governance-page__actions,
    .governance-history__actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .governance-summary__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .governance-review-row__due {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .app-content:has(> .governance-page) {
        padding: 1rem;
    }

    .governance-summary__grid {
        grid-template-columns: 1fr;
    }

    .governance-button,
    .governance-footer-button {
        width: 100%;
    }

    .governance-workflow-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 0.75rem;
    }
}

.persona-editor-panel .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.persona-editor-panel .form-group {
    margin-bottom: 1.25rem;
}

.persona-editor-panel textarea {
    resize: vertical;
    min-height: 80px;
}

.app-content:has(> .context-templates-page) {
    max-width: none;
    padding: 1.75rem 2.25rem 3rem;
}

.context-templates-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.context-templates-page__header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 0.15rem;
}

.context-templates-page__subtitle {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0.45rem 0 1rem;
}

.context-templates-page__back {
    color: var(--primary);
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.context-templates-page__back:hover,
.context-templates-page__back:focus {
    color: var(--primary-dark);
    text-decoration: none;
}

.context-templates-page__primary {
    align-items: center;
    flex: 0 0 auto;
    height: 2.6rem;
    justify-content: center;
    min-width: 9rem;
    padding: 0 1.2rem;
}

.context-templates-analytics,
.context-templates-table-card,
.context-templates-notice {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xs);
}

.context-templates-analytics {
    align-items: center;
    display: grid;
    gap: 1.75rem;
    grid-template-columns: minmax(260px, 1.55fr) repeat(6, minmax(112px, 1fr));
    min-height: 6.9rem;
    padding: 1.35rem 1.65rem;
}

.context-templates-analytics__intro h2,
.context-templates-table-card__header h2 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.context-templates-analytics__intro p,
.context-templates-table-card__header p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0.5rem 0 0;
}

.context-templates-analytics__metric {
    min-width: 0;
}

.context-templates-analytics__metric span {
    color: var(--text-light);
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.42rem;
}

.context-templates-analytics__metric strong {
    color: var(--text);
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 1.58rem;
    font-weight: 700;
    line-height: 1;
}

.context-templates-analytics__metric small {
    font-size: 0.78rem;
    font-weight: 600;
}

.context-templates-table-card {
    overflow: hidden;
}

.context-templates-table-card__header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    padding: 1.55rem 1.55rem 1.35rem;
}

.context-templates-table-card__header p {
    margin: 0;
}

.context-templates-empty {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
}

.context-templates-empty p {
    color: var(--text-light);
    margin: 0;
}

.context-templates-table-wrap {
    overflow-x: auto;
}

.context-templates-table {
    border-collapse: collapse;
    min-width: 1180px;
    width: 100%;
}

.context-templates-table th {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    padding: 0.88rem 1.5rem;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.context-templates-table td {
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.4;
    padding: 1.05rem 1.5rem;
    vertical-align: middle;
}

.context-templates-table tbody tr:last-child td {
    border-bottom: 0;
}

.context-templates-table th:first-child,
.context-templates-table td:first-child {
    width: 25%;
}

.context-templates-table__template-link {
    color: var(--primary);
    display: inline-flex;
    font-weight: 600;
    margin-bottom: 0.35rem;
    text-decoration: none;
}

.context-templates-table__template-link:hover,
.context-templates-table__template-link:focus {
    color: var(--primary-dark);
    text-decoration: none;
}

.context-templates-table__slug,
.context-templates-table small {
    color: var(--text-light);
    display: block;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.context-templates-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.55rem;
    justify-content: center;
    padding: 0 0.75rem;
    white-space: nowrap;
}

.context-templates-status--active {
    background: var(--success-soft);
    color: var(--success);
}

.context-templates-status--inactive {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.context-templates-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.context-templates-actions .btn {
    min-width: 3.7rem;
}

.context-templates-actions__more {
    align-items: center;
    border-radius: 0.375rem;
    color: var(--text-light);
    display: inline-flex;
    font-size: 1.2rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    width: 2rem;
}

.context-templates-actions__more:hover,
.context-templates-actions__more:focus {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

.context-templates-notice {
    align-items: center;
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--text-secondary);
    display: flex;
    gap: 0.8rem;
    min-height: 3.2rem;
    padding: 0.85rem 1.1rem;
}

.context-templates-notice span {
    align-items: center;
    border: 2px solid var(--primary);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 800;
    height: 1.15rem;
    justify-content: center;
    width: 1.15rem;
}

.context-templates-notice p {
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0;
}

@media (max-width: 1280px) {
    .context-templates-analytics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .context-templates-analytics__intro {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .app-content:has(> .context-templates-page) {
        padding: 1.25rem 1rem 2rem;
    }

    .context-templates-page__header,
    .context-templates-empty {
        align-items: stretch;
        flex-direction: column;
    }

    .context-templates-page__primary,
    .context-templates-empty .btn {
        width: 100%;
    }

    .context-templates-analytics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem;
    }

    .context-templates-analytics__intro {
        grid-column: 1 / -1;
    }

    .context-templates-table-card__header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.superadmin-context-template-form {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .context-template-editor-theme .app-content {
        max-width: none;
        padding-left: 4.5rem;
        padding-right: 4.5rem;
    }
}

.superadmin-context-template-form .form-group {
    margin-bottom: 0;
}

.superadmin-context-template-form__section {
    display: grid;
    gap: 1.25rem;
}

.context-template-contract-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.context-template-contract-grid .context-template-json-input {
    height: 11.5rem;
    min-height: 11.5rem;
}

.context-template-persona-editor {
    overflow: hidden;
}

.context-template-persona-editor__header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
}

.context-template-persona-editor__header .btn {
    min-height: 40px;
}

.context-template-persona-editor__summary {
    display: grid;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem 1.5rem;
}

.context-template-persona-summary-row {
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 0.45fr) minmax(16rem, 1.15fr) auto;
    padding: 0.85rem 1rem;
}

.context-template-persona-summary-row strong,
.context-template-persona-summary-row span,
.context-template-persona-summary-row div {
    min-width: 0;
}

.context-template-persona-summary-row strong,
.context-template-persona-summary-row span {
    display: block;
}

.context-template-persona-summary-row span,
.context-template-persona-summary-row div {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.45;
}

.context-template-persona-modal[hidden],
.context-template-persona-modal__item[hidden],
.context-template-persona-pack[hidden],
.context-template-persona-modal__footer [hidden],
.context-template-persona-summary-row[hidden],
[data-persona-pack-item-default][hidden],
[data-persona-pack-summary-default][hidden] {
    display: none;
}

.context-template-persona-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 2rem;
    position: fixed;
    z-index: 1000;
}

.context-template-persona-modal__backdrop {
    background: rgba(15, 23, 42, 0.5);
    inset: 0;
    position: absolute;
}

.context-template-persona-modal__dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(84vh, 760px);
    max-width: 1200px;
    min-height: 640px;
    overflow: hidden;
    position: relative;
    width: min(100%, 1200px);
}

.context-template-persona-modal--single .context-template-persona-modal__dialog {
    max-width: 960px;
    min-height: 0;
}

.context-template-persona-modal__header,
.context-template-persona-modal__footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.context-template-persona-modal__header {
    border-bottom: 1px solid var(--border);
}

.context-template-persona-modal__footer {
    border-top: 1px solid var(--border);
}

.context-template-persona-modal__footer-spacer {
    flex: 1 1 auto;
}

.context-template-persona-modal__close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.45rem;
    height: 2.25rem;
    justify-content: center;
    line-height: 1;
    width: 2.25rem;
}

.context-template-persona-modal__close:hover,
.context-template-persona-modal__close:focus {
    background: var(--bg);
}

.context-template-persona-modal__body {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    min-height: 0;
}

.context-template-persona-modal--single .context-template-persona-modal__body {
    grid-template-columns: minmax(0, 1fr);
}

.context-template-persona-modal__rail {
    border-right: 1px solid var(--border);
    display: grid;
    gap: 1rem;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    padding: 1.25rem 1rem;
}

.context-template-persona-modal--single .context-template-persona-modal__rail {
    display: none;
}

.context-template-persona-modal__add {
    justify-content: center;
}

.context-template-persona-modal__items {
    display: grid;
    gap: 0.5rem;
    overflow: auto;
    padding-right: 0.25rem;
}

.context-template-persona-modal__item {
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    padding: 0.85rem;
    text-align: left;
}

.context-template-persona-modal__item:hover,
.context-template-persona-modal__item:focus,
.context-template-persona-modal__item.is-active {
    background: var(--primary-light, #eef2ff);
    border-color: rgba(79, 70, 229, 0.2);
}

.context-template-persona-modal__dot {
    background: var(--primary);
    border-radius: 999px;
    height: 0.7rem;
    margin-top: 0.28rem;
    width: 0.7rem;
}

.context-template-persona-modal__item strong,
.context-template-persona-modal__item small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.context-template-persona-modal__item small {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
    margin-top: 0.2rem;
}

.context-template-persona-modal__item em {
    background: var(--primary-light, #eef2ff);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
}

.context-template-persona-modal__panels {
    min-height: 0;
    overflow: auto;
    padding: 1.25rem;
}

.context-template-persona-modal--single .context-template-persona-modal__panels {
    overflow: visible;
    padding: 1.5rem;
}

.context-template-persona-pack {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0;
    min-width: 0;
    padding: 1rem 1.125rem 1rem;
}

.context-template-persona-modal--single .context-template-persona-pack {
    border: 0;
    padding: 0;
}

.context-template-persona-pack__legend {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    padding: 0;
}

.context-template-persona-modal--single .context-template-persona-pack__legend {
    display: none;
}

.context-template-persona-pack__controls {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
}

.context-template-persona-pack__controls .checkbox-label {
    line-height: 1.25;
    padding: 0;
}

.context-template-persona-pack__controls input[type="checkbox"],
.context-template-persona-pack__controls input[type="radio"] {
    margin: 0.1rem 0 0;
}

.context-template-persona-pack .settings-grid-2 {
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.context-template-json-input {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    min-height: 14rem;
}

.context-template-json-input.is-invalid,
.context-template-json-input[aria-invalid="true"] {
    border-color: var(--danger);
}

.context-template-json-error {
    color: var(--danger);
    font-size: 0.8125rem;
    line-height: 1.4;
    margin: 0.4rem 0 0;
}

.context-template-json-input.context-template-persona-pack__members {
    height: 18.5rem;
    min-height: 18.5rem;
}

.quick-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .superadmin-stats {
        grid-template-columns: 1fr;
    }

    .org-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .quick-links {
        flex-direction: column;
    }

    .page-header-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header-actions .btn,
    .superadmin-context-template-form .quick-links .btn {
        width: 100%;
    }

    .context-template-persona-editor__header,
    .context-template-persona-summary-row {
        grid-template-columns: 1fr;
    }

    .context-template-persona-editor__header {
        align-items: stretch;
        flex-direction: column;
    }

    .context-template-persona-modal {
        align-items: stretch;
        padding: 0;
    }

    .context-template-persona-modal__dialog {
        border-radius: 0;
        max-height: none;
        min-height: 100%;
        width: 100%;
    }

    .context-template-persona-modal__body {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .context-template-persona-modal__rail {
        border-bottom: 1px solid var(--border);
        border-right: 0;
        max-height: 15rem;
    }

    .context-template-persona-modal__panels {
        overflow: visible;
    }

    .context-template-persona-modal__footer {
        flex-wrap: wrap;
    }

    .context-template-persona-modal__footer .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 640px) {
    .context-template-contract-grid,
    .context-template-persona-pack .settings-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Page Description Banner
   =========================== */
.page-description {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text);
    line-height: 1.6;
}

/* Info button next to page title with hover-triggered popover */
.page-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.375rem;
    vertical-align: middle;
    outline: none;
}

.page-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    color: var(--text-light, rgb(148, 163, 184));
    border: 1px solid var(--border, rgb(226, 232, 240));
    border-radius: 50%;
    cursor: help;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.page-info:hover .page-info-btn,
.page-info:focus-within .page-info-btn {
    background: var(--primary-light, rgb(238 242 255));
    color: var(--primary);
    border-color: var(--primary);
}

/* Hover-revealed popover - never requires a click */
.page-info-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: -8px;
    width: max-content;
    max-width: 380px;
    padding: 0.75rem 0.9rem;
    background: rgb(15 23 42);
    color: rgb(226, 232, 240);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25), 0 4px 10px rgba(15, 23, 42, 0.12);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 140ms, transform 140ms;
    z-index: 200;
    white-space: normal;
}

/* Small arrow pointing up to the (i) button */
.page-info-popover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 14px;
    width: 10px;
    height: 10px;
    background: rgb(15 23 42);
    transform: rotate(45deg) translateY(6px);
    border-radius: 2px;
}

.page-info:hover .page-info-popover,
.page-info:focus-within .page-info-popover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ===========================
   Superadmin Package Form
   =========================== */
.superadmin-package-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.superadmin-package-form .form-control {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.4;
}

.superadmin-package-form textarea.form-control {
    min-height: 92px;
    resize: vertical;
}

.superadmin-package-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.package-form-section {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgb(255, 255, 255);
}

.package-form-section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.25rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.package-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.superadmin-user-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.superadmin-user-card-header {
    align-items: flex-start;
    gap: 1rem;
}

.superadmin-user-card-header .text-muted {
    max-width: 46rem;
    margin: 0;
}

.superadmin-user-form .form-control {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.4;
}

.superadmin-user-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.superadmin-user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.superadmin-user-form-actions {
    grid-column: 1 / -1;
}

.superadmin-user-promote-card {
    margin-top: 1rem;
}

.superadmin-user-promote-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
}

.superadmin-user-promote-field {
    margin-bottom: 0;
}

.superadmin-user-promote-empty {
    margin: 0.75rem 0 0;
}

.superadmin-role-list {
    gap: 0.75rem;
}

.superadmin-role-group .accordion-header {
    min-height: 58px;
}

.superadmin-role-group .settings-accordion-meta {
    margin-left: auto;
}

.superadmin-role-group__body {
    padding: 0;
}

.superadmin-role-table {
    margin: 0;
}

@media (max-width: 768px) {
    .superadmin-user-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .superadmin-user-form-grid {
        grid-template-columns: 1fr;
    }

    .superadmin-user-promote-form {
        grid-template-columns: 1fr;
    }
}

.package-form-field--full {
    grid-column: 1 / -1;
}

.package-field-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.package-help {
    margin-left: 0;
}

.package-help .page-info-btn {
    width: 18px;
    height: 18px;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-style: normal;
}

.package-help-popover {
    max-width: 320px;
}

.package-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.5rem;
}

.package-feature-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-weight: 600;
}

.package-custom-label {
    margin-top: 1rem;
}

.package-price-option + .package-price-option {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.package-price-title {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
}

.package-price-grid {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) minmax(130px, 1fr) minmax(90px, 0.7fr) minmax(110px, 1fr) minmax(110px, 1fr);
    gap: 0.75rem;
    align-items: end;
}

.package-accordion-list {
    display: grid;
    gap: 0.9rem;
}

.package-list-note {
    margin: 0.35rem 0 0.9rem;
}

.package-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.package-accordion.sortable-ghost {
    opacity: 0.55;
}

.package-accordion.package-accordion--saving {
    border-color: var(--primary);
}

.package-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
}

.package-accordion-summary::-webkit-details-marker {
    display: none;
}

.package-accordion-summary::before {
    content: '\203A';
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    transition: transform 0.15s ease;
}

.package-accordion[open] .package-accordion-summary::before {
    transform: rotate(90deg);
}

.package-drag-handle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-muted);
    cursor: grab;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.package-drag-handle:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    outline: none;
}

.package-drag-handle:active {
    cursor: grabbing;
}

.package-accordion-title {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    margin-right: auto;
}

.package-accordion-name {
    overflow: hidden;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.package-accordion-slug {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.package-accordion-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.package-accordion-body {
    display: grid;
    gap: 1.25rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.package-price-management {
    display: grid;
    gap: 1rem;
}

.package-price-list {
    display: grid;
    gap: 0.5rem;
}

.package-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.package-add-price-form {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.package-empty-copy {
    margin: 0;
}

.package-order-status {
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
}

.package-danger-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgb(254 202 202);
    border-radius: var(--radius);
    background: rgb(255, 255, 255)7f7;
}

@media (max-width: 900px) {
    .package-form-grid,
    .package-price-grid {
        grid-template-columns: 1fr;
    }

    .package-form-field--full {
        grid-column: auto;
    }

    .package-accordion-summary,
    .package-price-row,
    .package-danger-action {
        align-items: flex-start;
        flex-direction: column;
    }

    .package-accordion-meta {
        justify-content: flex-start;
    }
}

.package-management-page {
    display: grid;
    gap: 1.5rem;
    color: rgb(15, 23, 42);
}

.package-management-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.package-management-header .page-title {
    margin-bottom: 0.35rem;
    color: rgb(15, 23, 42);
    font-size: 2rem;
    line-height: 1.15;
}

.package-management-header .page-subtitle {
    margin: 0;
    color: rgb(71, 85, 105);
}

.package-management-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.package-action-button,
.package-create-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.package-action-button svg,
.package-create-inline svg,
.package-search svg,
.package-metric-icon svg,
.package-card-icon svg,
.package-feature-card-icon svg {
    width: 1.15rem;
    height: 1.15rem;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.package-management-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.package-metric-card,
.package-management-panel {
    border: 1px solid rgb(226, 232, 240);
    border-radius: 12px;
    background: rgb(255, 255, 255);
}

.package-metric-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 126px;
    padding: 1.25rem;
    overflow: hidden;
}

.package-metric-icon,
.package-card-icon,
.package-feature-card-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.package-metric-icon--primary,
.package-card-icon--star,
.package-card-icon--flask {
    background: rgb(238, 242, 255);
    color: rgb(79, 70, 229);
}

.package-metric-icon--blue,
.package-card-icon--users {
    background: rgb(219, 234, 254);
    color: rgb(37, 99, 235);
}

.package-metric-icon--green,
.package-card-icon--briefcase {
    background: rgb(220, 252, 231);
    color: rgb(22, 163, 74);
}

.package-metric-icon--orange,
.package-card-icon--archive {
    background: rgb(255, 237, 213);
    color: rgb(249, 115, 22);
}

.package-metric-label,
.package-price-plan-kicker {
    display: block;
    color: rgb(71, 85, 105);
    font-size: 0.78rem;
    font-weight: 700;
}

.package-metric-card strong {
    display: block;
    margin-top: 0.4rem;
    color: rgb(15, 23, 42);
    font-size: 1.8rem;
    line-height: 1;
}

.package-metric-card small {
    display: block;
    margin-top: 0.75rem;
    color: rgb(71, 85, 105);
    font-size: 0.82rem;
}

.package-metric-sparkline {
    position: absolute;
    right: 1rem;
    bottom: 0.85rem;
    width: 120px;
    height: 48px;
}

.package-metric-sparkline path {
    stroke: rgb(22, 163, 74);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.package-management-shell {
    display: grid;
    grid-template-columns: minmax(320px, 0.48fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.package-list-panel,
.package-detail-panel,
.package-create-panel,
.package-change-panel {
    padding: 1rem;
}

.package-list-header {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.package-list-header h2,
.package-section-heading h2,
.package-section-heading h3 {
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 1.15rem;
}

.package-list-header h2 span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: rgb(241, 245, 249);
    color: rgb(71, 85, 105);
    font-size: 0.75rem;
}

.package-list-header p,
.package-section-heading p {
    margin: 0.25rem 0 0;
    color: rgb(71, 85, 105);
    font-size: 0.85rem;
}

.package-list-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 0.5rem;
}

.package-search {
    position: relative;
    display: block;
}

.package-search svg {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: rgb(100, 116, 139);
}

.package-search .form-control {
    padding-left: 2.25rem;
}

.package-card-list {
    gap: 0.65rem;
}

.package-management-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    border-radius: 10px;
    box-shadow: none;
    transition: border-color 160ms ease, background 160ms ease;
}

.package-management-card.is-active {
    border-color: rgb(79, 70, 229);
    background: rgb(250, 250, 255);
}

.package-management-card[hidden] {
    display: none;
}

.package-management-card .package-drag-handle {
    margin-left: 0.75rem;
}

.package-card-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    width: 100%;
    min-height: 88px;
    padding: 0.8rem 0.85rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.package-card-icon {
    width: 44px;
    height: 44px;
}

.package-card-main {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.package-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.package-card-title-row strong {
    overflow: hidden;
    color: rgb(15, 23, 42);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.package-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.25rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: rgb(241, 245, 249);
    color: rgb(71, 85, 105);
    font-size: 0.72rem;
    font-weight: 700;
}

.package-status--active {
    background: rgb(220, 252, 231);
    color: rgb(22, 101, 52);
}

.package-status--draft {
    background: rgb(241, 245, 249);
    color: rgb(51, 65, 85);
}

.package-card-meta,
.package-card-price small {
    color: rgb(71, 85, 105);
    font-size: 0.78rem;
}

.package-card-price {
    display: grid;
    justify-items: end;
    gap: 0.2rem;
    white-space: nowrap;
}

.package-card-price strong {
    color: rgb(15, 23, 42);
    font-size: 1rem;
}

.package-create-inline {
    width: 100%;
    min-height: 46px;
    margin-top: 0.9rem;
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    background: rgb(255, 255, 255);
    color: rgb(30, 41, 59);
    font-weight: 700;
}

.package-detail-stack {
    min-width: 0;
}

.package-detail-panel {
    display: grid;
    gap: 0;
}

.package-detail-panel[hidden] {
    display: none;
}

.package-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
}

.package-detail-title {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.package-detail-title h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 1.5rem;
}

.package-detail-title p {
    margin: 0.25rem 0 0;
    color: rgb(71, 85, 105);
}

.package-slug-tools {
    display: grid;
    justify-items: end;
    gap: 0.3rem;
    color: rgb(71, 85, 105);
    font-size: 0.78rem;
}

.package-slug-tools code {
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    background: rgb(241, 245, 249);
    color: rgb(51, 65, 85);
    font-family: inherit;
    font-weight: 700;
}

.package-management-tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid rgb(226, 232, 240);
}

.package-management-tab {
    position: relative;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: rgb(71, 85, 105);
    cursor: pointer;
    font-weight: 700;
}

.package-management-tab.is-active {
    color: rgb(79, 70, 229);
}

.package-management-tab.is-active::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: rgb(79, 70, 229);
}

.package-tab-panel {
    padding: 1.2rem 0;
}

.package-tab-panel[hidden] {
    display: none;
}

.package-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 1rem;
}

.package-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.package-pricing-grid,
.package-ai-summary,
.package-feature-cards {
    display: grid;
    gap: 1rem;
}

.package-pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.package-price-plan,
.package-ai-summary article,
.package-feature-card {
    border: 1px solid rgb(226, 232, 240);
    border-radius: 12px;
    background: rgb(255, 255, 255);
}

.package-price-plan {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.package-price-plan strong {
    display: block;
    margin-top: 0.55rem;
    color: rgb(15, 23, 42);
    font-size: 1.8rem;
}

.package-price-plan small {
    color: rgb(71, 85, 105);
}

.package-price-plan dl {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}

.package-price-plan dl div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.package-price-plan dt {
    color: rgb(71, 85, 105);
}

.package-price-plan dd {
    margin: 0;
    color: rgb(15, 23, 42);
    font-weight: 700;
}

.package-add-price-form {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgb(226, 232, 240);
    border-radius: 12px;
}

.package-ai-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.package-ai-summary article {
    padding: 1rem;
}

.package-ai-summary span {
    color: rgb(71, 85, 105);
    font-size: 0.78rem;
    font-weight: 700;
}

.package-ai-summary strong {
    display: block;
    overflow-wrap: anywhere;
    margin-top: 0.45rem;
    color: rgb(15, 23, 42);
    font-size: 1.3rem;
}

.package-ai-summary small {
    color: rgb(71, 85, 105);
}

.package-feature-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.package-feature-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 96px;
    padding: 1rem;
}

.package-feature-card input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: rgb(79, 70, 229);
}

.package-feature-card strong,
.package-feature-card small {
    display: block;
}

.package-feature-card small {
    margin-top: 0.25rem;
    color: rgb(71, 85, 105);
}

.package-feature-card-status {
    position: absolute;
    bottom: 0.85rem;
    left: 4.8rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgb(220, 252, 231);
    color: rgb(22, 101, 52);
    font-size: 0.72rem;
    font-weight: 700;
}

.package-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 -1rem -1rem;
    padding: 1rem;
    border-top: 1px solid rgb(226, 232, 240);
    background: rgb(249, 250, 252);
}

.package-create-panel {
    margin-top: 0.5rem;
}

.package-empty-state {
    margin: 0;
    padding: 1rem;
    border: 1px dashed rgb(203, 213, 225);
    border-radius: 10px;
    color: rgb(71, 85, 105);
    background: rgb(248, 250, 252);
}

@media (max-width: 1180px) {
    .package-management-metrics,
    .package-pricing-grid,
    .package-feature-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .package-management-shell,
    .package-overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .package-management-header,
    .package-detail-header,
    .package-detail-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .package-management-actions,
    .package-management-metrics,
    .package-list-tools,
    .package-pricing-grid,
    .package-ai-summary,
    .package-feature-cards {
        grid-template-columns: 1fr;
    }

    .package-management-actions {
        display: grid;
    }

    .package-card-button {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .package-card-price {
        grid-column: 2;
        justify-items: start;
    }

    .package-management-tabs {
        gap: 0.75rem;
        overflow-x: auto;
    }
}

.app-content:has(> .package-management-page) {
    max-width: none;
    padding: 32px clamp(24px, 2.2vw, 40px) 48px;
}

.package-management-page {
    width: 100%;
    max-width: 1728px;
    margin: 0 auto;
    gap: 24px;
    color: rgb(15, 23, 42);
}

.package-management-header {
    align-items: center;
    min-height: 54px;
}

.package-management-header .page-title {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: 0;
}

.package-management-header .page-subtitle {
    max-width: 560px;
    color: rgb(55, 72, 102);
    font-size: 14px;
    line-height: 1.45;
}

.package-management-actions {
    gap: 14px;
}

.package-action-button {
    min-width: 156px;
    min-height: 40px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 800;
}

.package-management-metrics {
    gap: 20px;
}

.package-metric-card,
.package-management-panel,
.package-price-plan,
.package-ai-summary article,
.package-feature-card,
.package-form-section,
.package-add-price-form,
.package-danger-action,
.package-insight-card {
    border: 1px solid rgb(214, 224, 238);
    border-radius: 8px;
    background: rgb(255, 255, 255);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.package-metric-card {
    min-height: 162px;
    padding: 24px 28px;
    gap: 24px;
}

.package-metric-icon {
    width: 54px;
    height: 54px;
    border-radius: 8px;
}

.package-metric-label {
    color: rgb(57, 76, 111);
    font-size: 13px;
    font-weight: 800;
}

.package-metric-card strong {
    margin-top: 10px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
}

.package-metric-card small {
    margin-top: 12px;
    color: rgb(70, 88, 119);
    font-size: 13px;
}

.package-metric-link,
.package-text-button {
    display: inline-flex;
    align-items: center;
    margin-top: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgb(79, 70, 229);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.package-metric-link:hover,
.package-text-button:hover {
    color: rgb(67, 56, 202);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.package-metric-sparkline {
    right: 22px;
    bottom: 22px;
    width: 148px;
    height: 58px;
}

.package-management-shell {
    grid-template-columns: 440px minmax(0, 1fr);
    gap: 20px;
}

.package-list-panel,
.package-detail-panel,
.package-create-panel,
.package-change-panel {
    padding: 16px;
}

.package-list-panel {
    min-height: 872px;
}

.package-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    margin-bottom: 16px;
}

.package-list-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.package-list-header p {
    display: none;
}

.package-list-tools {
    grid-template-columns: minmax(160px, 1fr) 112px;
    gap: 8px;
}

.package-search .form-control,
.package-status-filter {
    height: 38px;
    border-color: rgb(203, 213, 225);
    border-radius: 7px;
    color: rgb(51, 65, 85);
    font-size: 13px;
    font-weight: 600;
}

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

.package-management-card {
    grid-template-columns: 28px minmax(0, 1fr);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    background: rgb(255, 255, 255);
}

.package-management-card.is-active {
    border-color: rgb(79, 70, 229);
    background: rgb(255, 255, 255);
    box-shadow: 0 0 0 1px rgb(79, 70, 229);
}

.package-management-card .package-drag-handle {
    width: 28px;
    height: 28px;
    margin-left: 9px;
    border-radius: 4px;
    color: rgb(71, 85, 105);
    font-size: 13px;
}

.package-card-button {
    min-height: 96px;
    padding: 14px 14px 14px 8px;
    gap: 14px;
}

.package-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
}

.package-card-title-row strong {
    font-size: 15px;
    font-weight: 800;
}

.package-status {
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.package-card-meta {
    color: rgb(57, 76, 111);
    font-size: 12px;
    line-height: 1.35;
}

.package-card-price strong {
    font-size: 17px;
    font-weight: 800;
}

.package-card-price small {
    font-size: 12px;
}

.package-create-inline {
    min-height: 42px;
    margin-top: 14px;
    border-color: rgb(203, 213, 225);
    border-radius: 7px;
    color: rgb(15, 23, 42);
    font-size: 13px;
    font-weight: 800;
}

.package-detail-panel {
    min-height: 872px;
    padding: 0;
    overflow: hidden;
}

.package-detail-header {
    min-height: 92px;
    padding: 20px 24px 16px;
}

.package-detail-title {
    align-items: center;
}

.package-detail-title .package-card-icon {
    width: 48px;
    height: 48px;
}

.package-detail-title h2 {
    font-size: 28px;
    font-weight: 800;
}

.package-detail-title p {
    max-width: 700px;
    color: rgb(57, 76, 111);
    font-size: 13px;
    line-height: 1.45;
}

.package-slug-tools {
    align-items: center;
    grid-auto-flow: column;
    justify-items: end;
    gap: 8px;
}

.package-slug-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.package-slug-tools code {
    min-height: 32px;
    padding: 8px 12px;
    border-radius: 7px;
    background: rgb(241, 245, 249);
    color: rgb(51, 65, 85);
    font-size: 12px;
}

.package-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgb(203, 213, 225);
    border-radius: 7px;
    background: rgb(255, 255, 255);
    color: rgb(51, 65, 85);
    cursor: pointer;
}

.package-icon-button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.package-icon-button.is-copied {
    border-color: rgb(16, 185, 129);
    color: rgb(5, 150, 105);
    background: rgb(236, 253, 245);
}

.package-management-tabs {
    gap: 28px;
    padding: 0 24px;
}

.package-management-tab {
    min-height: 48px;
    color: rgb(57, 76, 111);
    font-size: 13px;
    font-weight: 800;
}

.package-management-tab.is-active {
    color: rgb(79, 70, 229);
}

.package-tab-panel {
    padding: 20px 24px 0;
}

.package-overview-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.5fr);
}

.package-form-section {
    padding: 18px;
}

.package-form-section-title {
    margin-bottom: 16px;
    color: rgb(15, 23, 42);
    font-size: 15px;
    font-weight: 800;
}

.package-form-grid,
.package-price-grid {
    gap: 14px;
}

.package-form-section .form-control,
.package-add-price-form .form-control,
.superadmin-package-form .form-control {
    min-height: 38px;
    border-color: rgb(203, 213, 225);
    border-radius: 7px;
    color: rgb(15, 23, 42);
    font-size: 13px;
}

.package-field-label,
.package-add-price-form .form-label {
    color: rgb(15, 23, 42);
    font-size: 12px;
    font-weight: 800;
}

.package-overview-insights {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 16px;
    margin-top: 16px;
}

.package-insight-card {
    padding: 18px;
}

.package-insight-card h3 {
    margin: 0 0 16px;
    color: rgb(15, 23, 42);
    font-size: 15px;
    font-weight: 800;
}

.package-insight-card ul {
    display: grid;
    gap: 11px;
    margin: 0;
}

.package-insight-card li {
    position: relative;
    padding-left: 24px;
    color: rgb(30, 41, 59);
    font-size: 13px;
    line-height: 1.35;
}

.package-insight-card li::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: rgb(220, 252, 231);
    box-shadow: inset 0 0 0 1px rgb(34, 197, 94);
}

.package-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.package-snapshot-grid div {
    min-height: 74px;
    padding: 8px 16px;
    border-bottom: 1px solid rgb(226, 232, 240);
}

.package-snapshot-grid div:nth-child(odd) {
    border-right: 1px solid rgb(226, 232, 240);
}

.package-snapshot-grid div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.package-snapshot-grid span {
    display: block;
    color: rgb(71, 85, 105);
    font-size: 12px;
    font-weight: 700;
}

.package-snapshot-grid strong {
    display: block;
    margin-top: 5px;
    color: rgb(15, 23, 42);
    font-size: 20px;
    font-weight: 800;
}

.package-pricing-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.package-price-plan {
    min-height: 198px;
    padding: 18px;
}

.package-price-plan strong {
    font-size: 28px;
    font-weight: 800;
}

.package-ai-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.package-ai-summary article {
    min-height: 116px;
    padding: 18px;
}

.package-ai-summary strong {
    font-size: 22px;
    font-weight: 800;
}

.package-feature-cards {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.package-feature-card {
    min-height: 128px;
    padding: 18px;
}

.package-feature-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
}

.package-feature-card strong {
    color: rgb(15, 23, 42);
    font-size: 14px;
    font-weight: 800;
}

.package-feature-card small {
    color: rgb(57, 76, 111);
    font-size: 12px;
    line-height: 1.35;
}

.package-feature-card input[type="checkbox"] {
    position: relative;
    width: 34px;
    height: 18px;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: rgb(203, 213, 225);
    cursor: pointer;
}

.package-feature-card input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgb(255, 255, 255);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.24);
    transition: transform 150ms ease;
}

.package-feature-card input[type="checkbox"]:checked {
    background: rgb(79, 70, 229);
}

.package-feature-card input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

.package-feature-card-status {
    left: 82px;
    bottom: 18px;
}

.package-danger-action {
    margin-top: 16px;
}

.package-detail-footer {
    margin: 20px 0 0;
    padding: 16px 24px;
}

@media (max-width: 1500px) {
    .package-management-shell {
        grid-template-columns: 400px minmax(0, 1fr);
    }

    .package-feature-cards,
    .package-pricing-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 1180px) {
    .package-management-shell,
    .package-overview-grid,
    .package-overview-insights {
        grid-template-columns: 1fr;
    }

    .package-ai-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===========================
   Superadmin Packages Mockup
   =========================== */
.app-content:has(> .package-management-page) {
    max-width: none;
    padding: 1.75rem 2.25rem 2.5rem;
}

.package-management-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: none;
    width: 100%;
}

.package-management-header {
    align-items: flex-start;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.package-management-header .page-title {
    font-size: 1.5rem;
    font-weight: 750;
    line-height: 1.2;
}

.package-management-header .page-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.45;
    margin-top: 0.55rem;
    max-width: 780px;
}

.package-management-actions {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.package-action-button {
    align-items: center;
    border-radius: 0.5rem;
    display: inline-flex;
    font-size: 0.8125rem;
    font-weight: 700;
    gap: 0.5rem;
    height: 2.25rem;
    justify-content: center;
    line-height: 1;
    padding: 0 1rem;
    white-space: nowrap;
}

.package-action-button.btn-primary {
    background: var(--primary);
    border-color: transparent;
    color: var(--surface);
}

.package-create-launcher,
.package-list-panel,
.package-change-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xs);
    overflow: visible;
}

.package-create-summary {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 1.1rem 1.35rem;
    text-align: left;
    width: 100%;
}

.package-create-summary strong,
.package-summary-title strong {
    color: var(--text);
    display: inline-flex;
    font-size: 0.9375rem;
    font-weight: 750;
    line-height: 1.25;
}

.package-create-summary small,
.package-summary-meta,
.package-summary-price small {
    color: var(--text-light);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.package-create-summary__arrow svg,
.package-row-chevron svg {
    height: 1rem;
    stroke: currentColor;
    stroke-width: 2;
    width: 1rem;
}

.package-create-panel {
    border-top: 1px solid var(--border);
    padding: 0.9rem;
}

.package-list-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 0.95rem 1.35rem;
}

.package-list-header h2 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.25;
    margin: 0;
}

.package-list-header h2 span {
    color: var(--text-light);
    font-weight: 700;
}

.package-accordion-list {
    display: flex;
    flex-direction: column;
}

.package-accordion {
    border-bottom: 1px solid var(--border);
    position: relative;
}

.package-accordion:last-child {
    border-bottom: 0;
}

.package-accordion[hidden] {
    display: none;
}

.package-accordion-summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto auto minmax(170px, 1.1fr) minmax(120px, 0.7fr) minmax(140px, 0.8fr) minmax(88px, 0.42fr) minmax(88px, 0.42fr) auto;
    list-style: none;
    min-height: 3.25rem;
    padding: 0.75rem 1.25rem;
}

.package-accordion-summary::-webkit-details-marker {
    display: none;
}

.package-accordion-summary::before {
    content: none;
    display: none;
}

.package-accordion-summary::marker,
.package-row-menu > details > summary::marker {
    content: "";
}

.package-drag-handle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.375rem;
    color: var(--text-light);
    cursor: grab;
    display: inline-flex;
    height: 1.75rem;
    justify-content: center;
    padding: 0;
    width: 1.25rem;
}

.package-drag-handle svg,
.package-icon svg,
.package-row-menu svg,
.package-menu-popover svg,
.package-action-button svg {
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 1rem;
}

.package-icon {
    align-items: center;
    border-radius: 0.5rem;
    display: inline-flex;
    height: 2.2rem;
    justify-content: center;
    width: 2.2rem;
}

.package-icon--create,
.package-icon--star,
.package-icon--pilot {
    background: var(--primary-light);
    color: var(--primary);
}

.package-icon--team {
    background: var(--home-green-bg);
    color: var(--success);
}

.package-icon--business {
    background: var(--success-soft);
    color: var(--success);
}

.package-icon--enterprise {
    background: var(--warning-soft);
    color: var(--warning);
}

.package-icon--legacy {
    background: var(--bg-secondary);
    color: var(--text-light);
}

.package-summary-title {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.package-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 700;
    height: 1.35rem;
    padding: 0 0.6rem;
    white-space: nowrap;
}

.package-status--active {
    background: var(--success-soft);
    color: var(--success);
}

.package-status--draft {
    background: var(--primary-light);
    color: var(--primary);
}

.package-status--archived {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.package-summary-meta {
    min-width: 0;
}

.package-summary-meta span {
    color: var(--text-light);
}

.package-summary-price {
    align-items: baseline;
    display: flex;
    gap: 0.35rem;
    white-space: nowrap;
}

.package-summary-price strong {
    color: var(--text);
    font-size: 1rem;
    font-weight: 750;
}

.package-row-actions {
    align-items: center;
    color: var(--text-light);
    display: inline-flex;
    justify-content: flex-end;
}

.package-accordion[open] .package-row-chevron {
    transform: rotate(90deg);
}

.package-row-menu {
    position: absolute;
    right: 1.15rem;
    top: 0.7rem;
    z-index: 3;
}

.package-row-menu > details > summary {
    align-items: center;
    border-radius: 0.375rem;
    color: var(--text-light);
    cursor: pointer;
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    list-style: none;
    width: 2rem;
}

.package-row-menu > details > summary::-webkit-details-marker {
    display: none;
}

.package-menu-popover {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    min-width: 11rem;
    padding: 0.45rem;
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
}

.package-menu-popover button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.375rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 0.8125rem;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    text-align: left;
}

.package-menu-popover button:hover,
.package-menu-popover button:focus {
    background: var(--bg);
}

.package-menu-popover .is-danger {
    color: var(--danger);
}

.package-accordion-body {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0;
}

.package-expanded-grid {
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 1.25fr);
}

.package-form-section {
    border: 1px solid var(--border);
    border-left: 0;
    border-top: 0;
    margin: 0;
    min-width: 0;
    padding: 1rem 1.05rem;
}

.package-form-section--wide {
    grid-column: span 2;
}

.package-expanded-grid > .package-form-section:nth-of-type(3) {
    grid-column: auto;
}

.package-expanded-grid > .package-form-section:nth-of-type(5),
.package-expanded-grid > .package-form-section:nth-of-type(6) {
    grid-column: span 2;
}

.package-form-section legend {
    color: var(--text);
    float: left;
    font-size: 0.8125rem;
    font-weight: 750;
    line-height: 1.3;
    margin: 0 0 0.8rem;
    padding: 0;
    width: 100%;
}

.package-form-grid,
.package-form-grid--ai,
.package-add-price-grid {
    clear: both;
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.package-add-price-grid {
    align-items: end;
    grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) minmax(90px, 0.8fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 0.9fr);
    margin-top: 0.7rem;
}

.package-form-field--full {
    grid-column: 1 / -1;
}

.package-field-label,
.package-add-price-form .form-label {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 0.75rem;
    font-weight: 700;
    gap: 0.35rem;
    line-height: 1.25;
    margin: 0 0 0.42rem;
}

.package-form-section .form-control,
.package-add-price-form .form-control,
.superadmin-package-form .form-control {
    border-color: var(--border);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    min-height: 2.1rem;
    padding: 0.45rem 0.55rem;
    width: 100%;
}

.package-form-section textarea.form-control {
    min-height: 4.5rem;
    resize: vertical;
}

.package-help {
    display: inline-flex;
}

.package-help .page-info-btn {
    height: 0.95rem;
    width: 0.95rem;
}

.package-feature-grid {
    clear: both;
    display: grid;
    gap: 0.55rem 1.2rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0.8rem;
}

.package-checkbox {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 0.5rem;
}

.package-checkbox input {
    accent-color: var(--primary);
}

.package-custom-label {
    margin-top: 0.35rem;
}

.package-price-table {
    border-collapse: collapse;
    clear: both;
    width: 100%;
}

.package-price-table th,
.package-price-table td {
    border: 1px solid var(--border);
    font-size: 0.75rem;
    padding: 0.55rem 0.7rem;
    text-align: left;
}

.package-price-table th {
    background: var(--bg);
    color: var(--text);
    font-weight: 750;
}

.package-danger-action {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.package-danger-action p {
    color: var(--text-light);
    font-size: 0.8125rem;
    margin: 0.25rem 0 0;
}

.package-detail-footer,
.package-form-actions {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 0.9rem 1.05rem;
}

.package-detail-footer {
    border-top: 1px solid var(--border);
}

.package-change-panel {
    padding: 1rem 1.25rem;
}

.package-change-panel h2 {
    font-size: 0.95rem;
    margin: 0 0 0.65rem;
}

.package-change-list {
    display: grid;
    gap: 0.65rem;
}

.package-change-request {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.75rem;
}

.package-change-request__details {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.package-change-request__details span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.package-change-request__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}

.package-change-request__actions form {
    margin: 0;
}

.package-empty-state {
    color: var(--text-light);
    margin: 0;
    padding: 1.2rem;
}

@media (max-width: 1440px) {
    .package-expanded-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .package-form-section--wide {
        grid-column: 1 / -1;
    }

    .package-accordion-summary {
        grid-template-columns: auto auto minmax(150px, 1fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(80px, 0.35fr) minmax(80px, 0.35fr) auto;
    }
}

@media (max-width: 900px) {
    .app-content:has(> .package-management-page) {
        padding: 1.25rem 1rem 2rem;
    }

    .package-management-header,
    .package-management-actions,
    .package-danger-action,
    .package-detail-footer,
    .package-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .package-action-button {
        width: 100%;
    }

    .package-accordion-summary,
    .package-create-summary,
    .package-expanded-grid,
    .package-form-grid,
    .package-form-grid--ai,
    .package-add-price-grid,
    .package-feature-grid {
        grid-template-columns: 1fr;
    }

    .package-row-menu {
        right: 0.75rem;
    }
}

/* ===========================
   Workflow Navigation
   =========================== */
.workflow-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ===========================
   Tooltip (CSS-only, data-tooltip attr)
   =========================== */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.65rem;
    background: rgb(15 23 42);
    color: rgb(255, 255, 255);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
[data-tooltip]:hover::after {
    opacity: 1;
}
[data-tooltip][data-tooltip-pos="bottom"]::after {
    top: calc(100% + 6px);
    bottom: auto;
}

/* ===========================
   Accordion (used on Diagram OKRs)
   =========================== */
.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1.25rem 1rem;
}

.accordion-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 150ms ease;
}

.accordion-item--complete {
    border-color: rgb(134 239 172);
    background: rgb(240, 253, 244);
}

.accordion-item--open {
    border-color: var(--primary);
    background: rgb(255, 255, 255);
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    transition: background 150ms ease;
}

.accordion-header:hover {
    background: rgba(79, 70, 229, 0.04);
}

.accordion-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accordion-chevron {
    color: var(--text-muted);
    transition: transform 200ms ease;
}

.accordion-item--open > .accordion-header .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-body {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.accordion-item--open > .accordion-body {
    display: block;
}

/* ===========================
   Workflow Stepper (top of page)
   =========================== */
/* Compact stepper (sits inside the topbar) */
.workflow-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex: 1;
    min-width: 0;
    padding: 0 0.75rem;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    scrollbar-width: none;
}
.workflow-stepper::-webkit-scrollbar { display: none; }

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    flex: 0 1 auto;
    min-width: 58px;
    padding: 0 0.25rem;
    text-decoration: none;
    color: var(--text-light, rgb(148, 163, 184));
    font-size: 0.625rem;
    font-weight: 500;
    position: relative;
    transition: color 150ms ease;
    white-space: nowrap;
}

/* Connector line between steps - horizontal, crossing the circle midline */
.stepper-step::after {
    content: '';
    position: absolute;
    top: 9px;                       /* vertical centre of the 20px circle */
    left: calc(50% + 13px);         /* edge of circle (10px) + small gap */
    right: calc(-50% + 13px);
    height: 2px;
    background: var(--border, rgb(226, 232, 240));
    z-index: 0;
}
.stepper-step:last-child::after { display: none; }

.stepper-step-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgb(255, 255, 255);
    border: 2px solid var(--border, rgb(226, 232, 240));
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-light, rgb(148, 163, 184));
    transition: all 150ms ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.stepper-step-label {
    display: block;
    font-size: 0.625rem;
    line-height: 1.1;
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stepper-step--complete .stepper-step-circle {
    background: var(--success, rgb(5 150 105));
    border-color: var(--success, rgb(5 150 105));
    color: rgb(255, 255, 255);
}
.stepper-step--complete::after {
    background: var(--success, rgb(5 150 105));
}
.stepper-step--complete .stepper-step-label {
    color: var(--text);
}
.stepper-step--complete:hover .stepper-step-label {
    color: var(--primary);
}

.stepper-step--current .stepper-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: rgb(255, 255, 255);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.stepper-step--current .stepper-step-label {
    color: var(--primary);
    font-weight: 700;
}

.stepper-step--upcoming:hover .stepper-step-circle {
    border-color: var(--primary);
    color: var(--primary);
}
.stepper-step--upcoming:hover .stepper-step-label {
    color: var(--text);
}

@media (max-width: 1100px) {
    .stepper-step { min-width: 48px; }
    .stepper-step-label { max-width: 56px; }
    .stepper-step::after { left: calc(50% + 12px); right: calc(-50% + 12px); }
}
@media (max-width: 860px) {
    .workflow-stepper .stepper-step-label { display: none; }
    .stepper-step { min-width: 32px; }
    .stepper-step::after { left: calc(50% + 12px); right: calc(-50% + 12px); }
}
@media (max-width: 640px) {
    .workflow-stepper { display: none; }
}

/* ===========================
   Brand Logo (login page)
   =========================== */
.brand-logo {
    font-size: 2rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* === Animations ============================================================ */

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

/* === Loading States ======================================================== */

.btn-loading {
    position: relative;
    cursor: wait !important;
    opacity: 0.85;
}

.btn-loading:hover {
    transform: none !important;
}

.loading-spinner-inline {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* Processing overlay for full-page operations */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-card {
    background: white;
    border-radius: 12px;
    padding: 2rem 3rem;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.processing-card .loading-spinner {
    margin: 0 auto 1rem;
}

.processing-card p {
    color: rgb(71, 85, 105);
    font-size: 0.9375rem;
    margin: 0;
}

.processing-card__note {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.generate-status-banner {
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
}

.generate-status-banner--compact {
    font-size: 0.875rem;
    margin-bottom: 0;
    margin-top: 1.25rem;
    padding: 0.75rem;
}

.generate-status-banner--info {
    background: rgb(232 240 254);
    color: rgb(26 86 219);
}

.generate-status-banner--success {
    background: rgb(212 237 218);
    color: rgb(21 87 36);
}

.generate-status-banner--error {
    background: rgb(248 215 218);
    color: rgb(114 28 36);
}

.kr-row--dynamic {
    border-bottom: 1px solid rgb(243, 244, 246);
}

.kr-row__cell {
    padding: 4px 6px;
}

.kr-row__cell--action {
    text-align: center;
}

.kr-field--compact {
    border: 1px solid rgb(209 213 219);
    border-radius: 4px;
    padding: 3px 6px;
    width: 100%;
}

select.kr-field--compact {
    padding: 3px 4px;
}

.kr-delete-btn {
    background: none;
    border: none;
    color: rgb(239, 68, 68);
    cursor: pointer;
    font-size: 1rem;
}

.custom-mapping-row {
    border-bottom: 1px solid var(--border-color, rgb(222 226 230));
}

.custom-mapping-row__cell {
    padding: 0.5rem;
}

.custom-mapping-row__cell--action {
    text-align: center;
}

.custom-mapping-input {
    font-size: 0.85rem;
}

.custom-mapping-remove {
    background: none;
    border: none;
    color: rgb(220 53 69);
    cursor: pointer;
    font-size: 1.1rem;
}

.member-result-item {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
}

.member-chip {
    align-items: center;
    background: var(--primary);
    border-radius: 6px;
    color: rgb(255, 255, 255);
    display: inline-flex;
    font-size: 0.8rem;
    gap: 0.45rem;
    padding: 0.25rem 0.5rem;
}

.member-chip__role {
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    padding: 0.15rem 0.35rem;
}

.member-chip__remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0 0 0.2rem;
}

.git-link-empty {
    color: var(--text-muted, rgb(107, 114, 128));
    font-size: 0.8125rem;
    margin: 0;
}

.git-link-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.git-link-ref {
    font-size: 0.8125rem;
}

.git-link-status {
    font-size: 0.7rem;
    min-width: 52px;
    text-align: center;
}

.git-link-remove {
    background: none;
    border: none;
    color: var(--danger, rgb(220 53 69));
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    margin-left: auto;
    padding: 0 4px;
}

.github-repo-label--selected {
    background: var(--primary-light, rgb(239 246 255));
    border-color: var(--primary, rgb(59 130 246));
}


.jira-sync-preview-card {
    margin: 0;
    max-width: 560px;
    width: 90%;
}

.jira-sync-preview-title {
    margin: 0;
}

.jira-sync-preview-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

.jira-sync-preview-loading {
    padding: 1.5rem;
    text-align: center;
}

.jira-sync-preview-loading-spinner {
    margin: 0 auto 0.75rem;
}

.jira-sync-preview-loading-text {
    font-size: 0.875rem;
    margin: 0;
}

.jira-sync-preview-error {
    color: var(--danger);
    margin: 0;
}

.jira-sync-preview-intro {
    font-size: 0.875rem;
    margin: 0 0 1rem;
}

.jira-sync-preview-summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 1rem;
}

.jira-sync-preview-summary-card {
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.jira-sync-preview-summary-card--push {
    background: rgb(239 246 255);
}

.jira-sync-preview-summary-card--pull {
    background: rgb(240, 253, 244);
}

.jira-sync-preview-summary-count {
    font-size: 1.75rem;
    font-weight: 700;
}

.jira-sync-preview-summary-count--push {
    color: var(--primary);
}

.jira-sync-preview-summary-count--pull {
    color: var(--success);
}

.jira-sync-preview-summary-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.jira-sync-preview-section {
    margin-bottom: 0.75rem;
}

.jira-sync-preview-section-summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.jira-sync-preview-list {
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
    max-height: 200px;
    overflow-y: auto;
    padding-left: 1.5rem;
}

.jira-sync-preview-action {
    font-weight: 600;
}

.jira-sync-preview-action--new {
    color: var(--primary);
}

.jira-sync-preview-action--update {
    color: var(--success);
}

.jira-sync-preview-empty {
    color: var(--text-muted);
    margin: 0;
    padding: 1rem;
    text-align: center;
}

.jira-sync-preview-actions {
    margin-top: 1rem;
}

.jira-sync-preview-actions--footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.diagram-empty-card {
    margin: 3rem auto;
    max-width: 640px;
}

.diagram-empty-card__body {
    padding: 3rem 2rem;
    text-align: center;
}

.diagram-empty-card__icon {
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.diagram-empty-card__title {
    font-size: 1.25rem;
    margin: 0 0 0.75rem;
}

.diagram-empty-card__copy {
    margin: 0 auto 1.5rem;
    max-width: 460px;
}

.diagram-empty-card__button {
    font-size: 1rem;
    padding: 0.75rem 2rem;
}

.diagram-view__body {
    min-height: 300px;
    overflow: auto;
}

.diagram-section-title {
    margin: 0;
}

.diagram-section-subtitle {
    font-size: 0.8125rem;
}

.diagram-okr-card__body {
    padding: 0;
}

.diagram-node-key-badge {
    flex-shrink: 0;
}

.diagram-node-status-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
}

.diagram-accordion-chevron {
    flex-shrink: 0;
    margin-left: auto;
}

.diagram-form-group {
    margin-bottom: 0.75rem;
}

.diagram-form-group--flush {
    margin-bottom: 0;
}

.diagram-form-label {
    font-size: 0.75rem;
}

.diagram-form-control {
    font-size: 0.875rem;
}

.diagram-form-control--textarea {
    font-size: 0.85rem;
}

.diagram-okr-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.diagram-okr-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
}

.diagram-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.diagram-modal-form-group {
    margin: 0;
}

.diagram-required {
    color: rgb(239, 68, 68);
}

.roadmap-okr-modal {
    border-radius: 8px;
    max-width: 860px;
}

.roadmap-okr-modal .modal-body {
    padding: 1.75rem 2rem 2rem;
}

.roadmap-okr-modal .modal-footer {
    padding-inline: 2rem;
}

.roadmap-field-hint {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.45;
    margin: 0.55rem 0 0;
}

@media (max-width: 760px) {
    .mermaid-editor-modal,
    .sounding-board-modal .modal-content,
    .roadmap-okr-modal {
        max-height: calc(100vh - 24px);
    }

    .roadmap-modal-toolbar,
    .sb-config-grid {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .roadmap-modal-toolbar {
        flex-direction: column;
    }

    .roadmap-modal-toolbar__actions {
        justify-content: flex-start;
    }

    .roadmap-code-editor {
        grid-template-columns: 3.25rem minmax(0, 1fr);
    }

    .sb-config,
    .roadmap-okr-modal .modal-body {
        padding: 1.5rem;
    }
}

.diagram-node-panel {
    background: rgb(255, 255, 255);
    border-left: 1px solid var(--border, rgb(229, 231, 235));
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    right: -380px;
    top: 0;
    transition: right 0.25s ease;
    width: 360px;
    z-index: 1000;
}

.diagram-node-panel--open {
    right: 0;
}

.diagram-node-panel__header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border, rgb(229, 231, 235));
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
}

.diagram-node-panel__eyebrow {
    color: var(--primary, rgb(79, 70, 229));
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.diagram-node-panel__title {
    color: var(--text, rgb(17 24 39));
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.diagram-node-panel__close {
    background: none;
    border: none;
    color: var(--text-secondary, rgb(107, 114, 128));
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.375rem;
    line-height: 1;
    padding: 0;
}

.diagram-node-panel__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 1.25rem;
}

.diagram-node-panel__label {
    font-weight: 600;
}

.diagram-node-panel__field {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.diagram-node-panel__textarea {
    flex: 1;
    min-height: 200px;
    resize: vertical;
}

.diagram-node-panel__footer {
    border-top: 1px solid var(--border, rgb(229, 231, 235));
    padding: 1rem 1.25rem;
}

.diagram-node-panel__status {
    display: block;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    min-height: 1.2em;
}

.diagram-node-panel__save {
    width: 100%;
}

/* === Roadmap Page =========================================================== */

:root {
    --roadmap-panel-border: rgb(218 225 236);
    --roadmap-panel-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    --roadmap-muted-blue: rgb(70 87 122);
    --roadmap-pill-muted: rgb(104 116 139);
    --roadmap-blue-bg: rgb(238 244 255);
    --roadmap-blue-soft: rgb(242 246 255);
    --roadmap-blue-text: rgb(37 99 235);
    --roadmap-green-bg: rgb(238 253 247);
    --roadmap-green-border: rgb(116 223 181);
    --roadmap-green-text: rgb(5 150 105);
    --roadmap-red-bg: rgb(255 241 241);
    --roadmap-red-text: rgb(239 68 68);
    --roadmap-node-purple: rgb(79 70 229);
    --roadmap-node-purple-soft: rgb(239 237 255);
    --roadmap-connector: rgb(128 151 189);
}

html[data-theme="dark"] {
    --roadmap-panel-border: rgba(148, 163, 184, 0.28);
    --roadmap-panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
    --roadmap-muted-blue: rgb(203 213 225);
    --roadmap-pill-muted: rgb(148 163 184);
    --roadmap-blue-bg: rgba(59, 130, 246, 0.18);
    --roadmap-blue-soft: rgba(59, 130, 246, 0.12);
    --roadmap-blue-text: rgb(147 197 253);
    --roadmap-green-bg: rgba(5, 150, 105, 0.16);
    --roadmap-green-border: rgba(52, 211, 153, 0.52);
    --roadmap-green-text: rgb(110 231 183);
    --roadmap-red-bg: rgba(239, 68, 68, 0.16);
    --roadmap-red-text: rgb(252 165 165);
    --roadmap-node-purple: rgb(129 140 248);
    --roadmap-node-purple-soft: rgba(129, 140, 248, 0.16);
    --roadmap-connector: rgb(148 163 184);
}

.app-content:has(> .roadmap-page) {
    max-width: none;
}

.roadmap-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 0 auto;
    max-width: 1000px;
}

.roadmap-page__header {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.roadmap-page__title {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0 0 8px;
}

.roadmap-page__subtitle,
.roadmap-card__subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.roadmap-page__actions,
.roadmap-okr-card__actions,
.roadmap-diagram-card__controls,
.roadmap-context-card__badges {
    align-items: center;
    display: flex;
    gap: 12px;
}

.roadmap-page__actions {
    flex: 0 0 auto;
    padding-top: 6px;
}

.roadmap-context-card,
.roadmap-diagram-card,
.roadmap-okr-card {
    background: var(--surface);
    border: 1px solid var(--roadmap-panel-border);
    border-radius: 8px;
    box-shadow: var(--roadmap-panel-shadow);
}

.roadmap-context-card {
    padding: 22px 24px 24px;
}

.roadmap-card__header {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.roadmap-context-card__header {
    margin-bottom: 28px;
}

.roadmap-card__title {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    margin: 0 0 6px;
}

.roadmap-count-pill {
    border-radius: 999px;
    color: rgb(255 255 255);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 8px 14px;
    white-space: nowrap;
}

.roadmap-count-pill--primary {
    background: var(--primary);
}

.roadmap-count-pill--secondary {
    background: var(--roadmap-pill-muted);
}

.roadmap-source-group__title {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px;
}

.roadmap-source-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.roadmap-source-item {
    align-items: flex-start;
    display: flex;
    gap: 12px;
}

.roadmap-source-icon {
    align-items: center;
    background: var(--roadmap-blue-bg);
    border-radius: 6px;
    color: var(--roadmap-blue-text);
    display: inline-flex;
    flex: 0 0 auto;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.roadmap-source-icon--muted {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.roadmap-source-icon--red {
    background: var(--roadmap-red-bg);
    color: var(--roadmap-red-text);
}

.roadmap-source-icon svg {
    fill: none;
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 16px;
}

.roadmap-source-item__name,
.roadmap-source-item__meta {
    display: block;
}

.roadmap-source-item__name {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.roadmap-source-item__meta,
.roadmap-empty-copy {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
    margin: 2px 0 0;
}

.roadmap-context-card__divider {
    background: var(--border);
    height: 1px;
    margin: 22px 0 18px;
}

.roadmap-diagram-card {
    box-sizing: border-box;
    padding: 22px 24px;
}

.roadmap-diagram-card__header {
    margin-bottom: 20px;
}

.roadmap-diagram-card__controls {
    color: var(--roadmap-muted-blue);
    font-size: 13px;
    white-space: nowrap;
}

.roadmap-view-button,
.roadmap-icon-button,
.roadmap-show-all {
    background: var(--surface);
    border: 1px solid var(--roadmap-panel-border);
    color: var(--text-secondary);
}

.roadmap-view-button {
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    min-height: 34px;
    padding: 0 16px;
}

.roadmap-icon-button {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.roadmap-icon-button svg {
    fill: none;
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.roadmap-diagram-card__body {
    display: flex;
    flex-direction: column;
    min-height: 440px;
}

.roadmap-diagram-card #mermaid-output {
    align-items: center;
    background: transparent;
    border-radius: 0;
    display: flex;
    flex: 1;
    justify-content: center;
    min-height: 365px;
    overflow-x: auto;
    padding: 4px 0 16px;
    width: 100%;
}

.roadmap-diagram-card #mermaid-output svg {
    display: block;
    height: auto;
    margin: 0 auto;
    max-height: 350px;
    max-width: 100%;
    min-width: 720px;
}

.roadmap-diagram-card.is-fit #mermaid-output {
    flex: 0 0 clamp(420px, 42vw, 620px);
    height: clamp(420px, 42vw, 620px);
    min-height: 420px;
    overflow: hidden;
}

.roadmap-diagram-card.is-fit #mermaid-output svg {
    height: 100%;
    max-height: none;
    min-width: 0;
    width: 100%;
}

.roadmap-diagram-card.is-maximised {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    inset: 16px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    position: fixed;
    z-index: 1000;
}

.roadmap-diagram-card.is-maximised .roadmap-diagram-card__body {
    flex: 1;
    min-height: 0;
}

.roadmap-diagram-card.is-maximised #mermaid-output {
    flex: 1;
    height: auto;
    min-height: 0;
}

.roadmap-diagram-card.is-maximised .roadmap-diagram-legend {
    flex: 0 0 auto;
    margin-top: 16px;
}

body.roadmap-diagram-maximised {
    overflow: hidden;
}

.roadmap-diagram-card #mermaid-output svg .node rect,
.roadmap-diagram-card #mermaid-output svg .node circle,
.roadmap-diagram-card #mermaid-output svg .node ellipse,
.roadmap-diagram-card #mermaid-output svg .node polygon,
.roadmap-diagram-card #mermaid-output svg .node path {
    filter: none !important;
    rx: 6px;
}

.roadmap-diagram-legend {
    align-items: center;
    align-self: center;
    border: 1px solid var(--roadmap-panel-border);
    border-radius: 8px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 24px;
    justify-content: center;
    margin-top: auto;
    padding: 12px 18px;
}

.roadmap-diagram-legend span {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.roadmap-legend-swatch {
    border: 2px solid var(--primary);
    border-radius: 2px;
    height: 10px;
    width: 10px;
}

.roadmap-legend-swatch--market {
    border-color: var(--roadmap-green-text);
}

.roadmap-legend-swatch--capability {
    border-color: var(--warning);
}

.roadmap-legend-line {
    background: var(--roadmap-connector);
    display: inline-block;
    height: 1px;
    position: relative;
    width: 28px;
}

.roadmap-legend-line::after {
    border-bottom: 4px solid transparent;
    border-left: 5px solid var(--roadmap-connector);
    border-top: 4px solid transparent;
    content: '';
    position: absolute;
    right: -1px;
    top: -3px;
}

.roadmap-legend-line--supporting {
    background: transparent;
    border-top: 1px dashed var(--roadmap-connector);
}

.roadmap-okr-card {
    padding: 22px 24px 24px;
}

.roadmap-okr-card__header {
    margin-bottom: 22px;
}

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

.roadmap-okr-row {
    background: var(--roadmap-green-bg);
    border: 1px solid var(--roadmap-green-border);
    border-radius: 6px;
    overflow: hidden;
}

.roadmap-okr-row__header.accordion-header {
    align-items: center;
    background: transparent;
    border: 0;
    display: flex;
    gap: 12px;
    min-height: 42px;
    padding: 9px 14px;
    width: 100%;
}

.roadmap-node-key-badge {
    align-items: center;
    background: var(--roadmap-node-purple);
    border-radius: 999px;
    color: rgb(255 255 255);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.roadmap-okr-row__title {
    color: var(--text);
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
}

.roadmap-node-status-badge {
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 10px;
}

.roadmap-node-status-badge--set {
    background: var(--roadmap-green-text);
    color: rgb(255 255 255);
}

.roadmap-node-status-badge--empty {
    background: var(--roadmap-blue-bg);
    color: var(--roadmap-blue-text);
}

.roadmap-okr-row__chevron {
    color: var(--text-secondary);
    flex: 0 0 auto;
}

.roadmap-okr-row__body {
    border-top: 1px solid var(--roadmap-green-border);
    padding: 14px;
}

.roadmap-okr-row:not(.accordion-item--open) .roadmap-okr-row__body {
    display: none;
}

.roadmap-okr-row .diagram-okr-footer {
    justify-content: flex-end;
    padding: 12px 0 0;
}

.roadmap-okr-card__footer {
    display: flex;
    justify-content: center;
    padding: 18px 0 0;
}

.roadmap-show-all {
    align-items: center;
    border: 0;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    padding: 0;
}

.roadmap-show-all svg {
    fill: none;
    height: 14px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
    transition: transform var(--transition-fast);
    width: 14px;
}

.roadmap-show-all--expanded svg {
    transform: rotate(180deg);
}

@media (max-width: 1024px) {
    .roadmap-page {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .roadmap-page__header,
    .roadmap-card__header {
        flex-direction: column;
    }

    .roadmap-page__actions,
    .roadmap-okr-card__actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .roadmap-context-card,
    .roadmap-diagram-card,
    .roadmap-okr-card {
        padding: 18px;
    }

    .roadmap-diagram-card #mermaid-output svg {
        min-width: 640px;
    }
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 2.75rem;
}

.password-wrapper input[type="password"]::-ms-reveal,
.password-wrapper input[type="password"]::-ms-clear {
    display: none;
}

.password-wrapper input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.password-toggle[hidden] {
    display: none !important;
}

.password-toggle:hover {
    color: var(--text);
}

.password-toggle svg {
    display: block;
}

.password-toggle [hidden] {
    display: none !important;
}

/* Date input styling */
input[type="date"] {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    min-height: 2.375rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 150ms;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Number input styling */
input[type="number"] {
    font-family: var(--font-sans);
    font-size: 0.875rem;
}

/* Sprint generation form grid */
.sprint-gen-grid {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.sprint-gen-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.sprint-gen-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sprint-gen-field .form-control {
    min-width: 140px;
}

@media (max-width: 768px) {
    .sprint-gen-grid {
        flex-direction: column;
    }
    .sprint-gen-field .form-control {
        width: 100%;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    /* Hide UI chrome */
    .sidebar,
    .app-topbar,
    .workflow-stepper,
    .workflow-nav,
    .btn,
    .page-description,
    #sidebar-overlay,
    .modal-overlay,
    #onboarding-wizard,
    .card-header form,
    .card-header button,
    .flash-message,
    .jira-sync-form,
    .export-section,
    .toggle-text,
    form.inline-form {
        display: none !important;
    }

    /* Reset layout for print */
    .app-layout,
    .app-wrapper,
    .app-main,
    .app-content {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        background: Canvas !important;
    }

    body {
        background: Canvas !important;
        color: CanvasText !important;
        font-size: 11pt;
    }

    .card {
        border: 1px solid ButtonBorder !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 1rem !important;
    }

    .page-title {
        font-size: 18pt;
        color: CanvasText !important;
        margin: 0 0 0.5rem !important;
    }

    .page-header {
        border-bottom: 2px solid CanvasText;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem !important;
    }

    /* Heatmap printable */
    .heatmap-cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }

    /* Keep headings with content */
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    /* Avoid orphaned rows */
    .risk-row,
    .work-item-row,
    .story-row,
    .sprint-card {
        page-break-inside: avoid;
    }

    /* Expand hidden content for print */
    .hidden,
    .accordion-body {
        display: block !important;
    }

    /* Ensure SVG diagrams print */
    svg, img {
        max-width: 100% !important;
        height: auto !important;
    }

    a {
        color: CanvasText !important;
        text-decoration: none;
    }

    .badge {
        border: 1px solid ButtonBorder;
        background: Canvas !important;
        color: CanvasText !important;
    }
}

/* === View Toggle (Diagram/Executive) ======================================== */

.view-toggle {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    background: var(--bg, rgb(248 250 252));
    border: 1px solid var(--border, rgb(226, 232, 240));
    border-radius: 8px;
    gap: 0;
}

.view-toggle-btn {
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light, rgb(100, 116, 139));
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.view-toggle-btn:hover {
    color: var(--text);
}

.view-toggle-btn.is-active {
    background: var(--surface, rgb(255, 255, 255));
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* === Executive Diagram View ================================================ */

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

.exec-card {
    padding: 1rem 1.125rem;
    background: var(--surface, rgb(255, 255, 255));
    border: 1px solid var(--border, rgb(226, 232, 240));
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.exec-card:hover {
    border-color: var(--primary-light, rgb(199 210 254));
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.exec-card--has-okr {
    border-left: 3px solid var(--success, rgb(22, 163, 74));
}

.exec-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.exec-card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text, rgb(30, 41, 59));
    margin: 0 0 0.5rem;
    line-height: 1.35;
}

.exec-card-okr {
    font-size: 0.8125rem;
    color: var(--text, rgb(30, 41, 59));
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.exec-card-kr {
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-light, rgb(100, 116, 139));
    background: var(--bg, rgb(248 250 252));
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    margin: 0;
    white-space: pre-wrap;
    max-height: 140px;
    overflow: auto;
}

.exec-card-placeholder {
    font-size: 0.8125rem;
    margin: 0;
    font-style: italic;
}

/* === Row Actions Kebab Menu ================================================= */

.row-actions-menu {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
}

.row-actions-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary, rgb(100, 116, 139));
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.row-actions-toggle:hover,
.row-actions-menu--open .row-actions-toggle {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.15);
}

.row-actions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    background: var(--surface, rgb(255, 255, 255));
    border: 1px solid var(--border, rgb(226, 232, 240));
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 0.25rem;
    z-index: 50;
    display: none;
}

.row-actions-menu--open .row-actions-dropdown {
    display: block;
}

.row-actions-dropdown .row-actions-form {
    display: block;
    margin: 0;
    padding: 0;
}

.row-actions-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text, rgb(30, 41, 59));
    background: transparent;
    border: none;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
}

.row-actions-item:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}

.row-actions-item--danger {
    color: var(--danger);
}

.row-actions-item--danger:hover {
    background: var(--danger-light, rgb(254 242 242));
    color: var(--danger);
}

.row-actions-item svg {
    flex-shrink: 0;
    opacity: 0.75;
}

/* Collapse legacy action containers now that they hold a single kebab button */
.work-item-actions,
.story-actions,
.risk-actions {
    width: auto;
    min-width: 0;
    gap: 0;
}

/* -- Traceability -- */

.trace-tree {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* OKR accordion block */
.trace-okr {
    border: 1px solid var(--border, rgb(226, 232, 240));
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.trace-okr > summary {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: var(--surface-2, var(--bg));
    border-bottom: 1px solid transparent;
    flex-wrap: wrap;
}

.trace-okr > summary::-webkit-details-marker { display: none; }

.trace-okr[open] > summary {
    border-bottom-color: var(--border, rgb(226, 232, 240));
}

.trace-chevron {
    font-size: 0.6rem;
    color: var(--text-light);
    transition: transform 0.15s;
    flex-shrink: 0;
}

details[open] > summary .trace-chevron {
    transform: rotate(90deg);
}

.trace-okr-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text, rgb(30, 41, 59));
}

/* High Level Work Item row - indented inside an OKR */
.trace-work-item {
    border-top: 1px solid var(--border, rgb(226, 232, 240));
    margin-left: 1.5rem;
}

.trace-work-item > summary {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem 0.6rem 0.5rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    flex-wrap: wrap;
}

.trace-work-item > summary::-webkit-details-marker { display: none; }

.trace-work-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text, rgb(30, 41, 59));
}

.trace-work-item--empty,
.trace-story--empty {
    color: var(--text-light);
    font-style: italic;
}

/* User story row - double indented */
.trace-story {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem 1rem 0.45rem 3rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.8125rem;
    color: var(--text, rgb(51 65 85));
}

.trace-story-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Thin progress bar */
.trace-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
    flex-shrink: 0;
}

.trace-progress--meter {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
}

.trace-progress--meter::-webkit-progress-bar {
    background: var(--border);
    border-radius: 2px;
}

.trace-progress--meter::-webkit-progress-value {
    background: var(--success);
    border-radius: 2px;
}

.trace-progress--meter::-moz-progress-bar {
    background: var(--success);
    border-radius: 2px;
}

.trace-progress--summary {
    display: inline-block;
    margin-left: 0.75rem;
    vertical-align: middle;
    width: 80px;
}

.trace-empty {
    padding: 3rem 2rem;
    text-align: center;
}

.trace-empty-icon {
    margin-bottom: 1rem;
}

.trace-empty-copy {
    margin-bottom: 1rem;
}

.trace-badge {
    margin-left: 0.25rem;
}

.trace-badge--first {
    margin-left: 0.5rem;
}

.trace-badge--small {
    font-size: 0.75rem;
}

.trace-progress-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 0.35rem;
}

.trace-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-left: 0.25rem;
}

.trace-meta--first {
    margin-left: 0.5rem;
}

.trace-meta--muted {
    color: var(--text-light);
    margin-left: 0.5rem;
}

/* Git link pill */
.git-pill {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.5;
}

.git-pill--open {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary);
}

.git-pill--merged {
    background: var(--success-light, rgb(220 252 231));
    color: var(--success);
    border: 1px solid var(--success);
}

.git-pill--closed {
    background: var(--border-light);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.git-pill--unknown {
    background: var(--surface-2, var(--bg));
    color: var(--text-light);
    border: 1px solid var(--border);
}

/* Traceability redesign */

.app-content:has(> .traceability-page) {
    padding: 26px 30px 32px;
    max-width: none;
}

.traceability-page {
    --trace-text: rgb(7 25 54);
    --trace-muted: rgb(82 103 137);
    --trace-border: rgb(219 228 239);
    --trace-border-soft: rgb(233 238 246);
    --trace-surface: rgb(255 255 255);
    --trace-blue: rgb(79 70 229);
    --trace-blue-hover: rgb(91 82 240);
    --trace-green: rgb(11 166 111);
    --trace-orange: rgb(240 138 17);
    --trace-red: rgb(232 53 79);
    --trace-purple: rgb(61 51 210);
    --trace-purple-soft: rgb(239 234 255);
    --trace-green-soft: rgb(221 248 236);
    --trace-orange-soft: rgb(255 240 221);
    --trace-red-soft: rgb(255 232 237);
    --trace-neutral: rgb(86 106 133);
    --trace-neutral-soft: rgb(238 243 249);
    --trace-hover: rgb(248 251 255);
    --trace-control-border: rgb(207 217 231);
    --trace-control-border-hover: rgb(183 198 220);
    color: var(--trace-text);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.traceability-page svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.traceability-page__header,
.traceability-page__actions,
.traceability-page__title-row,
.traceability-objective-summary,
.traceability-metrics-row,
.traceability-metric,
.traceability-workflow-footer,
.traceability-footer-button,
.traceability-action,
.traceability-pro-tip,
.traceability-pro-tip__badge,
.traceability-work-item,
.traceability-work-item__meta,
.traceability-story,
.traceability-details-link {
    display: flex;
    align-items: center;
}

.traceability-page__header {
    justify-content: space-between;
    gap: 24px;
}

.traceability-page__heading {
    min-width: 0;
}

.traceability-page__title-row {
    gap: 10px;
}

.traceability-page__heading h1 {
    margin: 0;
    color: var(--trace-text);
    font-size: 27px;
    line-height: 1.18;
    font-weight: 750;
}

.traceability-page__heading p {
    margin: 10px 0 0;
    color: var(--trace-muted);
    font-size: 15px;
    line-height: 1.45;
}

.traceability-info .page-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgb(204 215 230);
    background: var(--trace-hover);
    color: rgb(114 130 160);
    font-size: 12px;
    font-weight: 700;
}

.traceability-page__actions {
    gap: 12px;
    flex-shrink: 0;
}

.traceability-action,
.traceability-footer-button,
.traceability-primary-link {
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid var(--trace-control-border);
    background: var(--trace-surface);
    color: rgb(33 53 84);
    font-size: 14px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    padding: 0 18px;
    gap: 9px;
    cursor: pointer;
}

.traceability-action:hover,
.traceability-footer-button--secondary:hover,
.traceability-primary-link:hover {
    border-color: var(--trace-control-border-hover);
    background: var(--trace-hover);
}

.traceability-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.traceability-objective-card {
    background: var(--trace-surface);
    border: 1px solid var(--trace-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.traceability-objective-summary {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    min-height: 78px;
    padding: 0 24px;
    gap: 13px;
    cursor: pointer;
    user-select: none;
}

.traceability-card-chevron {
    color: rgb(43 74 117);
    transition: transform 160ms ease;
}

.traceability-objective-card.is-open .traceability-card-chevron {
    transform: rotate(90deg);
}

.traceability-card-number {
    color: rgb(113 130 157);
    font-size: 14px;
    min-width: 14px;
    text-align: center;
}

.traceability-card-title {
    min-width: 220px;
    max-width: 390px;
    color: rgb(16 35 63);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.traceability-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

.traceability-pill--objective {
    color: var(--trace-purple);
    background: var(--trace-purple-soft);
}

.traceability-pill.is-good {
    color: rgb(0 141 99);
    background: var(--trace-green-soft);
}

.traceability-pill.is-warning {
    color: rgb(238 122 0);
    background: var(--trace-orange-soft);
}

.traceability-pill.is-danger {
    color: rgb(220 36 66);
    background: var(--trace-red-soft);
}

.traceability-pill.is-neutral {
    color: var(--trace-neutral);
    background: var(--trace-neutral-soft);
}

.traceability-key-results {
    margin-left: auto;
    color: rgb(84 105 132);
    font-size: 15px;
    white-space: nowrap;
}

.traceability-progress {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    display: inline-block;
    width: 225px;
    height: 6px;
    border-radius: 999px;
    background: rgb(229 235 243);
    overflow: hidden;
    flex-shrink: 0;
}

.traceability-progress::-webkit-progress-bar {
    background: rgb(229 235 243);
    border-radius: 999px;
}

.traceability-progress::-webkit-progress-value {
    background: var(--trace-green);
    border-radius: 999px;
}

.traceability-progress::-moz-progress-bar {
    background: var(--trace-green);
    border-radius: 999px;
}

.traceability-progress.is-warning::-webkit-progress-value {
    background: var(--trace-orange);
}

.traceability-progress.is-warning::-moz-progress-bar {
    background: var(--trace-orange);
}

.traceability-progress.is-danger::-webkit-progress-value {
    background: var(--trace-red);
}

.traceability-progress.is-danger::-moz-progress-bar {
    background: var(--trace-red);
}

.traceability-progress-value {
    color: rgb(33 53 84);
    font-size: 15px;
    min-width: 42px;
}

.traceability-metrics-row {
    min-height: 54px;
    border-top: 1px solid var(--trace-border-soft);
}

.traceability-metric {
    min-height: 54px;
    padding: 0 34px;
    gap: 10px;
    color: rgb(20 41 70);
    border-right: 1px solid var(--trace-border-soft);
    flex: 1 1 0;
}

.traceability-metric svg {
    width: 16px;
    height: 16px;
}

.traceability-metric span {
    font-size: 14px;
    white-space: nowrap;
}

.traceability-metric strong {
    color: var(--trace-blue);
    font-size: 18px;
    font-weight: 750;
}

.traceability-metric--purple { color: rgb(105 84 233); }
.traceability-metric--blue { color: rgb(36 113 243); }
.traceability-metric--teal { color: rgb(10 165 168); }
.traceability-metric--orange { color: var(--trace-orange); }
.traceability-metric--indigo { color: var(--trace-blue); }

.traceability-details-link {
    justify-content: center;
    min-width: 210px;
    min-height: 54px;
    color: var(--trace-blue);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    gap: 8px;
}

.traceability-detail-panel {
    border-top: 1px solid var(--trace-border-soft);
    background: rgb(251 253 255);
    padding: 18px 24px 22px;
}

.traceability-objective-description {
    color: var(--trace-muted);
    font-size: 14px;
    margin: 0 0 14px;
    max-width: 900px;
}

.traceability-detail-empty {
    color: var(--trace-muted);
    font-size: 14px;
}

.traceability-work-item {
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
    border-top: 1px solid var(--trace-border-soft);
}

.traceability-work-item:first-of-type {
    border-top: 0;
}

.traceability-work-item__main {
    min-width: 0;
}

.traceability-work-item h3 {
    margin: 0;
    color: rgb(16 35 63);
    font-size: 15px;
    font-weight: 750;
}

.traceability-work-item p {
    margin: 6px 0 0;
    color: var(--trace-muted);
    font-size: 13px;
    line-height: 1.4;
    max-width: 920px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.traceability-work-item__meta {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.traceability-work-item__meta span,
.traceability-story small {
    color: rgb(83 105 135);
    background: rgb(238 244 251);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 650;
}

.traceability-work-item__progress {
    display: grid;
    gap: 8px;
    min-width: 210px;
    color: rgb(33 53 84);
    font-size: 13px;
    font-weight: 700;
}

.traceability-progress--compact {
    width: 210px;
}

.traceability-story-list {
    display: grid;
    gap: 6px;
    padding: 0 0 12px 22px;
}

.traceability-story {
    min-height: 36px;
    gap: 8px;
    color: rgb(33 53 84);
    font-size: 13px;
}

.traceability-story span {
    min-width: 280px;
    max-width: 720px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.traceability-empty {
    background: var(--trace-surface);
    border: 1px solid var(--trace-border);
    border-radius: 8px;
    padding: 36px;
    text-align: center;
}

.traceability-empty h2 {
    margin: 0;
    font-size: 20px;
}

.traceability-empty p {
    margin: 10px 0 18px;
    color: var(--trace-muted);
}

.traceability-primary-link {
    display: inline-flex;
    align-items: center;
}

.traceability-workflow-footer {
    justify-content: space-between;
    gap: 24px;
    margin-top: 2px;
}

.traceability-workflow-footer > span {
    color: rgb(83 105 135);
    font-size: 14px;
}

.traceability-footer-button {
    min-width: 140px;
}

.traceability-footer-button--secondary {
    justify-content: flex-start;
}

.traceability-footer-button--primary {
    justify-content: center;
    margin-left: auto;
    color: rgb(255 255 255);
    border-color: var(--trace-blue);
    background: var(--trace-blue);
    min-width: 190px;
}

.traceability-footer-button--primary:hover {
    color: rgb(255 255 255);
    background: var(--trace-blue-hover);
}

.traceability-pro-tip {
    min-height: 48px;
    gap: 16px;
    background: rgb(236 249 243);
    border: 1px solid rgb(217 234 223);
    border-radius: 8px;
    padding: 0 18px;
    color: rgb(52 73 102);
    font-size: 14px;
}

.traceability-pro-tip__badge {
    color: rgb(0 141 99);
    font-weight: 750;
    gap: 8px;
    white-space: nowrap;
}

.traceability-pro-tip button {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: rgb(52 73 102);
    cursor: pointer;
    padding: 6px;
}

html[data-theme="dark"] .traceability-page {
    --trace-text: rgb(238 245 255);
    --trace-muted: rgb(174 187 208);
    --trace-border: rgba(148, 163, 184, 0.26);
    --trace-border-soft: rgba(148, 163, 184, 0.18);
    --trace-surface: rgba(15, 23, 42, 0.92);
}

html[data-theme="dark"] .traceability-objective-card,
html[data-theme="dark"] .traceability-empty,
html[data-theme="dark"] .traceability-action,
html[data-theme="dark"] .traceability-footer-button--secondary,
html[data-theme="dark"] .traceability-primary-link {
    background: rgba(15, 23, 42, 0.92);
    color: rgb(229 237 248);
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .traceability-detail-panel {
    background: rgba(15, 23, 42, 0.68);
}

html[data-theme="dark"] .traceability-card-title,
html[data-theme="dark"] .traceability-page__heading h1,
html[data-theme="dark"] .traceability-work-item h3 {
    color: rgb(248 251 255);
}

html[data-theme="dark"] .traceability-work-item__meta span,
html[data-theme="dark"] .traceability-story small {
    background: rgba(51, 65, 85, 0.82);
    color: rgb(217 227 242);
}

html[data-theme="dark"] .traceability-pro-tip {
    background: rgba(10, 74, 55, 0.32);
    border-color: rgba(45, 212, 151, 0.26);
}

@media (max-width: 1180px) {
    .traceability-page__header,
    .traceability-objective-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .traceability-key-results {
        margin-left: 0;
    }

    .traceability-metrics-row {
        flex-wrap: wrap;
    }

    .traceability-metric {
        flex-basis: 33.333%;
        border-bottom: 1px solid var(--trace-border-soft);
    }
}

@media (max-width: 760px) {
    .app-content:has(> .traceability-page) {
        padding: 20px 16px 28px;
    }

    .traceability-page__actions,
    .traceability-workflow-footer,
    .traceability-work-item {
        align-items: stretch;
        flex-direction: column;
    }

    .traceability-action,
    .traceability-footer-button,
    .traceability-footer-button--primary,
    .traceability-work-item__progress,
    .traceability-progress--compact {
        width: 100%;
    }

    .traceability-card-title,
    .traceability-story span {
        min-width: 0;
        max-width: 100%;
    }

    .traceability-metric {
        flex-basis: 100%;
    }
}

.app-content > :is([class$="-page"], [class*="-page "]) {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    width: 100%;
}

/* === Quality Score Pill + Breakdown ======================================== */

.quality-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0 0.4rem;
    height: 1.35rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--surface);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.js-quality-score-placeholder {
    animation: quality-pill-pulse 1.5s infinite ease-in-out;
    background: var(--border) !important;
    color: var(--text-secondary) !important;
}

.quality-tone-high { color: var(--success); }
.quality-tone-medium { color: var(--warning); }
.quality-tone-low { color: var(--danger); }
.quality-tone-bg-high { background: var(--success); }
.quality-tone-bg-medium { background: var(--warning); }
.quality-tone-bg-low { background: var(--danger); }

.quality-width-0 { width: 0%; }
.quality-width-5 { width: 5%; }
.quality-width-10 { width: 10%; }
.quality-width-15 { width: 15%; }
.quality-width-20 { width: 20%; }
.quality-width-25 { width: 25%; }
.quality-width-30 { width: 30%; }
.quality-width-35 { width: 35%; }
.quality-width-40 { width: 40%; }
.quality-width-45 { width: 45%; }
.quality-width-50 { width: 50%; }
.quality-width-55 { width: 55%; }
.quality-width-60 { width: 60%; }
.quality-width-65 { width: 65%; }
.quality-width-70 { width: 70%; }
.quality-width-75 { width: 75%; }
.quality-width-80 { width: 80%; }
.quality-width-85 { width: 85%; }
.quality-width-90 { width: 90%; }
.quality-width-95 { width: 95%; }
.quality-width-100 { width: 100%; }

@keyframes quality-pill-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.quality-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.quality-dim {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.quality-dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-dim-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.quality-dim-score {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.quality-dim-bar-track {
    height: 5px;
    background: rgb(229, 231, 235);
    border-radius: 999px;
    overflow: hidden;
    width: 100%;
}

.quality-dim-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}

.quality-dim-issue {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    padding-left: 0.5rem;
}

/* === Logo Branding ======================================================== */

.topbar-left-brand {
    display: flex;
    align-items: center;
    margin-left: 0.75rem;
    margin-right: 1.5rem;
}

.topbar-stratflow-logo {
    height: 28px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.topbar-threepoints-logo {
    height: 28px;
    width: auto;
    display: block;
    opacity: 0.9;
    flex-shrink: 0;
}

.sidebar-brand-logo {
    height: 72px;
    width: auto;
    display: block;
}

.sidebar-brand-mark-logo {
    height: 32px;
    width: 32px;
    display: block;
    object-fit: contain;
}

.public-header .logo img {
    height: 56px;
    width: auto;
    display: block;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo img {
    height: 48px;
    width: auto;
    max-width: 240px;
    display: inline-block;
}

/* === Login Page ============================================================= */

main.public-main--login {
    max-width: none;
    padding: 0;
}

.public-page--login {
    background: rgb(248, 250, 252);
}

.login-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 1fr);
    min-height: calc(100vh - 80px - 73px);
}

.login-hero {
    background: rgb(249, 250, 255);
    border-right: 1px solid rgb(226, 232, 240);
    display: flex;
    justify-content: center;
    overflow: hidden;
    padding: 3rem clamp(2rem, 7vw, 7.25rem) 2.5rem;
    position: relative;
}

.login-hero::after {
    background: rgba(238, 242, 255, 0.72);
    bottom: -130px;
    content: "";
    height: 260px;
    left: -80px;
    position: absolute;
    transform: rotate(18deg);
    width: 120%;
}

.login-hero__content {
    max-width: 640px;
    position: relative;
    width: 100%;
    z-index: 1;
}

.login-hero h1 {
    color: rgb(15, 23, 42);
    font-size: 2.75rem;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.17;
    margin: 0;
    max-width: 560px;
}

.login-hero__lede {
    color: rgb(71, 85, 105);
    font-size: 1.125rem;
    line-height: 1.65;
    margin: 1.25rem 0 2rem;
    max-width: 600px;
}

.login-feature-list {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.login-feature {
    align-items: center;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 56px minmax(0, 1fr);
}

.login-feature__icon {
    align-items: center;
    background: rgb(238, 236, 255);
    border-radius: 8px;
    color: rgb(79, 70, 229);
    display: inline-flex;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.login-feature h2 {
    color: rgb(15, 23, 42);
    font-size: 1.125rem;
    font-weight: 750;
    letter-spacing: 0;
    margin: 0 0 0.35rem;
}

.login-feature p {
    color: rgb(71, 85, 105);
    font-size: 1rem;
    line-height: 1.55;
    margin: 0;
}

.login-progress-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-height: 220px;
    padding: 1.5rem;
    position: relative;
}

.login-progress-card__header,
.login-priority-card strong {
    color: rgb(15, 23, 42);
    display: block;
    font-size: 0.9375rem;
    font-weight: 750;
}

.login-progress-chart {
    height: auto;
    margin-top: 1.25rem;
    width: 100%;
}

.login-progress-metric,
.login-priority-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    position: absolute;
}

.login-progress-metric {
    align-items: center;
    display: flex;
    gap: 0.9rem;
    min-width: 190px;
    padding: 1rem;
    right: 1.25rem;
    top: 2.25rem;
}

.login-progress-metric > span:last-child {
    color: rgb(22, 101, 52);
    font-size: 1.375rem;
    font-weight: 750;
}

.login-progress-ring {
    align-items: center;
    border: 8px solid rgb(99, 102, 241);
    border-left-color: rgb(226, 232, 240);
    border-radius: 999px;
    color: rgb(15, 23, 42);
    display: inline-flex;
    font-size: 0;
    height: 62px;
    justify-content: center;
    width: 62px;
}

.login-priority-card {
    bottom: -1.25rem;
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    right: -1.25rem;
    width: 230px;
}

.login-priority-card span {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 20px 1fr;
}

.login-priority-card i {
    color: rgb(100, 116, 139);
    font-size: 0.75rem;
    font-style: normal;
}

.login-priority-card b {
    background: rgb(99, 102, 241);
    border-radius: 999px;
    display: block;
    height: 7px;
}

.login-priority-card span:nth-child(3) b {
    width: 54%;
}

.login-priority-card span:nth-child(4) b {
    width: 72%;
}

.login-panel {
    align-items: center;
    background: rgb(255, 255, 255);
    display: flex;
    justify-content: center;
    padding: 2.5rem clamp(1.5rem, 5vw, 5.25rem);
}

.login-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    max-width: 540px;
    padding: 3rem 3rem 2.5rem;
    width: 100%;
}

.login-card__brand {
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-card__wordmark {
    align-items: center;
    color: rgb(15, 23, 42);
    display: inline-flex;
    gap: 0.6rem;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.login-card__wordmark svg {
    color: rgb(79, 70, 229);
    height: 31px;
    width: 48px;
}

.login-card__wordmark img {
    height: 40px;
    width: auto;
}

.login-card__wordmark strong {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
}

.login-card__brand p,
.login-card__heading p,
.login-contact {
    color: rgb(100, 116, 139);
    margin: 0;
}

.login-card__heading {
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-card__heading h2 {
    color: rgb(15, 23, 42);
    font-size: 1.625rem;
    font-weight: 750;
    letter-spacing: 0;
    margin: 0 0 0.5rem;
}

.login-form {
    display: grid;
    gap: 1.25rem;
}

.login-form .form-group {
    margin: 0;
}

.login-form label {
    color: rgb(15, 23, 42);
    display: block;
    font-size: 0.875rem;
    font-weight: 750;
    margin-bottom: 0.6rem;
}

.login-input-wrap {
    align-items: center;
    border: 1px solid rgb(203, 213, 225);
    border-radius: 8px;
    display: flex;
    min-height: 56px;
    padding: 0 1rem;
    position: relative;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-input-wrap:focus-within {
    border-color: rgb(79, 70, 229);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.login-input-wrap > svg {
    color: rgb(100, 116, 139);
    flex: 0 0 auto;
    margin-right: 0.75rem;
}

.login-input-wrap .form-control {
    border: 0;
    box-shadow: none;
    color: rgb(15, 23, 42);
    font-size: 1rem;
    height: 54px;
    padding: 0;
}

.login-input-wrap .form-control:focus {
    border: 0;
    box-shadow: none;
}

.login-input-wrap.password-wrapper .form-control {
    padding-right: 2.5rem;
}

.login-input-wrap .password-toggle {
    right: 0.75rem;
}

.login-form__meta {
    align-items: center;
    display: flex;
    font-size: 0.9375rem;
    justify-content: space-between;
}

.login-security-note {
    color: rgb(100, 116, 139);
}

.login-form__meta a,
.login-contact a {
    color: rgb(79, 70, 229);
    font-weight: 650;
    text-decoration: none;
}

.public-brand-mark {
    color: rgb(37, 99, 235);
    height: 27px;
    width: 42px;
}

.login-form__meta a:hover,
.login-contact a:hover {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.login-form .btn-primary {
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 750;
    min-height: 52px;
}

.login-security-card {
    align-items: center;
    background: rgb(245, 243, 255);
    border-radius: 8px;
    display: grid;
    gap: 1rem;
    grid-template-columns: 32px minmax(0, 1fr);
    margin-top: 1.5rem;
    padding: 1.25rem;
}

.login-security-card > span {
    align-items: center;
    color: rgb(79, 70, 229);
    display: inline-flex;
    justify-content: center;
}

.login-security-card strong {
    color: rgb(15, 23, 42);
    display: block;
    font-weight: 750;
    margin-bottom: 0.25rem;
}

.login-security-card p {
    color: rgb(71, 85, 105);
    font-size: 0.9375rem;
    line-height: 1.45;
    margin: 0;
}

.login-contact {
    font-size: 0.9375rem;
    margin-top: 1.75rem;
    text-align: center;
}

@media (max-width: 1180px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-hero {
        border-right: 0;
        padding-bottom: 5rem;
    }

    .login-panel {
        border-top: 1px solid rgb(226, 232, 240);
    }
}

@media (max-width: 760px) {
    .public-header .container {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
        padding-bottom: 1rem;
        padding-top: 0.75rem;
    }

    .public-header nav {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .login-hero {
        padding: 3rem 1.5rem 4rem;
    }

    .login-hero h1 {
        font-size: 2.25rem;
    }

    .login-feature {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .login-feature__icon {
        height: 52px;
        width: 52px;
    }

    .login-progress-metric,
    .login-priority-card {
        position: static;
    }

    .login-progress-card {
        display: grid;
        gap: 1rem;
    }

    .login-panel {
        padding: 2rem 1rem 3rem;
    }

    .login-card {
        padding: 2.25rem 1.25rem;
    }

    .login-form__meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* === AI Action Buttons ==================================================== */

.btn-ai {
    background-color: var(--primary);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-ai:hover,
.btn-ai:focus {
    background-color: var(--primary-dark);
    color: var(--surface);
}

/* === Prioritisation - Sticky Score Column ================================= */

#prioritisation-table th:last-child,
#prioritisation-table td:last-child {
    position: sticky;
    right: 0;
    background: rgb(255, 255, 255);
    z-index: 1;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.06);
}

/* === Prioritisation - Compact layout (no scrollbar) ====================== */

/* Tighter padding on all cells to reclaim column space */
#prioritisation-table thead th {
    padding: 0.5rem 0.5rem;
    white-space: normal;      /* allow header text to wrap rather than force width */
    line-height: 1.2;
    font-size: 0.7rem;
    min-width: 68px;          /* prevent collapse on narrow screens without table-layout:fixed */
}

/* Title column: doesn't need a min-width, just shouldn't overflow */
#prioritisation-table thead th:nth-child(2) {
    min-width: 160px;
    max-width: 400px;
    width: auto;
}

#prioritisation-table tbody td {
    padding: 0.5rem 0.5rem;
}

/* Tighter title cell */
#prioritisation-table .prio-title strong {
    font-size: 0.8125rem;
    line-height: 1.3;
}

#prioritisation-table .work-item-desc-preview {
    font-size: 0.75rem;
}

/* === Prioritisation Page Redesign ======================================== */

:root {
    --prio-panel-border: rgb(218 225 236);
    --prio-panel-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    --prio-text-muted: rgb(70 87 122);
    --prio-purple-bg: rgb(240 237 255);
    --prio-purple-text: rgb(67 56 202);
    --prio-green-bg: rgb(236 250 244);
    --prio-green-border: rgb(103 203 164);
    --prio-green-text: rgb(5 135 100);
    --prio-orange-bg: rgb(255 246 235);
    --prio-orange-border: rgb(251 170 73);
    --prio-orange-text: rgb(234 88 12);
    --prio-blue-border: rgb(121 142 245);
    --prio-table-border: rgb(230 235 244);
    --prio-pro-tip-bg: rgb(238 251 247);
    --prio-pro-tip-border: rgb(207 238 227);
}

html[data-theme="dark"] {
    --prio-panel-border: rgba(148, 163, 184, 0.28);
    --prio-panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
    --prio-text-muted: rgb(203 213 225);
    --prio-purple-bg: rgba(129, 140, 248, 0.18);
    --prio-purple-text: rgb(165 180 252);
    --prio-green-bg: rgba(5, 150, 105, 0.16);
    --prio-green-border: rgba(52, 211, 153, 0.5);
    --prio-green-text: rgb(110 231 183);
    --prio-orange-bg: rgba(249, 115, 22, 0.16);
    --prio-orange-border: rgba(251, 146, 60, 0.56);
    --prio-orange-text: rgb(253 186 116);
    --prio-blue-border: rgb(129 140 248);
    --prio-table-border: rgba(148, 163, 184, 0.22);
    --prio-pro-tip-bg: rgba(5, 150, 105, 0.14);
    --prio-pro-tip-border: rgba(5, 150, 105, 0.28);
}

.app-content:has(> .prioritisation-page) {
    max-width: none;
    padding: 26px 30px 28px;
}

.prioritisation-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    max-width: none;
    min-width: 0;
    width: 100%;
}

.prioritisation-page__header,
.prioritisation-page__actions,
.prioritisation-page__title-row,
.prioritisation-framework-card,
.prioritisation-formula-card,
.prioritisation-calculation-card,
.prioritisation-framework-select-row,
.prioritisation-score-card__header,
.prioritisation-scale,
.prioritisation-item-badges,
.prioritisation-score-card__footer,
.prioritisation-page-size,
.prioritisation-pro-tip,
.prioritisation-action-btn,
.prioritisation-rerank-btn {
    align-items: center;
    display: flex;
}

.prioritisation-page__header {
    align-items: flex-start;
    gap: 24px;
    justify-content: space-between;
}

.prioritisation-page__title-row {
    gap: 10px;
    margin-bottom: 8px;
}

.prioritisation-page__title {
    color: var(--text);
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
}

.prioritisation-info-dot,
.prioritisation-inline-info .page-info-btn,
.prioritisation-page-info .page-info-btn {
    align-items: center;
    border: 1px solid var(--prio-panel-border);
    border-radius: 999px;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    width: 18px;
}

.prioritisation-page__subtitle,
.prioritisation-score-card__header p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.prioritisation-page__actions {
    flex: 0 0 auto;
    gap: 14px;
    padding-top: 8px;
}

.prioritisation-page__actions .jira-sync-form button,
.prioritisation-action-btn {
    min-height: 40px;
}

.prioritisation-action-btn,
.prioritisation-rerank-btn {
    gap: 8px;
}

.prioritisation-action-btn svg,
.prioritisation-rerank-btn svg,
.prioritisation-refresh-btn svg,
.prioritisation-pro-tip svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.prioritisation-action-btn svg,
.prioritisation-rerank-btn svg {
    height: 16px;
    width: 16px;
}

.prioritisation-framework-card,
.prioritisation-formula-card,
.prioritisation-calculation-card,
.prioritisation-score-card {
    background: var(--surface);
    border: 1px solid var(--prio-panel-border);
    border-radius: 8px;
    box-shadow: var(--prio-panel-shadow);
    min-width: 0;
}

.prioritisation-overview-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(360px, 1fr) minmax(430px, 1.25fr) minmax(260px, 0.64fr);
}

.prioritisation-framework-card {
    align-items: stretch;
    display: flex;
    justify-content: center;
    min-height: 154px;
    padding: 28px 28px;
}

.prioritisation-framework-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prioritisation-framework-form label,
.prioritisation-calculation-card span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.prioritisation-framework-select-row {
    gap: 20px;
}

.prioritisation-framework-select {
    border-color: var(--prio-panel-border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    height: 42px;
    min-width: min(100%, 376px);
    padding: 0 14px;
}

.prioritisation-status-pill,
.prioritisation-scale-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 8px 16px;
    white-space: nowrap;
}

.prioritisation-status-pill,
.prioritisation-scale-pill--high {
    background: var(--prio-green-bg);
    color: var(--prio-green-text);
}

.prioritisation-formula-card,
.prioritisation-calculation-card {
    align-items: flex-start;
    min-height: 154px;
    padding: 26px 28px;
}

.prioritisation-formula-card {
    flex-direction: column;
    gap: 14px;
}

.prioritisation-formula-card h2 {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 15px;
    font-weight: 700;
    gap: 8px;
    line-height: 1.3;
    margin: 0;
}

.prioritisation-formula-card h2 > span:not(.page-info) {
    align-items: center;
    border: 1px solid var(--prio-panel-border);
    border-radius: 999px;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 12px;
    height: 14px;
    justify-content: center;
    width: 14px;
}

.prioritisation-formula-card__body {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(210px, 0.9fr) minmax(220px, 1fr);
    width: 100%;
}

.prioritisation-equation {
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 7px;
    color: var(--text);
    display: flex;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
}

.prioritisation-equation strong,
.prioritisation-equation b {
    font-size: 13px;
    font-weight: 800;
}

.prioritisation-equation span {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.prioritisation-equation i {
    background: var(--text);
    display: block;
    height: 1px;
    width: 100%;
}

.prioritisation-formula-terms {
    border-left: 1px solid var(--prio-table-border);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
    padding-left: 18px;
}

.prioritisation-formula-terms > dt {
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0 0 6px;
}

.prioritisation-formula-terms div {
    display: grid;
    gap: 8px;
    grid-template-columns: max-content 1fr;
}

.prioritisation-formula-terms dt {
    color: var(--text);
    font-weight: 800;
}

.prioritisation-formula-terms dd {
    margin: 0;
}

.prioritisation-calculation-card {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr auto;
}

.prioritisation-calculation-card .btn {
    grid-column: 1 / -1;
    justify-self: end;
}

.prioritisation-calculation-card > div {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prioritisation-calculation-card strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.prioritisation-refresh-btn {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.prioritisation-refresh-btn svg {
    height: 16px;
    width: 16px;
}

.prioritisation-score-card {
    padding: 26px 26px 16px;
}

.prioritisation-score-card__header {
    align-items: flex-start;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.prioritisation-score-card__header h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 6px;
}

.prioritisation-scale {
    gap: 18px;
    padding-top: 2px;
}

.prioritisation-scale-pill--low {
    background: var(--prio-purple-bg);
    color: var(--prio-purple-text);
}

.prioritisation-scale-pill--medium {
    background: var(--prio-orange-bg);
    color: var(--prio-orange-text);
}

.prioritisation-table-wrap {
    border: 1px solid var(--prio-table-border);
    max-width: 100%;
    overflow-x: auto;
}

.prioritisation-table {
    border-collapse: collapse;
    min-width: 1320px;
    table-layout: fixed;
    width: 100%;
}

#prioritisation-table.prioritisation-table th:last-child,
#prioritisation-table.prioritisation-table td:last-child {
    background: transparent;
    box-shadow: none;
    position: static;
}

.prioritisation-table thead th {
    background: var(--surface);
    border-bottom: 1px solid var(--prio-table-border);
    border-right: 1px solid var(--prio-table-border);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    padding: 18px 20px;
    text-align: left;
    text-transform: none;
    vertical-align: middle;
}

.prioritisation-table thead th:last-child,
.prioritisation-table tbody td:last-child {
    border-right: 0;
}

.prioritisation-table thead th span {
    color: var(--text-secondary);
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.prioritisation-help-icon {
    align-items: center;
    border: 1px solid var(--prio-blue-border);
    border-radius: 999px;
    color: var(--prio-text-muted);
    display: inline-flex;
    font-size: 10px;
    font-style: normal;
    height: 14px;
    justify-content: center;
    margin-left: 12px;
    width: 14px;
}

.prioritisation-table tbody td {
    border-bottom: 1px solid var(--prio-table-border);
    border-right: 1px solid var(--prio-table-border);
    padding: 17px 20px;
    vertical-align: middle;
}

.prioritisation-table tbody tr:last-child td {
    border-bottom: 0;
}

.prioritisation-col-rank,
.prioritisation-rank-cell {
    text-align: center;
    width: 62px;
}

.prioritisation-col-title {
    width: 360px;
}

.prioritisation-col-score {
    width: 170px;
}

.prioritisation-col-final,
.prioritisation-final-cell {
    text-align: center;
    width: 156px;
}

.prioritisation-col-actions,
.prioritisation-row-actions {
    text-align: center;
    width: 54px;
}

.prioritisation-rank {
    align-items: center;
    background: var(--prio-purple-bg);
    border-radius: 999px;
    color: var(--prio-purple-text);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.prioritisation-title-cell strong {
    color: var(--text);
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 7px;
}

.prioritisation-item-badges {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.prioritisation-item-badge {
    background: var(--bg-secondary);
    border-radius: 999px;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 10px;
}

.prioritisation-item-badge--jira {
    background: var(--primary);
    color: rgb(255 255 255);
}

.prioritisation-title-cell .work-item-desc-preview {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
}

.prioritisation-score-cell {
    text-align: center;
}

.prioritisation-score-select.score-dropdown {
    appearance: auto;
    background: var(--surface);
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    height: 40px;
    min-width: 118px;
    padding: 0 13px;
    text-align: left;
    width: 118px;
}

.prioritisation-score-select--low {
    border-color: var(--prio-blue-border);
    color: var(--primary);
}

.prioritisation-score-select--medium {
    border-color: var(--prio-orange-border);
    color: var(--prio-orange-text);
}

.prioritisation-score-select--high {
    border-color: var(--prio-green-border);
    color: var(--prio-green-text);
}

.prioritisation-score-select--empty {
    color: var(--text-secondary);
}

.prioritisation-final-score.final-score {
    border-radius: 999px;
    box-shadow: none;
    font-size: 15px;
    font-weight: 800;
    min-width: 58px;
    padding: 9px 14px;
}

.prioritisation-final-score--low {
    background: var(--prio-purple-bg);
    color: var(--prio-purple-text);
}

.prioritisation-final-score--medium {
    background: var(--prio-orange-bg);
    color: var(--prio-orange-text);
}

.prioritisation-final-score--high {
    background: var(--prio-green-bg);
    color: var(--prio-green-text);
}

.prioritisation-score-card__footer {
    justify-content: flex-start;
    padding-top: 12px;
}

.prioritisation-score-card__tools {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prioritisation-rerank-btn {
    min-height: 34px;
}

.prioritisation-page-size {
    color: var(--text-secondary);
    flex: 0 0 auto;
    font-size: 13px;
    gap: 12px;
}

.prioritisation-page-size span {
    white-space: nowrap;
}

.prioritisation-page-size select {
    border-color: var(--prio-panel-border);
    border-radius: 6px;
    color: var(--text);
    font-weight: 700;
    height: 38px;
    min-width: 82px;
    padding: 0 12px;
}

.prioritisation-row-actions a {
    color: var(--text-secondary);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2px;
    text-decoration: none;
}

.prioritisation-pro-tip {
    background: var(--prio-pro-tip-bg);
    border: 1px solid var(--prio-pro-tip-border);
    border-radius: 8px;
    color: var(--text-secondary);
    gap: 14px;
    min-height: 48px;
    padding: 0 18px;
}

.prioritisation-pro-tip > svg {
    color: var(--prio-green-text);
    height: 18px;
    width: 18px;
}

.prioritisation-pro-tip strong {
    color: var(--prio-green-text);
    font-size: 13px;
}

.prioritisation-pro-tip span {
    flex: 1;
    font-size: 13px;
}

.prioritisation-pro-tip kbd {
    background: var(--surface);
    border: 1px solid var(--prio-panel-border);
    border-radius: 5px;
    color: var(--text);
    font: inherit;
    padding: 2px 8px;
}

.prioritisation-pro-tip button {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

@media (max-width: 1024px) {
    .prioritisation-overview-grid {
        grid-template-columns: 1fr;
    }

    .prioritisation-formula-card__body {
        grid-template-columns: 1fr;
    }

    .prioritisation-formula-terms {
        border-left: 0;
        border-top: 1px solid var(--prio-table-border);
        padding-left: 0;
        padding-top: 14px;
    }
}

@media (max-width: 768px) {
    .prioritisation-page__header,
    .prioritisation-score-card__header {
        flex-direction: column;
    }

    .prioritisation-page__actions,
    .prioritisation-scale {
        flex-wrap: wrap;
        width: 100%;
    }

    .prioritisation-framework-select {
        min-width: 0;
        width: 100%;
    }

    .app-content:has(> .prioritisation-page) {
        padding: 20px 16px 28px;
    }

    .prioritisation-score-card {
        padding: 20px 14px 14px;
    }

    .prioritisation-score-card__footer,
    .prioritisation-score-card__tools,
    .prioritisation-page-size,
    .prioritisation-pro-tip {
        align-items: stretch;
        flex-direction: column;
    }
}

/* === Closed item indicator ================================================ */

.risk-row[data-closed="1"],
summary.story-row[data-closed="1"],
summary.work-item-row[data-closed="1"] {
    opacity: 0.55;
}

.risk-row[data-closed="1"] strong,
summary.story-row[data-closed="1"] strong,
summary.work-item-row[data-closed="1"] strong {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* === Executive Dashboard ================================================== */

.exec-page-timestamp {
    font-size: 0.8125rem;
    color: rgb(100, 116, 139);
}

.exec-status-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 0;
}

.exec-status-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(226, 232, 240);
    border-top-width: 3px;
    border-radius: 8px;
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.exec-status-card--muted { border-top-color: rgb(156, 163, 175); }
.exec-status-card--success { border-top-color: rgb(16, 185, 129); }
.exec-status-card--warning { border-top-color: rgb(245, 158, 11); }
.exec-status-card--danger { border-top-color: rgb(239, 68, 68); }

.exec-status-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(148, 163, 184);
    margin-bottom: 6px;
    font-weight: 600;
}

.exec-status-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.exec-status-value--muted { color: rgb(156, 163, 175); }
.exec-status-value--success { color: rgb(16, 185, 129); }
.exec-status-value--warning { color: rgb(245, 158, 11); }
.exec-status-value--danger { color: rgb(239, 68, 68); }

.exec-status-sub {
    font-size: 0.8rem;
    color: rgb(100, 116, 139);
}

.exec-status-note {
    font-weight: 600;
}

.exec-status-note--muted {
    font-size: 0.75rem;
    color: rgb(156, 163, 175);
}

.exec-status-note--neutral {
    font-weight: 400;
    color: rgb(100, 116, 139);
}

.exec-status-note--success { color: rgb(16, 185, 129); }
.exec-status-note--warning { color: rgb(245, 158, 11); }
.exec-status-note--amber { color: rgb(217, 119, 6); }
.exec-status-note--danger { color: rgb(239, 68, 68); }

.exec-status-link-hint {
    margin-top: 4px;
    font-size: 0.72rem;
    color: rgb(165, 180, 252);
}

.exec-status-card--link {
    cursor: pointer;
    display: block;
    transition: box-shadow 0.15s, transform 0.1s;
    text-decoration: none;
}

.exec-status-card--link:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.card--attention {
    border-left: 4px solid rgb(239, 68, 68);
    margin-bottom: 2rem;
}

.card-title--danger {
    color: rgb(220, 38, 38);
}

.exec-section-eyebrow {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(148, 163, 184);
    font-weight: 700;
}

.exec-section-eyebrow--bordered {
    border-top: 1px solid rgb(243, 244, 246);
    margin-top: 0.25rem;
}

.exec-stack {
    padding: 0 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exec-stack--spacious {
    padding-bottom: 1rem;
}

.exec-inline-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: rgb(220, 38, 38);
    color: rgb(255, 255, 255);
    border-color: rgb(220, 38, 38);
}

.btn-secondary {
    background: rgb(255, 255, 255);
    color: rgb(100, 116, 139);
    border: 1px solid rgb(203, 213, 225);
}

.exec-okr-meta {
    font-size: 0.75rem;
    color: rgb(100, 116, 139);
}

.exec-card-body {
    padding: 0 1.25rem 1.25rem;
}

.exec-empty-copy {
    color: rgb(156, 163, 175);
    font-size: 0.875rem;
    padding: 1rem 0;
}

.exec-link-inline {
    color: rgb(99, 102, 241);
}

.exec-project-heading {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exec-project-heading__name {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.exec-project-link {
    font-size: 0.75rem;
    color: rgb(99, 102, 241);
    text-decoration: none;
}

.okr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.375rem;
    background: rgb(249, 250, 251);
    border: 1px solid rgb(241, 245, 249);
    gap: 1rem;
}

.okr-row:hover { background: rgb(241, 245, 249); }

.okr-row-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.okr-row-right {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.okr-status-pill {
    display: inline-block;
    color: rgb(255, 255, 255);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.okr-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(30, 41, 59);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

a.okr-title:hover {
    color: rgb(79, 70, 229);
    text-decoration: underline;
}

.okr-details { margin-bottom: 0.375rem; }
.okr-details > summary { display: flex; }
.okr-details > summary::-webkit-details-marker { display: none; }
.okr-details[open] > summary .okr-expand-icon { transform: rotate(90deg); }

.okr-expand-icon {
    font-size: 0.6rem;
    color: rgb(148, 163, 184);
    flex-shrink: 0;
    transition: transform 0.15s ease;
    margin-right: 2px;
    line-height: 1.6;
}

.okr-kr-list {
    margin: 0.25rem 0 0.5rem 2.5rem;
    border-left: 2px solid rgb(224, 231, 255);
    padding-left: 0.75rem;
}

.okr-kr-item {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.25rem;
    background: rgb(250, 251, 255);
    border-radius: 4px;
    font-size: 0.8rem;
}

.okr-kr-num {
    color: rgb(99, 102, 241);
    font-weight: 700;
    white-space: nowrap;
    min-width: 1.2rem;
    font-size: 0.75rem;
}

.okr-kr-text {
    color: rgb(55, 65, 81);
    line-height: 1.4;
}

.okr-kr-item--structured {
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
}

.okr-kr-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.okr-kr-item-header .okr-kr-text {
    flex: 1;
    font-size: 0.8rem;
}

.okr-kr-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.okr-kr-status-badge--success { background: rgb(209, 250, 229); color: rgb(16, 185, 129); }
.okr-kr-status-badge--warning { background: rgb(254, 243, 199); color: rgb(245, 158, 11); }
.okr-kr-status-badge--danger { background: rgb(254, 226, 226); color: rgb(239, 68, 68); }
.okr-kr-status-badge--muted { background: rgb(243, 244, 246); color: rgb(156, 163, 175); }
.okr-kr-status-badge--primary { background: rgb(224, 231, 255); color: rgb(99, 102, 241); }

.okr-kr-progress-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.okr-kr-bar-track {
    flex: 1;
    height: 5px;
    background: rgb(229, 231, 235);
    border-radius: 999px;
    overflow: hidden;
}

.okr-kr-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}

.okr-kr-progress-text {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 2.5rem;
    text-align: right;
}

.okr-kr-progress-text--success { color: rgb(16, 185, 129); }
.okr-kr-progress-text--warning { color: rgb(245, 158, 11); }
.okr-kr-progress-text--danger { color: rgb(239, 68, 68); }
.okr-kr-progress-text--muted { color: rgb(156, 163, 175); }
.okr-kr-progress-text--primary { color: rgb(99, 102, 241); }

.okr-kr-values {
    font-size: 0.68rem;
    color: rgb(148, 163, 184);
    white-space: nowrap;
}

.exec-risk-item {
    display: block;
    background: rgb(249, 250, 251);
    border: 1px solid rgb(241, 245, 249);
    border-radius: 6px;
    margin-bottom: 0.375rem;
    overflow: hidden;
}

.exec-risk-item--plain {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
}

.exec-risk-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.exec-risk-summary::-webkit-details-marker { display: none; }
.exec-risk-item[open] .exec-risk-expand-icon { transform: rotate(90deg); }

.exec-risk-expand-icon {
    font-size: 0.6rem;
    color: rgb(148, 163, 184);
    flex-shrink: 0;
    transition: transform 0.15s ease;
    line-height: 1.6;
}

.exec-risk-item:hover .exec-risk-summary,
.exec-risk-item--plain:hover { background: rgb(241, 245, 249); }

.exec-risk-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(30, 41, 59);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exec-risk-project {
    font-size: 0.8rem;
    color: rgb(100, 116, 139);
    white-space: nowrap;
    flex-shrink: 0;
}

.exec-risk-scores {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.exec-risk-detail {
    padding: 0.5rem 0.75rem 0.75rem 2.1rem;
    border-top: 1px solid rgb(241, 245, 249);
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.exec-action-card {
    border-radius: 8px;
    border: 1px solid rgb(226, 232, 240);
    padding: 0.875rem 1rem;
    background: rgb(255, 255, 255);
}

.exec-action-card--danger { border-left: 3px solid rgb(239, 68, 68); }
.exec-action-card--warning { border-left: 3px solid rgb(245, 158, 11); }

.exec-action-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.exec-action-type-pill {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 0.4rem;
}

.exec-action-type-pill--danger { background: rgb(254, 226, 226); color: rgb(220, 38, 38); }
.exec-action-type-pill--warning { background: rgb(254, 243, 199); color: rgb(217, 119, 6); }

.exec-action-project {
    font-size: 0.82rem;
    color: rgb(71, 85, 105);
    font-weight: 500;
}

.exec-action-age {
    font-size: 0.72rem;
    color: rgb(148, 163, 184);
    white-space: nowrap;
    flex-shrink: 0;
}

.exec-action-message {
    font-size: 0.875rem;
    color: rgb(55, 65, 81);
    margin: 0 0 0.6rem;
    line-height: 1.45;
}

.exec-action-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid rgb(243, 244, 246);
    padding-top: 0.6rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.exec-action-ask {
    font-size: 0.8rem;
    color: rgb(100, 116, 139);
}

.exec-action-ask strong {
    color: rgb(30, 41, 59);
}

.okr-row--interactive {
    cursor: pointer;
    list-style: none;
}

.okr-row-right--spaced {
    gap: 0.5rem;
}

.okr-progress {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.okr-progress__track {
    width: 60px;
    background: rgb(229, 231, 235);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.okr-progress__meter {
    width: 60px;
    height: 6px;
    display: block;
    border: 0;
    appearance: none;
    background: rgb(229, 231, 235);
    border-radius: 999px;
    overflow: hidden;
}

.okr-progress__meter::-webkit-progress-bar {
    background: rgb(229, 231, 235);
    border-radius: 999px;
}

.okr-progress__meter::-webkit-progress-value {
    border-radius: 999px;
}

.okr-progress__meter::-moz-progress-bar {
    border-radius: 999px;
}

.okr-progress__meter--success { accent-color: rgb(16, 185, 129); }
.okr-progress__meter--warning { accent-color: rgb(245, 158, 11); }
.okr-progress__meter--primary { accent-color: rgb(99, 102, 241); }

.okr-progress__value {
    font-size: 0.7rem;
    font-weight: 700;
}

.okr-progress__value--success { color: rgb(16, 185, 129); }
.okr-progress__value--warning { color: rgb(245, 158, 11); }
.okr-progress__value--primary { color: rgb(99, 102, 241); }

.okr-row-meta {
    font-size: 0.75rem;
    color: rgb(107, 114, 128);
}

.okr-row-meta--muted {
    color: rgb(156, 163, 175);
}

.okr-stories-summary {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgb(241, 245, 249);
    border-radius: 4px;
    font-size: 0.75rem;
    color: rgb(107, 114, 128);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.okr-indent-spacer {
    display: inline-block;
    width: 10px;
}

.exec-card-title-meta {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgb(100, 116, 139);
}

.exec-risk-ref {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(99, 102, 241);
    flex-shrink: 0;
    min-width: 3.5rem;
}

.exec-risk-likelihood {
    color: rgb(100, 116, 139);
    font-size: 0.8rem;
}

.exec-risk-priority {
    font-weight: 700;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.exec-risk-priority--danger { background: rgb(254, 226, 226); color: rgb(239, 68, 68); }
.exec-risk-priority--warning { background: rgb(254, 243, 199); color: rgb(245, 158, 11); }
.exec-risk-priority--success { background: rgb(240, 253, 244); color: rgb(16, 185, 129); }

.exec-risk-description {
    margin: 0 0 0.4rem;
    color: rgb(55, 65, 81);
}

.exec-risk-mitigation {
    background: rgb(240, 253, 244);
    border-left: 3px solid rgb(16, 185, 129);
    padding: 0.4rem 0.6rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.8rem;
    color: rgb(6, 95, 70);
}

.exec-risk-mitigation-label {
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: rgb(22, 163, 74);
}

.exec-risk-mitigation-text {
    margin-left: 0.3rem;
}

.exec-risk-indent-spacer {
    display: inline-block;
    width: 14px;
    flex-shrink: 0;
}

/* === Executive Dashboard Redesign ======================================== */

.app-content:has(> .executive-dashboard-page) {
    max-width: none;
}

.executive-dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1540px;
    margin: 0 auto;
}

.executive-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.executive-dashboard-heading {
    min-width: 0;
}

.executive-dashboard-title-row,
.executive-dashboard-actions,
.executive-panel-heading,
.executive-review-topline,
.executive-review-actions,
.executive-okr-progress {
    display: flex;
    align-items: center;
}

.executive-dashboard-title-row {
    gap: 0.5rem;
}

.executive-dashboard-title {
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.18;
}

.executive-info-dot .page-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border: 1px solid rgb(203, 213, 225);
    border-radius: 999px;
    color: rgb(100, 116, 139);
    font-size: 0.75rem;
    font-weight: 700;
}

.executive-dashboard-subtitle {
    margin: 0.625rem 0 0;
    color: rgb(71, 85, 105);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.executive-dashboard-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.875rem;
}

.executive-as-of {
    color: rgb(51, 65, 85);
    font-size: 0.875rem;
    white-space: nowrap;
}

.executive-action-button,
.executive-small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.executive-action-button {
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0 1rem;
    border: 1px solid rgb(214, 218, 225);
    color: rgb(30, 41, 59);
    background: rgb(255, 255, 255);
    font-size: 0.875rem;
}

.executive-action-button svg,
.executive-small-button svg,
.executive-metric-icon svg,
.executive-okr-expand svg,
.executive-highlight svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.executive-action-button--primary {
    min-width: 9.25rem;
    color: rgb(255, 255, 255);
    border-color: rgb(79, 70, 229);
    background: rgb(79, 70, 229);
}

.executive-action-button--secondary:hover,
.executive-small-button--secondary:hover {
    border-color: rgb(148, 163, 184);
    background: rgb(248, 250, 252);
}

.executive-action-button--primary:hover,
.executive-small-button--primary:hover {
    background: rgb(91, 82, 240);
}

.executive-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.executive-metric-card,
.executive-panel {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(229, 231, 235);
    border-radius: 1rem;
}

.executive-metric-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    min-height: 10rem;
    padding: 1.5rem;
}

.executive-metric-icon,
.executive-highlight > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.875rem;
}

.executive-metric-card--green .executive-metric-icon,
.executive-highlight--green > span {
    color: rgb(5, 150, 105);
    background: rgb(220, 252, 231);
}

.executive-metric-card--red .executive-metric-icon {
    color: rgb(225, 29, 72);
    background: rgb(255, 228, 230);
}

.executive-metric-card--amber .executive-metric-icon,
.executive-highlight--amber > span {
    color: rgb(217, 119, 6);
    background: rgb(254, 243, 199);
}

.executive-metric-card--blue .executive-metric-icon,
.executive-highlight--blue > span {
    color: rgb(37, 99, 235);
    background: rgb(219, 234, 254);
}

.executive-highlight--purple > span {
    color: rgb(109, 40, 217);
    background: rgb(237, 233, 254);
}

.executive-metric-label {
    margin: 0 0 0.5rem;
    color: rgb(71, 85, 105);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.executive-metric-value {
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.executive-metric-copy,
.executive-metric-note,
.executive-panel-meta,
.executive-empty-state,
.executive-review-meta,
.executive-risk-context,
.executive-highlight p {
    color: rgb(71, 85, 105);
}

.executive-metric-copy {
    margin: 0.375rem 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
}

.executive-metric-note {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
}

.executive-meter-progress,
.executive-bar-progress {
    display: block;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 999px;
    background: rgb(226, 232, 240);
}

.executive-meter-progress {
    width: 100%;
    height: 0.5rem;
    margin-top: 0.75rem;
}

.executive-meter-progress::-webkit-progress-bar,
.executive-bar-progress::-webkit-progress-bar {
    border-radius: 999px;
    background: rgb(226, 232, 240);
}

.executive-meter-progress::-webkit-progress-value,
.executive-bar-progress::-webkit-progress-value,
.executive-meter-progress::-moz-progress-bar,
.executive-bar-progress::-moz-progress-bar {
    border-radius: 999px;
    background: rgb(16, 185, 129);
}

.executive-meter-progress--blue::-webkit-progress-value,
.executive-meter-progress--blue::-moz-progress-bar {
    background: rgb(79, 70, 229);
}

.executive-card-link,
.executive-section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: rgb(79, 70, 229);
    font-weight: 700;
    text-decoration: none;
}

.executive-card-link {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.executive-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.9fr);
    gap: 1rem;
}

.executive-primary-column,
.executive-secondary-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.executive-panel {
    padding: 1.25rem;
}

.executive-panel-heading {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.executive-panel-title {
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.25;
}

.executive-panel-title--danger {
    color: rgb(225, 29, 72);
}

.executive-panel-meta {
    font-size: 0.875rem;
    white-space: nowrap;
}

.executive-review-list,
.executive-okr-list,
.executive-risk-list,
.executive-highlight-list {
    display: flex;
    flex-direction: column;
}

.executive-review-list,
.executive-highlight-list {
    gap: 1rem;
}

.executive-review-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem 1rem;
    padding: 1rem 1rem 1rem 1.25rem;
    border: 1px solid rgb(254, 202, 202);
    border-left: 3px solid rgb(244, 63, 94);
    border-radius: 0.75rem;
    background: rgb(255, 255, 255);
}

.executive-review-topline {
    grid-column: 1 / -1;
    gap: 0.75rem;
    min-width: 0;
}

.executive-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.executive-status-pill--amber {
    color: rgb(180, 83, 9);
    background: rgb(254, 243, 199);
}

.executive-review-project {
    color: rgb(71, 85, 105);
    font-size: 0.875rem;
    font-weight: 700;
}

.executive-review-meta {
    margin-left: auto;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.executive-review-copy,
.executive-review-title {
    margin: 0;
    color: rgb(30, 41, 59);
    font-size: 0.875rem;
    line-height: 1.45;
}

.executive-review-title {
    grid-column: 1 / 2;
    font-weight: 700;
}

.executive-review-actions {
    grid-column: 2 / 3;
    grid-row: 2 / 4;
    align-self: center;
    gap: 0.625rem;
}

.executive-small-button {
    min-height: 2.25rem;
    padding: 0 1rem;
    border: 1px solid rgb(203, 213, 225);
    background: rgb(255, 255, 255);
    color: rgb(30, 41, 59);
    font-size: 0.8125rem;
    cursor: pointer;
}

.executive-small-button--primary {
    color: rgb(255, 255, 255);
    border-color: rgb(79, 70, 229);
    background: rgb(79, 70, 229);
}

.executive-section-link {
    margin-top: 1rem;
    font-size: 0.9375rem;
}

.executive-okr-list {
    border: 1px solid rgb(229, 231, 235);
    border-radius: 0.75rem;
    overflow: hidden;
}

.executive-okr-row,
.executive-risk-row {
    display: grid;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    border-bottom: 1px solid rgb(229, 231, 235);
    background: rgb(255, 255, 255);
}

.executive-okr-row {
    grid-template-columns: auto auto minmax(0, 1fr) minmax(160px, 0.25fr);
    min-height: 2.75rem;
    padding: 0 0.75rem;
}

.executive-okr-row--expanded {
    align-items: start;
    padding-bottom: 0.875rem;
}

.executive-okr-row:last-child,
.executive-risk-row:last-child {
    border-bottom: 0;
}

.executive-okr-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border: 0;
    border-radius: 0.5rem;
    background: rgb(248, 250, 252);
    color: rgb(71, 85, 105);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.executive-okr-expand:hover {
    background: rgb(238, 242, 255);
    color: rgb(79, 70, 229);
}

.executive-okr-row--expanded .executive-okr-expand svg {
    transform: rotate(90deg);
}

.executive-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
}

.executive-dot--green {
    background: rgb(16, 185, 129);
}

.executive-dot--amber {
    background: rgb(245, 158, 11);
}

.executive-dot--red {
    background: rgb(244, 63, 94);
}

.executive-okr-title {
    overflow: hidden;
    color: rgb(30, 41, 59);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.executive-okr-progress {
    gap: 0.75rem;
    justify-content: flex-end;
}

.executive-okr-details {
    display: grid;
    grid-column: 1 / -1;
    gap: 0.75rem;
    padding: 0.875rem 0 0.125rem 2.375rem;
    border-top: 1px solid rgb(226, 232, 240);
}

.executive-okr-details[hidden] {
    display: none;
}

.executive-okr-detail-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.executive-okr-detail-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0 0.625rem;
    border-radius: 999px;
    background: rgb(248, 250, 252);
    color: rgb(71, 85, 105);
    font-size: 0.75rem;
    font-weight: 700;
}

.executive-okr-description {
    margin: 0;
    color: rgb(71, 85, 105);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.executive-okr-detail-grid {
    display: grid;
    gap: 0.5rem;
}

.executive-okr-kr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid rgb(226, 232, 240);
    border-radius: 0.625rem;
    background: rgb(248, 250, 252);
}

.executive-okr-kr strong {
    color: rgb(30, 41, 59);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.executive-okr-kr span {
    flex: 0 0 auto;
    color: rgb(79, 70, 229);
    font-size: 0.75rem;
    font-weight: 800;
}

.executive-bar-progress {
    width: min(100%, 8.5rem);
    height: 0.375rem;
}

.executive-bar-progress--green::-webkit-progress-value,
.executive-bar-progress--green::-moz-progress-bar {
    background: rgb(16, 185, 129);
}

.executive-bar-progress--amber::-webkit-progress-value,
.executive-bar-progress--amber::-moz-progress-bar {
    background: rgb(249, 115, 22);
}

.executive-bar-progress--red::-webkit-progress-value,
.executive-bar-progress--red::-moz-progress-bar {
    background: rgb(225, 29, 72);
}

.executive-percent {
    min-width: 2.5rem;
    color: rgb(30, 41, 59);
    font-size: 0.875rem;
    font-weight: 800;
    text-align: right;
}

.executive-risk-list {
    overflow: hidden;
    border: 1px solid rgb(229, 231, 235);
    border-radius: 0.75rem;
}

.executive-risk-row {
    grid-template-columns: 4.25rem minmax(0, 1fr) auto auto;
    min-height: 3rem;
    padding: 0.625rem 0.75rem;
}

.executive-risk-ref {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    padding: 0 0.625rem;
    border-radius: 0.5rem;
    color: rgb(79, 70, 229);
    background: rgb(238, 242, 255);
    font-size: 0.75rem;
    font-weight: 800;
}

.executive-risk-title {
    overflow: hidden;
    color: rgb(30, 41, 59);
    font-size: 0.8125rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.executive-risk-context {
    font-size: 0.8125rem;
    white-space: nowrap;
}

.executive-risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.75rem;
    min-height: 1.625rem;
    padding: 0 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.executive-risk-badge--high {
    color: rgb(225, 29, 72);
    background: rgb(255, 228, 230);
}

.executive-risk-badge--medium {
    color: rgb(180, 83, 9);
    background: rgb(254, 243, 199);
}

.executive-risk-badge--low {
    color: rgb(5, 150, 105);
    background: rgb(220, 252, 231);
}

.executive-highlight {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.875rem;
    align-items: center;
}

.executive-highlights-panel {
    padding-bottom: 2rem;
}

.executive-highlight > span {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
}

.executive-highlight h3 {
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.3;
}

.executive-highlight p,
.executive-empty-state {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
}

.executive-active-sprint-panel {
    padding-bottom: 1.5rem;
}

.executive-sprint-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.executive-sprint-filter select {
    min-width: 8.75rem;
    min-height: 2.25rem;
    padding: 0 2rem 0 0.75rem;
    border: 1px solid rgb(203, 213, 225);
    border-radius: 8px;
    background: rgb(255, 255, 255);
    color: rgb(30, 41, 59);
    font-size: 0.8125rem;
    font-weight: 700;
}

.executive-sprint-title-block {
    margin-bottom: 0.875rem;
}

.executive-sprint-title-block h3 {
    overflow: hidden;
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.executive-sprint-title-block p {
    margin: 0.25rem 0 0;
    color: rgb(71, 85, 105);
    font-size: 0.8125rem;
    font-weight: 700;
}

.executive-sprint-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.78fr);
    gap: 1.125rem;
    align-items: stretch;
}

.executive-sprint-burndown {
    position: relative;
    min-height: 7.25rem;
    padding-left: 2rem;
}

.executive-sprint-burndown svg {
    display: block;
    width: 100%;
    height: 7.25rem;
    overflow: visible;
}

.executive-sprint-axis {
    position: absolute;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: rgb(71, 85, 105);
    font-size: 0.75rem;
    font-weight: 700;
}

.executive-sprint-gridline {
    stroke: rgb(226, 232, 240);
    stroke-dasharray: 3 4;
    stroke-width: 1;
}

.executive-sprint-ideal {
    stroke: rgb(148, 163, 184);
    stroke-width: 1.5;
}

.executive-sprint-area {
    fill: rgba(79, 70, 229, 0.16);
}

.executive-sprint-actual {
    fill: none;
    stroke: rgb(79, 70, 229);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.executive-sprint-point {
    fill: rgb(79, 70, 229);
}

.executive-sprint-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem 1rem;
    margin: 0;
    padding-left: 1rem;
    border-left: 1px solid rgb(229, 231, 235);
}

.executive-sprint-stats div {
    min-width: 0;
}

.executive-sprint-stats dt {
    margin: 0 0 0.25rem;
    color: rgb(71, 85, 105);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
}

.executive-sprint-stats dd {
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
}

.executive-sprint-stats dd strong {
    color: rgb(15, 23, 42);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.executive-sprint-team-stack {
    display: flex;
    align-items: center;
    min-height: 1.875rem;
}

.executive-sprint-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-left: -0.375rem;
    border: 2px solid rgb(255, 255, 255);
    border-radius: 999px;
    background: rgb(219, 234, 254);
    color: rgb(30, 64, 175);
    font-size: 0.75rem;
    font-weight: 700;
}

.executive-sprint-avatar:first-child {
    margin-left: 0;
}

.executive-sprint-avatar:nth-child(2) {
    background: rgb(254, 226, 226);
    color: rgb(153, 27, 27);
}

.executive-sprint-avatar:nth-child(3) {
    background: rgb(220, 252, 231);
    color: rgb(4, 120, 87);
}

.executive-sprint-avatar:nth-child(4) {
    background: rgb(254, 243, 199);
    color: rgb(146, 64, 14);
}

.executive-sprint-avatar:nth-child(5) {
    background: rgb(237, 233, 254);
    color: rgb(91, 33, 182);
}

.executive-sprint-avatar--more {
    background: rgb(241, 245, 249);
    color: rgb(71, 85, 105);
}

.executive-sprint-team-empty {
    color: rgb(71, 85, 105);
    font-size: 0.8125rem;
    font-weight: 700;
}

.executive-sprint-board-link {
    margin-top: 1.125rem;
}
@media (max-width: 1280px) {
    .executive-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .executive-content-grid {
        grid-template-columns: 1fr;
    }

    .executive-secondary-column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .executive-active-sprint-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .executive-dashboard-header {
        flex-direction: column;
    }

    .executive-dashboard-actions {
        justify-content: flex-start;
    }

    .executive-metric-grid,
    .executive-secondary-column {
        grid-template-columns: 1fr;
    }

    .executive-okr-row,
    .executive-risk-row,
    .executive-review-card {
        grid-template-columns: 1fr;
    }

    .executive-review-actions {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
    }

    .executive-review-meta {
        margin-left: 0;
    }

    .executive-sprint-heading,
    .executive-sprint-body {
        grid-template-columns: 1fr;
    }

    .executive-sprint-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .executive-sprint-filter,
    .executive-sprint-filter select {
        width: 100%;
    }

    .executive-sprint-stats {
        padding-left: 0;
        border-left: 0;
    }
}

/* === Integrations Admin =================================================== */

.app-content:has(> .admin-sync-log-page) {
    max-width: none;
}

.admin-sync-log-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0 0 28px;
}

.admin-sync-log-header h1 {
    color: rgb(7 21 48);
    font-size: 1.58rem;
    font-weight: 750;
    line-height: 1.18;
    margin: 0 0 8px;
}

.admin-sync-log-header p {
    color: rgb(79 99 133);
    font-size: 0.84rem;
    line-height: 1.45;
    margin: 8px 0 0;
}

.admin-sync-log-back {
    color: rgb(79 70 229);
    font-size: 0.84rem;
    font-weight: 650;
    text-decoration: none;
}

.admin-sync-log-back::before {
    content: "< ";
}

.admin-sync-log-back:hover {
    color: rgb(49 46 129);
    text-decoration: none;
}

.admin-sync-log-filter-panel,
.admin-sync-log-table-panel {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    overflow: hidden;
}

.admin-sync-log-filter-form {
    align-items: end;
    display: grid;
    gap: 22px 36px;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.9fr) minmax(220px, 0.9fr) auto;
    padding: 24px 26px;
}

.admin-sync-log-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-sync-log-field label {
    color: rgb(7 21 48);
    font-size: 0.8rem;
    font-weight: 750;
}

.admin-sync-log-date-range {
    align-items: center;
    border: 1px solid rgb(215 225 239);
    border-radius: 7px;
    color: rgb(7 21 48);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    min-height: 38px;
    overflow: hidden;
}

.admin-sync-log-date-range input {
    border: 0;
    color: rgb(7 21 48);
    font: inherit;
    min-height: 38px;
    min-width: 0;
    padding: 0 12px;
}

.admin-sync-log-date-range span {
    color: rgb(38 59 96);
    font-size: 0.82rem;
    font-weight: 650;
    pointer-events: none;
    white-space: nowrap;
}

.admin-sync-log-filter-actions,
.admin-sync-log-table-actions {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: flex-end;
}

.admin-sync-log-primary-button,
.admin-sync-log-secondary-button {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 750;
    justify-content: center;
    line-height: 1;
    min-height: 34px;
    padding: 0 14px;
    text-decoration: none;
    white-space: nowrap;
}

.admin-sync-log-primary-button {
    background: rgb(79 70 229);
    border: 1px solid rgb(79 70 229);
    color: rgb(255 255 255);
}

.admin-sync-log-primary-button:hover,
.admin-sync-log-primary-button:focus-visible {
    background: rgb(67 56 202);
    border-color: rgb(67 56 202);
    color: rgb(255 255 255);
    text-decoration: none;
}

.admin-sync-log-secondary-button {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    color: rgb(38 59 96);
}

.admin-sync-log-secondary-button:hover,
.admin-sync-log-secondary-button:focus-visible {
    background: rgb(248 250 252);
    border-color: rgb(190 202 220);
    color: rgb(7 21 48);
    text-decoration: none;
}

.admin-sync-log-table-toolbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px 26px 10px;
}

.admin-sync-log-table-toolbar h2 {
    color: rgb(79 99 133);
    font-size: 0.84rem;
    font-weight: 500;
    margin: 0;
}

.admin-sync-log-per-page select {
    min-height: 34px;
    min-width: 132px;
}

.admin-sync-log-table-wrap {
    overflow-x: auto;
    padding: 0 26px;
}

.admin-sync-log-table {
    border-collapse: collapse;
    min-width: 1120px;
    width: 100%;
}

.admin-sync-log-table th {
    background: rgb(248 250 252);
    border-bottom: 1px solid rgb(215 225 239);
    color: rgb(79 99 133);
    font-size: 0.76rem;
    font-weight: 800;
    padding: 13px 14px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-sync-log-table td {
    border-bottom: 1px solid rgb(229 231 235);
    color: rgb(7 21 48);
    font-size: 0.84rem;
    padding: 13px 14px;
    vertical-align: middle;
    white-space: nowrap;
}

.admin-sync-log-table td:nth-child(8) {
    white-space: normal;
}

.admin-sync-log-table a {
    color: rgb(79 70 229);
    font-weight: 650;
    text-decoration: none;
}

.admin-sync-log-table a:hover {
    color: rgb(49 46 129);
    text-decoration: none;
}

.admin-sync-log-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    min-height: 22px;
    min-width: 42px;
    padding: 0 10px;
}

.admin-sync-log-pill--primary {
    background: rgb(238 242 255);
    color: rgb(79 70 229);
}

.admin-sync-log-pill--info {
    background: rgb(224 242 254);
    color: rgb(2 132 199);
}

.admin-sync-log-pill--success {
    background: rgb(220 252 231);
    color: rgb(4 120 87);
}

.admin-sync-log-pill--warning {
    background: rgb(255 237 213);
    color: rgb(194 65 12);
}

.admin-sync-log-pill--danger {
    background: rgb(254 226 226);
    color: rgb(185 28 28);
}

.admin-sync-log-pill--neutral {
    background: rgb(226 232 240);
    color: rgb(71 85 105);
}

.admin-sync-log-details {
    color: rgb(38 59 96);
    max-width: 520px;
}

.admin-sync-log-empty {
    color: rgb(79 99 133);
    font-size: 0.86rem;
    padding: 26px;
}

.admin-sync-log-footer {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 18px 26px 24px;
}

.admin-sync-log-footer p {
    color: rgb(79 99 133);
    font-size: 0.84rem;
    margin: 0;
}

.admin-sync-log-pagination {
    align-items: center;
    display: flex;
    gap: 0;
}

.admin-sync-log-pagination a,
.admin-sync-log-pagination span {
    align-items: center;
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    color: rgb(38 59 96);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 650;
    height: 34px;
    justify-content: center;
    margin-left: -1px;
    min-width: 34px;
    padding: 0 10px;
    text-decoration: none;
}

.admin-sync-log-pagination a:first-child,
.admin-sync-log-pagination span:first-child {
    border-radius: 6px 0 0 6px;
    margin-left: 0;
}

.admin-sync-log-pagination a:last-child,
.admin-sync-log-pagination span:last-child {
    border-radius: 0 6px 6px 0;
}

.admin-sync-log-pagination a.is-active {
    background: rgb(79 70 229);
    border-color: rgb(79 70 229);
    color: rgb(255 255 255);
    position: relative;
    z-index: 1;
}

.admin-sync-log-pagination a.is-disabled {
    color: rgb(148 163 184);
    pointer-events: none;
}

@media (max-width: 1180px) {
    .admin-sync-log-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-sync-log-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .admin-sync-log-filter-form,
    .admin-sync-log-table-toolbar,
    .admin-sync-log-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .admin-sync-log-filter-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-sync-log-date-range {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-sync-log-date-range span {
        display: none;
    }

    .admin-sync-log-filter-actions,
    .admin-sync-log-table-actions,
    .admin-sync-log-table-toolbar,
    .admin-sync-log-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-sync-log-primary-button,
    .admin-sync-log-secondary-button,
    .admin-sync-log-per-page select {
        width: 100%;
    }

    .admin-sync-log-table-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.app-content:has(> .admin-jira-config-page) {
    max-width: none;
}

.admin-jira-config-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0 0 28px;
}

.admin-jira-config-header h1 {
    color: rgb(7 21 48);
    font-size: 1.58rem;
    font-weight: 750;
    line-height: 1.18;
    margin: 0 0 8px;
}

.admin-jira-config-back {
    color: rgb(79 70 229);
    font-size: 0.84rem;
    font-weight: 650;
    text-decoration: none;
}

.admin-jira-config-back::before {
    content: "< ";
}

.admin-jira-config-back:hover {
    color: rgb(49 46 129);
    text-decoration: none;
}

.admin-jira-config-form {
    display: block;
}

.admin-jira-config-layout {
    align-items: start;
    display: grid;
    gap: 26px;
    grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr);
}

.admin-jira-config-main,
.admin-jira-config-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.admin-jira-config-panel {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    overflow: hidden;
}

.admin-jira-config-panel-body {
    padding: 22px;
}

.admin-jira-config-panel h2 {
    color: rgb(7 21 48);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.2;
    margin: 0 0 10px;
}

.admin-jira-config-panel h3 {
    color: rgb(7 21 48);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 20px 0 12px;
}

.admin-jira-config-panel h3:first-of-type {
    margin-top: 22px;
}

.admin-jira-config-panel p,
.admin-jira-config-panel small,
.admin-jira-config-empty,
.admin-jira-config-helper {
    color: rgb(79 99 133);
    font-size: 0.84rem;
    line-height: 1.45;
    margin: 0;
}

.admin-jira-config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-jira-config-field--narrow {
    max-width: 366px;
}

.admin-jira-config-field:not(:first-of-type) {
    margin-top: 18px;
}

.admin-jira-config-field label {
    color: rgb(7 21 48);
    font-size: 0.8rem;
    font-weight: 750;
}

.admin-jira-config-select {
    max-width: 366px;
}

.admin-jira-config-grid-2,
.admin-jira-config-grid-4 {
    display: grid;
    gap: 18px 28px;
    margin-top: 20px;
}

.admin-jira-config-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-jira-config-standard-grid {
    margin-top: 0;
}

.admin-jira-config-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-jira-config-grid-2 .admin-jira-config-field,
.admin-jira-config-grid-4 .admin-jira-config-field {
    margin-top: 0;
}

.admin-jira-config-subheading {
    margin-top: 24px;
}

.admin-jira-config-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.admin-jira-config-table {
    border-collapse: collapse;
    min-width: 620px;
    width: 100%;
}

.admin-jira-config-table th {
    background: rgb(248 250 252);
    border-bottom: 1px solid rgb(215 225 239);
    color: rgb(79 99 133);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 8px 10px;
    text-align: left;
    text-transform: uppercase;
}

.admin-jira-config-table td,
.custom-mapping-row__cell {
    border-bottom: 1px solid rgb(229 231 235);
    padding: 8px 10px;
    vertical-align: middle;
}

.admin-jira-config-table-action,
.custom-mapping-row__cell--action {
    text-align: center;
    width: 42px;
}

.admin-jira-config-compact-input,
.custom-mapping-input {
    min-height: 30px;
}

.admin-jira-config-add-button {
    align-items: center;
    background: rgb(238 242 255);
    border: 1px solid rgb(199 210 254);
    border-radius: 6px;
    color: rgb(49 46 129);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 750;
    justify-content: center;
    line-height: 1;
    margin-top: 10px;
    min-height: 30px;
    padding: 0 12px;
}

.admin-jira-config-remove-button,
.custom-mapping-remove {
    align-items: center;
    background: rgb(255 255 255);
    border: 1px solid rgb(239 68 68);
    border-radius: 6px;
    color: rgb(220 38 38);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    line-height: 1;
    width: 28px;
}

.admin-jira-config-remove-button:hover,
.custom-mapping-remove:hover {
    background: rgb(220 38 38);
    color: rgb(255 255 255);
}

.admin-jira-config-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.admin-jira-config-save-button {
    align-items: center;
    background: rgb(79 70 229);
    border: 1px solid rgb(79 70 229);
    border-radius: 6px;
    color: rgb(255 255 255);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 750;
    justify-content: center;
    line-height: 1;
    min-height: 34px;
    padding: 0 15px;
}

.admin-jira-config-save-button:hover,
.admin-jira-config-save-button:focus-visible {
    background: rgb(67 56 202);
    border-color: rgb(67 56 202);
}

.admin-jira-config-details {
    display: grid;
    gap: 22px 42px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 20px 0 0;
}

.admin-jira-config-details div {
    min-width: 0;
}

.admin-jira-config-details dt {
    color: rgb(79 99 133);
    font-size: 0.75rem;
    font-weight: 750;
    margin: 0 0 6px;
}

.admin-jira-config-details dd {
    color: rgb(7 21 48);
    font-size: 0.86rem;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-jira-config-details a {
    color: rgb(79 70 229);
    text-decoration: none;
}

.admin-jira-config-details a:hover {
    color: rgb(49 46 129);
    text-decoration: none;
}

.admin-jira-config-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    min-height: 22px;
    padding: 0 10px;
}

.admin-jira-config-status--connected {
    background: rgb(220 252 231);
    color: rgb(4 120 87);
}

.admin-jira-config-status--neutral {
    background: rgb(226 232 240);
    color: rgb(71 85 105);
}

@media (max-width: 1180px) {
    .admin-jira-config-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-jira-config-side {
        order: 2;
    }
}

@media (max-width: 720px) {
    .admin-jira-config-page {
        gap: 16px;
    }

    .admin-jira-config-panel-body {
        padding: 16px;
    }

    .admin-jira-config-grid-2,
    .admin-jira-config-grid-4,
    .admin-jira-config-details {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-jira-config-field--narrow,
    .admin-jira-config-select {
        max-width: none;
    }

    .admin-jira-config-save-button {
        width: 100%;
    }
}

.app-content:has(> .admin-integrations-page) {
    max-width: none;
    padding: 28px 32px 32px;
}

.admin-integrations-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0;
}

.admin-integrations-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
}

.admin-integrations-header h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 8px;
}

.admin-integrations-header p,
.admin-integrations-section-header p,
.admin-integrations-copy,
.admin-integrations-health-item p,
.admin-integrations-token-item p,
.integration-helper-copy,
.integration-inline-note {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.admin-integrations-back,
.admin-integrations-inline-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.admin-integrations-back::before {
    content: "< ";
}

.admin-integrations-back:hover,
.admin-integrations-inline-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.admin-integrations-health,
.admin-integrations-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    overflow: hidden;
}

.admin-integrations-section-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    min-height: 56px;
    padding: 16px 20px;
}

.admin-integrations-section-header + .admin-integrations-panel-body,
.admin-integrations-section-header + .admin-integrations-health-grid {
    border-top: 1px solid var(--border);
}

.admin-integrations-section-header h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0 0 4px;
}

.admin-integrations-collapse {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
}

.admin-integrations-health-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0;
}

.admin-integrations-health-item,
.admin-integrations-token-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 8px 14px;
}

.admin-integrations-health-item:not(:last-child),
.admin-integrations-token-item:not(:last-child) {
    border-right: 1px solid var(--border);
}

.admin-integrations-health-title {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.admin-integrations-health-title strong {
    color: var(--text);
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
}

.admin-integrations-health-item p,
.admin-integrations-token-item p {
    display: -webkit-box;
    font-size: 13px;
    line-height: 1.45;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.admin-integrations-provider-icon {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    flex: 0 0 32px;
    font-size: 12px;
    font-weight: 700;
    height: 32px;
    justify-content: center;
    line-height: 1;
    width: 32px;
}

.admin-integrations-provider-icon--jira,
.admin-integrations-provider-icon--xero {
    background: var(--info-soft);
    color: var(--info);
}

.admin-integrations-provider-icon--github {
    background: var(--bg-secondary);
    color: var(--text);
}

.admin-integrations-provider-icon--gitlab {
    background: var(--warning-soft);
    color: var(--warning);
}

.admin-integrations-provider-icon--tokens {
    background: var(--primary-light);
    color: var(--primary);
}

.admin-integrations-status {
    align-items: center;
    border-radius: var(--radius-full);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    justify-content: center;
    line-height: 1;
    min-height: 24px;
    padding: 0 8px;
    white-space: nowrap;
}

.admin-integrations-status--connected {
    background: var(--success-soft);
    color: var(--success);
}

.admin-integrations-status--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.admin-integrations-status--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.admin-integrations-status--neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.admin-integrations-health-item dl,
.admin-integrations-token-item dl {
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    font-size: 12px;
    gap: 4px;
    margin: auto 0 0;
}

.admin-integrations-health-item dl div,
.admin-integrations-token-item dl div {
    display: flex;
    gap: 4px;
}

.admin-integrations-health-item dt,
.admin-integrations-token-item dt {
    font-weight: 600;
    margin: 0;
}

.admin-integrations-health-item dd,
.admin-integrations-token-item dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-integrations-panel-body {
    padding: 20px;
}

.admin-integrations-stats {
    gap: 16px;
    grid-template-columns: 1.2fr repeat(5, minmax(96px, 1fr));
    margin-bottom: 16px;
}

.admin-integrations-stats > div {
    min-width: 0;
}

.admin-integrations-stats strong {
    color: var(--text);
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-top: 4px;
}

.admin-integrations-project-pill {
    align-items: center;
    background: var(--primary);
    border-radius: var(--radius-full);
    color: var(--surface);
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    margin-top: 4px;
    min-height: 24px;
    padding: 0 8px;
}

.admin-integrations-actions {
    margin-top: 16px;
}

.admin-integrations-primary-button,
.admin-integrations-secondary-button,
.admin-integrations-danger-button {
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    line-height: 1;
    height: 40px;
    padding: 0 16px;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.admin-integrations-primary-button {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--surface);
}

.admin-integrations-primary-button:hover,
.admin-integrations-primary-button:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--surface);
    text-decoration: none;
}

.admin-integrations-secondary-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.admin-integrations-secondary-button:hover,
.admin-integrations-secondary-button:focus-visible {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text);
    text-decoration: none;
}

.admin-integrations-danger-button {
    background: var(--surface);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.admin-integrations-danger-button:hover,
.admin-integrations-danger-button:focus-visible,
.admin-integrations-page .btn-outline-danger:hover:not(:disabled) {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--surface);
    text-decoration: none;
}

.integration-card-title {
    margin: 0;
}

.integration-status-badge {
    font-size: 13px;
    padding: 4px 12px;
}

.integration-setup-card {
    margin-bottom: 4px;
}

.integration-setup-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.integration-setup-item {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.integration-setup-item-main {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    width: 100%;
}

.integration-setup-copy {
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.integration-stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-bottom: 20px;
}

.integration-stat-label {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.integration-stat-value {
    font-size: 20px;
}

.integration-stat-value--danger {
    color: var(--danger);
}

.integration-project-pill {
    font-size: 12px;
}

.integration-alert-spaced,
.integration-copy-spaced {
    margin-bottom: 16px;
}

.integration-actions {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
}

.integration-actions-main {
    align-items: center;
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 8px;
}

.integration-sync-group,
.integration-inline-form,
.integration-push-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.integration-select-compact {
    font-size: 13px;
    height: 36px;
    padding: 0 12px;
    width: 140px;
}

.integration-actions-danger,
.integration-actions-spacer {
    flex-shrink: 0;
    margin-left: auto;
}

.integration-helper-copy {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 16px;
    max-width: 74ch;
}

.integration-table {
    border: 1px solid var(--border);
    border-collapse: collapse;
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    width: 100%;
}

.integration-table-row {
    border-bottom: 1px solid var(--border);
}

.integration-table-head {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 14px 16px;
    text-align: left;
    text-transform: uppercase;
}

.integration-table-head--right,
.integration-table-cell--right {
    text-align: right;
}

.integration-table-cell {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 16px;
    vertical-align: middle;
}

.integration-table-cell strong {
    color: var(--text);
    font-weight: 700;
}

.integration-table-cell--nowrap {
    white-space: nowrap;
}

.integration-table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.integration-table-actions .btn {
    min-height: 40px;
}

.integration-repo-badge {
    align-items: center;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    color: var(--primary);
    cursor: default;
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 4px;
    padding: 4px 10px;
    position: relative;
    user-select: none;
}

.integration-repo-tooltip {
    background: var(--text);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    color: var(--surface);
    display: none;
    font-size: 13px;
    font-weight: 400;
    left: 0;
    line-height: 1.45;
    max-width: 340px;
    min-width: 220px;
    padding: 8px 12px;
    position: absolute;
    top: calc(100% + 8px);
    white-space: nowrap;
    z-index: 100;
}

.integration-repo-tooltip-item {
    display: block;
}

.integration-empty-note,
.integration-inline-note {
    color: var(--text-muted);
    font-size: 14px;
}

.integration-webhook-block,
.integration-secret-block {
    margin-bottom: 16px;
}

.integration-field-label {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.integration-code-block {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
}

.integration-secret-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.integration-secret-code {
    font-size: 13px;
    letter-spacing: 0;
}

.integration-card-disabled {
    opacity: 0.6;
}

@media (max-width: 1500px) {
    .admin-integrations-health-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .admin-integrations-health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-integrations-health-item:not(:last-child),
    .admin-integrations-token-item:not(:last-child) {
        border-right: 0;
    }

    .admin-integrations-health-item,
    .admin-integrations-token-item {
        border-bottom: 1px solid var(--border);
    }

    .admin-integrations-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-integrations-page {
        gap: 16px;
    }

    .admin-integrations-section-header,
    .admin-integrations-panel-body,
    .admin-integrations-health-item,
    .admin-integrations-token-item {
        padding-left: 16px;
        padding-right: 16px;
    }

    .admin-integrations-health-grid,
    .admin-integrations-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-integrations-health-title {
        flex-wrap: wrap;
    }

    .integration-actions,
    .integration-actions-main,
    .integration-sync-group,
    .integration-table-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .admin-integrations-primary-button,
    .admin-integrations-secondary-button,
    .admin-integrations-danger-button {
        width: 100%;
    }

    .integration-table-head--right,
    .integration-table-cell--right {
        text-align: left;
    }

    .integration-table-actions {
        justify-content: flex-start;
    }
}

/* === Superadmin Organisations ============================================ */

.org-form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.org-form-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.org-edit-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.org-input-name {
    min-width: 220px;
}

.org-input-name--edit {
    min-width: 200px;
}

.org-input-seats {
    width: 80px;
}

.org-input-price {
    width: 90px;
}

.org-card-header-meta {
    font-size: 0.85rem;
}

.org-card-body--flush {
    padding: 0;
}

.org-empty-state {
    padding: 1.25rem;
}

.org-table {
    width: 100%;
    border-collapse: collapse;
}

.org-table-head-row {
    border-bottom: 2px solid var(--border);
}

.org-table-head {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
}

.org-table-head--name,
.org-table-cell--name {
    padding: 0.6rem 1.25rem;
}

.org-table-head--standard,
.org-table-cell--standard {
    padding: 0.6rem 1rem;
}

.org-table-head--actions,
.org-table-cell--actions {
    padding: 0.6rem 1.25rem;
}

.org-table-head--center,
.org-table-cell--center {
    text-align: center;
}

.org-table-cell {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.org-table-row {
    border-bottom: 1px solid var(--border);
}

.org-name-cell {
    font-weight: 600;
}

.org-plan-badge {
    font-size: 0.75rem;
}

.org-seat-summary {
    font-size: 0.875rem;
}

.org-seat-meter {
    width: 60px;
    height: 4px;
    margin: 3px auto 0;
    display: block;
    border: 0;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.org-seat-meter::-webkit-progress-bar {
    background: var(--border);
}

.org-seat-meter::-webkit-progress-value {
    border-radius: 2px;
}

.org-seat-meter::-moz-progress-bar {
    border-radius: 2px;
}

.org-seat-meter--primary { accent-color: var(--primary); }
.org-seat-meter--warning { accent-color: rgb(240, 173, 78); }
.org-seat-meter--danger { accent-color: var(--danger); }

.executive-project-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.executive-project-subtitle {
    color: rgb(100, 116, 139);
    font-size: 0.875rem;
}

.executive-project-toolbar {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.executive-project-select {
    border: 1px solid rgb(209, 213, 219);
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 6px 10px;
}

.executive-project-updated {
    color: rgb(148, 163, 184);
    font-size: 12px;
}

.executive-project-empty {
    color: rgb(107, 114, 128);
    padding: 2rem;
    text-align: center;
}

.executive-project-empty-copy {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.executive-project-link {
    color: rgb(99, 102, 241);
}

.executive-project-card {
    border-top: 3px solid rgb(99, 102, 241);
}

.executive-project-card--success {
    border-top-color: rgb(16, 185, 129);
}

.executive-project-card--warning {
    border-top-color: rgb(245, 158, 11);
}

.executive-project-card--primary {
    border-top-color: rgb(99, 102, 241);
}

.executive-project-card-body {
    padding: 1rem 1.25rem;
}

.executive-project-card-head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.executive-project-card-main {
    flex: 1;
    min-width: 0;
}

.executive-project-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.executive-project-objective-pill {
    background: rgb(99, 102, 241);
    border-radius: 999px;
    color: rgb(255, 255, 255);
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.executive-project-title {
    color: rgb(30, 41, 59);
    font-size: 0.95rem;
}

.executive-project-description {
    color: rgb(100, 116, 139);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.25rem 0 0;
}

.executive-project-progress {
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}

.executive-project-progress-label {
    color: rgb(148, 163, 184);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.executive-project-progress-value {
    color: rgb(99, 102, 241);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.executive-project-progress-value--success {
    color: rgb(16, 185, 129);
}

.executive-project-progress-value--warning {
    color: rgb(245, 158, 11);
}

.executive-project-progress-value--primary {
    color: rgb(99, 102, 241);
}

.executive-project-progress-meta {
    color: rgb(148, 163, 184);
    font-size: 0.7rem;
}

.executive-project-progress-meter {
    margin-top: 4px;
    width: 90px;
}

.executive-project-section {
    border-top: 1px solid rgb(241, 245, 249);
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.executive-project-section--compact {
    margin-top: 0.875rem;
}

.executive-project-section-label {
    color: rgb(148, 163, 184);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.executive-project-kr-card {
    background: rgb(248, 250, 252);
    border-left: 3px solid rgb(156, 163, 175);
    border-radius: 6px;
    margin-bottom: 0.625rem;
    padding: 0.5rem 0.75rem;
}

.executive-project-kr-card--success {
    border-left-color: rgb(16, 185, 129);
}

.executive-project-kr-card--warning {
    border-left-color: rgb(245, 158, 11);
}

.executive-project-kr-card--danger {
    border-left-color: rgb(239, 68, 68);
}

.executive-project-kr-card--muted {
    border-left-color: rgb(156, 163, 175);
}

.executive-project-kr-card--primary {
    border-left-color: rgb(99, 102, 241);
}

.executive-project-kr-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.executive-project-kr-title {
    color: rgb(30, 41, 59);
    font-size: 0.82rem;
    font-weight: 500;
}

.executive-project-status-pill {
    color: rgb(255, 255, 255);
}

.executive-project-status-pill--success {
    background: rgb(16, 185, 129);
}

.executive-project-status-pill--warning {
    background: rgb(245, 158, 11);
}

.executive-project-status-pill--danger {
    background: rgb(239, 68, 68);
}

.executive-project-status-pill--muted {
    background: rgb(156, 163, 175);
}

.executive-project-status-pill--primary {
    background: rgb(99, 102, 241);
}

.executive-project-kr-meter {
    flex: 1;
    height: 8px;
}

.executive-project-kr-meta {
    color: rgb(107, 114, 128);
    font-size: 0.72rem;
    white-space: nowrap;
}

.executive-project-momentum {
    color: rgb(107, 114, 128);
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.4;
    margin: 0.375rem 0 0;
}

.executive-project-line-kr {
    align-items: flex-start;
    background: rgb(248, 250, 252);
    border-left: 3px solid rgb(99, 102, 241);
    border-radius: 5px;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    padding: 0.45rem 0.65rem;
}

.executive-project-line-kr--success {
    border-left-color: rgb(16, 185, 129);
}

.executive-project-line-kr--warning {
    border-left-color: rgb(245, 158, 11);
}

.executive-project-line-kr--primary {
    border-left-color: rgb(99, 102, 241);
}

.executive-project-line-index {
    color: rgb(99, 102, 241);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 1.6rem;
    padding-top: 1px;
    white-space: nowrap;
}

.executive-project-line-copy {
    flex: 1;
    min-width: 0;
}

.executive-project-line-text {
    color: rgb(55, 65, 81);
    font-size: 0.8rem;
    line-height: 1.4;
}

.executive-project-line-text--with-progress {
    margin-bottom: 0.3rem;
}

.executive-project-line-progress {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.executive-project-line-meter {
    flex: 1;
    height: 5px;
    max-width: 120px;
}

.executive-project-line-meta {
    color: rgb(156, 163, 175);
    font-size: 0.7rem;
}

.upload-form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 1.5rem 1.5rem;
}

.upload-callout {
    border-left: 4px solid var(--primary);
}

.upload-callout--danger {
    border-left-color: var(--danger, rgb(220, 38, 38));
}

.upload-callout--primary {
    border-left-color: var(--primary);
}

.upload-callout--success {
    border-left-color: var(--success, rgb(40 167 69));
}

.upload-callout-body {
    padding: 1.25rem 1.5rem;
}

.upload-callout-body--between {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.upload-callout-row {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
}

.upload-callout-icon {
    align-items: center;
    background: rgb(254, 226, 226);
    border-radius: 50%;
    display: flex;
    flex-shrink: 0;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.upload-callout-copy {
    flex: 1;
}

.upload-callout-title {
    margin: 0 0 0.25rem;
}

.upload-callout-title--danger {
    color: rgb(153, 27, 27);
    margin-bottom: 0.35rem;
}

.upload-callout-title--success {
    color: var(--success, rgb(40 167 69));
    margin-bottom: 0.5rem;
}

.upload-callout-text {
    font-size: 0.875rem;
    margin: 0 0 1rem;
}

.upload-callout-text--compact {
    margin: 0;
}

.upload-callout-steps {
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.upload-callout-step {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.upload-callout-step-number {
    color: var(--primary);
    font-weight: 600;
}

.upload-callout-actions {
    margin-top: 1rem;
}

.upload-summary-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.upload-doc-toggle {
    cursor: pointer;
}

.upload-doc-title {
    margin: 0;
}

.upload-doc-toggle-icon {
    font-weight: 400;
    margin-left: 0.5rem;
}

.upload-doc-item {
    border-bottom: 1px solid var(--border);
}

/* Project context template page */
.app-content:has(> .project-context-page) {
    max-width: none;
}

.project-context-page {
    color: var(--text);
}

.project-context-header {
    margin-bottom: 1.25rem;
}

.project-context-header__inner {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.project-context-header__copy {
    min-width: 0;
}

.project-context-header__copy .page-title {
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0;
}

.project-context-header__copy .text-muted {
    line-height: 1.55;
    margin: 0.45rem 0 0;
    max-width: 780px;
}

.project-context-header__actions {
    flex: 0 0 auto;
}

.project-context-back-link {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 600;
    gap: 0.45rem;
    text-decoration: none;
}

.project-context-back-link--inline {
    margin-top: 2rem;
}

.project-context-back-button {
    align-items: center;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    display: inline-flex;
    gap: 0.5rem;
    min-height: 3rem;
    padding-inline: 1.25rem;
}

.project-context-flow {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.project-context-card {
    border-color: var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    overflow: hidden;
}

.project-context-card--templates,
.project-context-card--review {
    padding: 1.15rem 1.5rem;
}

.project-context-card--note {
    padding: 1.15rem 1.5rem 2rem;
}

.project-context-section-heading h2 {
    font-size: 1rem;
    line-height: 1.3;
    margin: 0;
}

.project-context-section-heading .text-muted {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.25rem 0 0;
}

.project-context-template-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.project-context-wizard-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(26rem, 0.72fr) minmax(32rem, 1fr);
}

.project-context-wizard-default,
.project-context-wizard-custom {
    align-self: start;
    padding: 1.15rem 1.5rem;
}

.project-context-wizard-grid > .project-context-card {
    margin-top: 0;
}

.project-context-wizard-custom {
    margin-top: 0;
}

.project-context-template-option {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.project-context-template-option.accordion-item--open {
    background: var(--surface);
}

.project-context-template-option--selected {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.project-context-template-option:hover,
.project-context-template-option:focus-within {
    border-color: var(--primary);
}

.project-context-template-option__row {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) max-content 2rem;
    min-height: 4.25rem;
    padding: 0.72rem 1.1rem;
}

.project-context-template-option__select {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 1rem;
    grid-template-columns: 1.7rem 3rem minmax(0, 1fr);
    min-width: 0;
}

.project-context-template-option__control {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 1.65rem;
}

.project-context-template-option__control input[type="radio"] {
    accent-color: var(--primary);
    height: 1.05rem;
    margin: 0;
    width: 1.05rem;
}

.project-context-template-option__icon,
.project-context-review-row__icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    height: 3rem;
    justify-content: center;
    width: 3rem;
}

.project-context-template-option__icon--operations,
.project-context-review-row__icon {
    background: var(--primary-light);
    color: var(--primary);
}

.project-context-template-option__icon--enterprise {
    background: var(--success-soft);
    color: var(--success);
}

.project-context-template-option__icon--product {
    background: var(--warning-soft);
    color: var(--orange);
}

.project-context-template-option__icon--delivery {
    background: var(--info-soft);
    color: var(--info);
}

.project-context-template-option__icon--risk {
    background: var(--danger-soft);
    color: var(--risk);
}

.project-context-template-option__icon--neutral {
    background: var(--primary-light);
    color: var(--primary);
}

.project-context-template-option__content,
.project-context-template-option__summary,
.project-context-template-option__copy {
    display: block;
    min-width: 0;
}

.project-context-template-option__copy strong {
    display: block;
    font-size: 0.93rem;
    line-height: 1.25;
}

.project-context-template-option__summary .text-muted {
    display: block;
    font-size: 0.82rem;
    line-height: 1.45;
    margin-top: 0.2rem;
}

.project-context-badge {
    border-radius: 9999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    justify-self: end;
    line-height: 1.2;
    padding: 0.38rem 0.7rem;
    text-align: center;
    white-space: nowrap;
}

.project-context-badge--recommended,
.project-context-badge--neutral {
    background: var(--primary-light);
    color: var(--primary);
}

.project-context-badge--enterprise {
    background: var(--success-soft);
    color: var(--success);
}

.project-context-badge--product {
    background: var(--warning-soft);
    color: var(--orange);
}

.project-context-badge--delivery {
    background: var(--info-soft);
    color: var(--info);
}

.project-context-badge--operations {
    background: var(--primary-light);
    color: var(--primary);
}

.project-context-badge--risk {
    background: var(--danger-soft);
    color: var(--risk);
}

.project-context-template-option__toggle {
    align-items: center;
    align-self: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    justify-content: center;
    min-height: 2rem;
    padding: 0;
    width: 2rem;
}

.project-context-template-option__toggle:hover,
.project-context-template-option__toggle:focus {
    background: rgba(79, 70, 229, 0.06);
    color: var(--primary);
}

.project-context-template-option__details {
    display: none;
    gap: 1rem;
    padding: 0 1.25rem 1.1rem 6.75rem;
}

.accordion-item--open > .project-context-template-option__details {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(16rem, 0.7fr);
}

.project-context-template-option__detail-section {
    min-width: 0;
}

.project-context-review-row {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: 1.7rem 3rem minmax(0, 1fr) max-content;
    margin-top: 1rem;
    max-width: 100%;
}

.project-context-review-row__select-wrap {
    border: 1px solid var(--primary);
    border-radius: 8px;
    display: grid;
    gap: 0.1rem;
    min-height: 3rem;
    min-width: 0;
    padding: 0.55rem 0.8rem;
}

.project-context-review-select {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 0;
    outline: 0;
    padding: 0;
}

.project-context-review-row__description {
    color: var(--text-muted);
    display: block;
    font-size: 0.8rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-context-panel-details {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 0.4rem;
    justify-content: flex-end;
    text-decoration: none;
    white-space: nowrap;
}

.project-context-note {
    margin: 0;
}

.project-context-note .form-label {
    margin-bottom: 0.15rem;
}

.project-context-note .text-muted {
    font-size: 0.82rem;
    margin: 0 0 0.45rem;
}

.project-context-note textarea {
    min-height: 4rem;
    resize: vertical;
}

.project-context-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.25rem;
}

.project-context-submit {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    min-height: 2.85rem;
    padding-inline: 1.4rem;
}

@media (max-width: 920px) {
    .project-context-wizard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-context-review-row {
        grid-template-columns: 1.7rem 3rem minmax(0, 1fr);
    }

    .project-context-panel-details {
        grid-column: 3 / 4;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .project-context-header__inner {
        align-items: stretch;
        flex-direction: column;
    }

    .project-context-header__actions,
    .project-context-back-button,
    .project-context-form-actions .btn {
        width: 100%;
    }

    .project-context-card--templates,
    .project-context-card--review,
    .project-context-card--note {
        padding: 1rem;
    }

    .project-context-template-option__row {
        align-items: flex-start;
        grid-template-columns: minmax(0, 1fr) 2rem;
    }

    .project-context-template-option__select {
        grid-template-columns: 1.7rem 2.5rem minmax(0, 1fr);
    }

    .project-context-template-option__icon,
    .project-context-review-row__icon {
        height: 2.5rem;
        width: 2.5rem;
    }

    .project-context-badge {
        grid-column: 1 / 2;
        justify-self: start;
        margin-left: 5.2rem;
    }

    .project-context-template-option__toggle {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        justify-self: end;
    }

    .project-context-template-option__details {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .accordion-item--open > .project-context-template-option__details {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-context-review-row {
        grid-template-columns: 1.7rem 2.5rem minmax(0, 1fr);
    }
}

.upload-doc-details {
    margin: 0;
}

.upload-doc-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0.75rem 1.5rem;
    user-select: none;
}

.upload-doc-name {
    font-size: 0.9rem;
}

.upload-doc-meta {
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.upload-doc-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
}

.upload-doc-summary-copy {
    background: rgb(248, 250, 252);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    padding: 0.75rem 1.5rem 1rem;
    white-space: pre-wrap;
}

.upload-doc-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
}

.upload-doc-action {
    font-size: 0.75rem;
}

.upload-status-card {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 86px;
    padding: 18px 22px;
}

.upload-status-card--success,
.upload-status-card--summary {
    border-left: 4px solid var(--primary);
}

.upload-status-card--danger {
    border-left: 4px solid var(--danger);
}

.upload-status-card__icon {
    border-radius: 999px;
    height: 36px;
    width: 36px;
}

.upload-status-card__icon svg {
    height: 21px;
    width: 21px;
}

.upload-status-card__icon--success {
    background: var(--success);
    color: rgb(255 255 255);
}

.upload-status-card__icon--danger {
    background: var(--danger-light, rgb(254 226 226));
    color: var(--danger);
}

.upload-status-card__copy h3 {
    margin-bottom: 4px;
}

.upload-status-card__copy p {
    margin: 0;
}

.upload-form-actions {
    padding: 16px 0 0;
}

.upload-ai-action {
    border-color: var(--primary);
    color: var(--primary);
    padding-left: 18px;
    padding-right: 18px;
}

.upload-documents-card__header {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 22px;
}

.upload-doc-title {
    font-size: 17px;
}

.upload-doc-toggle-icon {
    color: var(--text);
    display: inline-flex;
}

.upload-doc-toggle-icon svg {
    height: 20px;
    width: 20px;
}

.upload-doc-summary,
.upload-doc-row {
    padding: 14px 22px;
}

.upload-doc-summary-copy {
    background: var(--surface-2, var(--bg));
    border-top: 1px solid var(--border);
}

.upload-pro-tip {
    align-items: center;
    background: var(--upload-pro-tip-bg);
    border-color: var(--upload-pro-tip-border);
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    min-height: 60px;
    padding: 0 22px;
}

.upload-pro-tip__icon {
    color: var(--upload-success-text);
    height: 24px;
    width: 24px;
}

.upload-pro-tip__icon svg {
    height: 20px;
    width: 20px;
}

.upload-pro-tip strong {
    color: var(--upload-success-text);
    font-size: 14px;
    font-weight: 600;
}

.upload-pro-tip kbd {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 7px;
}

.upload-pro-tip button {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    width: 32px;
}

.upload-pro-tip button svg {
    height: 18px;
    width: 18px;
}

@media (max-width: 760px) {
    .upload-context-card,
    .upload-status-card {
        grid-template-columns: 1fr;
    }

    .upload-context-card__action,
    .upload-ai-action,
    .upload-primary-action {
        width: 100%;
    }

    .upload-pro-tip {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: 16px;
        padding-top: 16px;
    }

    .upload-pro-tip button {
        margin-left: 0;
    }
}

.org-billing-copy,
.org-created-copy,
.org-superadmin-copy {
    color: var(--text-muted);
}

.org-billing-copy {
    font-size: 0.85rem;
}

.org-created-copy {
    font-size: 0.8rem;
}

.org-table-cell--actions {
    text-align: right;
    white-space: nowrap;
}

.org-inline-form {
    display: inline;
}

.org-edit-row {
    background: rgb(248, 250, 252);
}

.org-edit-cell {
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--primary);
}

.org-current-pricing {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
}

.org-current-pricing__main,
.org-current-pricing__meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.org-current-pricing__meta {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.org-edit-form {
    display: contents;
}

.org-edit-actions {
    display: flex;
    gap: 0.5rem;
}

.org-edit-spacer {
    margin-left: auto;
}

.org-superadmin-copy {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.org-superadmin-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.org-superadmin-form--centered {
    align-items: center;
}

.org-superadmin-user {
    flex: 1;
    min-width: 280px;
}

/* === Superadmin Manage Organisations ===================================== */

.app-content:has(> .superadmin-orgs-page) { max-width: none; }

.superadmin-orgs-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 0 auto;
    max-width: 1516px;
    padding: 42px 0 28px;
}

.superadmin-orgs-header h1 {
    color: rgb(7 21 48);
    font-size: 1.82rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.55rem;
}

.superadmin-orgs-back {
    color: rgb(79 70 229);
    font-size: 1rem;
    font-weight: 650;
    text-decoration: none;
}

.superadmin-orgs-panel {
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.superadmin-orgs-panel h2 {
    color: rgb(7 21 48);
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.superadmin-orgs-create-panel { padding: 26px 28px 28px; }

.superadmin-orgs-create-form {
    align-items: end;
    display: grid;
    gap: 18px 28px;
    grid-template-columns: minmax(220px, 1.35fr) minmax(160px, 0.9fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(150px, 0.8fr);
    margin-top: 26px;
}

.superadmin-orgs-field,
.superadmin-orgs-edit-form label,
.superadmin-orgs-credit-form label,
.superadmin-orgs-filter-menu label {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.superadmin-orgs-field span,
.superadmin-orgs-edit-form span,
.superadmin-orgs-credit-form span,
.superadmin-orgs-filter-menu span {
    color: rgb(38 56 88);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.2;
}

.superadmin-orgs-field .form-control,
.superadmin-orgs-edit-form .form-control,
.superadmin-orgs-credit-form .form-control,
.superadmin-orgs-search .form-control,
.superadmin-orgs-filter-menu .form-control {
    border-color: rgb(203 216 232);
    border-radius: 7px;
    min-height: 42px;
}

.superadmin-orgs-field--date { grid-column: 1 / span 1; }

.superadmin-orgs-create-button {
    align-self: end;
    min-height: 44px;
    padding-left: 28px;
    padding-right: 28px;
}

.superadmin-orgs-list-panel { overflow: visible; }

.superadmin-orgs-list-header {
    align-items: center;
    border-bottom: 1px solid rgb(214 225 238);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 22px 28px;
}

.superadmin-orgs-tools {
    align-items: center;
    display: flex;
    gap: 14px;
}

.superadmin-orgs-page-size .form-control {
    min-height: 42px;
    width: 92px;
}

.superadmin-orgs-search {
    display: block;
    min-width: 318px;
    position: relative;
}

.superadmin-orgs-search__icon {
    color: rgb(79 99 133);
    left: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.superadmin-orgs-search__icon svg,
.superadmin-orgs-filter-button svg,
.superadmin-orgs-avatar svg,
.row-actions-item svg {
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.superadmin-orgs-search .form-control { padding-left: 42px; }
.superadmin-orgs-filter { position: relative; }

.superadmin-orgs-filter-button {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    min-height: 42px;
}

.superadmin-orgs-filter-menu {
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 12px;
    min-width: 240px;
    padding: 14px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 60;
}

.superadmin-orgs-filter-menu[hidden] { display: none; }

.superadmin-orgs-count {
    color: rgb(79 99 133);
    font-size: 0.95rem;
    white-space: nowrap;
}

.superadmin-orgs-table-wrap { overflow: visible; }
.superadmin-orgs-table { min-width: 1160px; }

.superadmin-orgs-table th {
    background: rgb(248 250 252);
    border-bottom: 1px solid rgb(214 225 238);
    color: rgb(79 99 133);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: 14px 24px;
    text-transform: none;
}

.superadmin-orgs-table td {
    border-bottom: 1px solid rgb(226 233 242);
    color: rgb(18 35 65);
    font-size: 0.95rem;
    padding: 22px 24px;
    vertical-align: middle;
}

.superadmin-orgs-org-cell {
    align-items: center;
    display: flex;
    gap: 14px;
    min-width: 260px;
}

.superadmin-orgs-org-cell strong,
.superadmin-orgs-details strong {
    color: rgb(7 21 48);
    display: block;
    font-weight: 800;
}

.superadmin-orgs-org-cell small {
    color: rgb(79 99 133);
    display: block;
    font-size: 0.82rem;
    margin-top: 4px;
}

.superadmin-orgs-avatar {
    align-items: center;
    background: rgb(245 243 255);
    border-radius: 999px;
    color: rgb(79 70 229);
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.superadmin-orgs-pill,
.superadmin-orgs-feature-badge,
.superadmin-orgs-status {
    align-items: center;
    border-radius: 7px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    min-height: 26px;
    padding: 0.38rem 0.58rem;
    white-space: nowrap;
}

.superadmin-orgs-pill--primary {
    background: rgb(79 70 229);
    color: rgb(255 255 255);
}

.superadmin-orgs-pill:not(.superadmin-orgs-pill--primary),
.superadmin-orgs-feature-badge {
    background: rgb(219 234 254);
    color: rgb(37 99 235);
}

.superadmin-orgs-status--active { background: rgb(220 252 231); color: rgb(5 150 105); }
.superadmin-orgs-status--paused { background: rgb(254 249 195); color: rgb(161 98 7); }
.superadmin-orgs-status--suspended { background: rgb(241 245 249); color: rgb(71 85 105); }

.superadmin-orgs-seat-cell { min-width: 132px; }
.superadmin-orgs-seat-cell > span:first-child { display: block; font-weight: 800; margin-bottom: 7px; }

.superadmin-orgs-seat-bar {
    appearance: none;
    background: rgb(226 232 240);
    border: 0;
    border-radius: 999px;
    display: block;
    height: 6px;
    overflow: hidden;
    width: 86px;
}

.superadmin-orgs-seat-bar::-webkit-progress-bar {
    background: rgb(226 232 240);
}

.superadmin-orgs-seat-bar::-webkit-progress-value,
.superadmin-orgs-seat-bar::-moz-progress-bar {
    background: rgb(22 163 74);
    border-radius: 999px;
}

.superadmin-orgs-actions .row-actions-dropdown { min-width: 190px; }

.superadmin-orgs-details-row > td {
    background: rgb(250 249 255);
    padding: 0 24px 22px;
}

.superadmin-orgs-details {
    border-top: 1px solid rgb(226 233 242);
    display: grid;
    gap: 24px;
    grid-template-columns: 1.05fr 1.35fr 1.15fr 1fr;
    padding: 24px 0 12px;
}

.superadmin-orgs-details section {
    border-left: 1px solid rgb(214 225 238);
    min-width: 0;
    padding-left: 24px;
}

.superadmin-orgs-details section:first-child {
    border-left: 0;
    padding-left: 0;
}

.superadmin-orgs-details h3 {
    color: rgb(79 99 133);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0 0 16px;
    text-transform: uppercase;
}

.superadmin-orgs-section-kicker {
    color: rgb(79 99 133);
    display: block;
    font-size: 0.82rem;
    font-weight: 750;
    margin-bottom: 7px;
}

.superadmin-orgs-details p {
    color: rgb(79 99 133);
    font-size: 0.94rem;
    line-height: 1.35;
    margin: 0.5rem 0 0;
}

.superadmin-orgs-edit-form,
.superadmin-orgs-credit-form {
    display: grid;
    gap: 12px;
}

.superadmin-orgs-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.superadmin-orgs-edit-form button,
.superadmin-orgs-credit-form button { justify-self: start; }

.superadmin-orgs-mini-list {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
}

.superadmin-orgs-mini-list div {
    display: flex;
    justify-content: space-between;
}

.superadmin-orgs-mini-list dt {
    color: rgb(79 99 133);
    font-size: 0.86rem;
    font-weight: 700;
}

.superadmin-orgs-mini-list dd {
    color: rgb(7 21 48);
    font-size: 0.9rem;
    font-weight: 800;
    margin: 0;
}

.superadmin-orgs-credit-requests {
    border-top: 1px solid rgb(226 233 242);
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
}

.superadmin-orgs-credit-requests > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.superadmin-orgs-pagination {
    align-items: center;
    border-top: 1px solid rgb(214 225 238);
    display: flex;
    justify-content: space-between;
    padding: 18px 28px;
}

.superadmin-orgs-pagination > span {
    color: rgb(79 99 133);
    font-size: 0.92rem;
}

.superadmin-orgs-pagination > div {
    align-items: center;
    display: flex;
    gap: 8px;
}


.superadmin-orgs-page-button {
    align-items: center;
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 7px;
    color: rgb(38 56 88);
    display: inline-flex;
    font-weight: 750;
    height: 38px;
    justify-content: center;
    min-width: 38px;
    padding: 0 10px;
}

.superadmin-orgs-page-button--active {
    background: rgb(79 70 229);
    border-color: rgb(79 70 229);
    color: rgb(255 255 255);
}

.superadmin-orgs-page-button:disabled { cursor: not-allowed; opacity: 0.45; }
.superadmin-orgs-empty { color: rgb(79 99 133); margin: 0; padding: 28px; }

@media (max-width: 1280px) {
    .superadmin-orgs-create-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .superadmin-orgs-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .superadmin-orgs-details section:nth-child(3) { border-left: 0; padding-left: 0; }
}

@media (max-width: 900px) {
    .superadmin-orgs-list-header,
    .superadmin-orgs-tools,
    .superadmin-orgs-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .superadmin-orgs-tools,
    .superadmin-orgs-search,
    .superadmin-orgs-page-size .form-control,
    .superadmin-orgs-filter-button { width: 100%; }
    .superadmin-orgs-filter-menu { left: 0; right: auto; }
    .superadmin-orgs-table-wrap { overflow-x: auto; }
    .superadmin-orgs-create-form,
    .superadmin-orgs-details,
    .superadmin-orgs-edit-form { grid-template-columns: 1fr; }
    .superadmin-orgs-field--date { grid-column: auto; }

    .superadmin-orgs-details section,
    .superadmin-orgs-details section:nth-child(3) {
        border-left: 0;
        border-top: 1px solid rgb(214 225 238);
        padding-left: 0;
        padding-top: 20px;
    }

    .superadmin-orgs-details section:first-child {
        border-top: 0;
        padding-top: 0;
    }
}

@media (max-width: 640px) {
    .superadmin-orgs-page {
        gap: 18px;
        padding-top: 28px;
    }

    .superadmin-orgs-header h1 { font-size: 1.45rem; }
    .superadmin-orgs-create-panel,
    .superadmin-orgs-list-header,
    .superadmin-orgs-pagination {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* === Superadmin System Users ============================================= */

.app-content:has(> .superadmin-users-page) { max-width: none; }

.superadmin-users-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 0 auto;
    max-width: 1516px;
    padding: 42px 0 28px;
}

.superadmin-users-header h1 {
    color: rgb(7 21 48);
    font-size: 1.82rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.55rem;
}

.superadmin-users-back {
    color: rgb(79 70 229);
    font-size: 1rem;
    font-weight: 650;
    text-decoration: none;
}

.superadmin-users-back::before { content: "< "; }

.superadmin-users-panel {
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.superadmin-users-panel h2 {
    color: rgb(7 21 48);
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.superadmin-users-panel p {
    color: rgb(79 99 133);
    line-height: 1.45;
    margin: 0;
}

.superadmin-users-top-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.95fr);
}

.superadmin-users-create-card,
.superadmin-users-promote-card {
    padding: 26px 28px 28px;
}

.superadmin-users-card-title-row {
    align-items: start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.superadmin-users-card-title-row p {
    max-width: 520px;
}

.superadmin-users-create-form {
    display: grid;
    gap: 18px 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 26px;
}

.superadmin-users-field,
.superadmin-users-edit-form label,
.superadmin-users-credit-form label,
.superadmin-users-filter-menu label {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.superadmin-users-field span,
.superadmin-users-edit-form span,
.superadmin-users-credit-form span,
.superadmin-users-filter-menu span {
    color: rgb(38 56 88);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.2;
}

.superadmin-users-field .form-control,
.superadmin-users-edit-form .form-control,
.superadmin-users-credit-form .form-control,
.superadmin-users-search .form-control,
.superadmin-users-filter-menu .form-control {
    border-color: rgb(203 216 232);
    border-radius: 7px;
    min-height: 42px;
}

.superadmin-users-check {
    align-items: center;
    color: rgb(18 35 65);
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 650;
    gap: 10px;
    min-height: 32px;
}

.superadmin-users-check input,
.superadmin-users-edit-checks input {
    accent-color: rgb(79 70 229);
    height: 14px;
    width: 14px;
}

.superadmin-users-create-button {
    justify-self: start;
    min-height: 44px;
    padding-left: 28px;
    padding-right: 28px;
}

.superadmin-users-promote-card {
    display: grid;
    gap: 14px;
}

.superadmin-users-promote-form {
    display: grid;
    gap: 18px;
    margin-top: 8px;
}

.superadmin-users-promote-form button {
    justify-self: start;
}

.superadmin-users-about {
    align-items: start;
    background: rgb(245 243 255);
    border-radius: 8px;
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding: 20px;
}

.superadmin-users-about-icon {
    align-items: center;
    color: rgb(79 70 229);
    display: inline-flex;
    flex: 0 0 28px;
    height: 28px;
    justify-content: center;
}

.superadmin-users-about-icon svg,
.superadmin-users-search__icon svg,
.superadmin-users-filter-button svg,
.superadmin-users-actions svg {
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.superadmin-users-about-icon svg {
    height: 24px;
    width: 24px;
}

.superadmin-users-about strong {
    color: rgb(79 70 229);
    display: block;
    font-weight: 800;
    margin-bottom: 5px;
}

.superadmin-users-about p {
    font-size: 0.92rem;
}

.superadmin-users-list-header {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 22px 28px 16px;
}

.superadmin-users-tools {
    align-items: center;
    display: flex;
    gap: 14px;
}

.superadmin-users-page-size .form-control {
    min-height: 42px;
    width: 92px;
}

.superadmin-users-search {
    display: block;
    min-width: 318px;
    position: relative;
}

.superadmin-users-search__icon {
    color: rgb(79 99 133);
    left: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.superadmin-users-search .form-control { padding-left: 42px; }
.superadmin-users-filter { position: relative; }

.superadmin-users-filter-button {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    min-height: 42px;
}

.superadmin-users-filter-menu {
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 12px;
    min-width: 240px;
    padding: 14px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 10;
}

.superadmin-users-filter-menu[hidden] { display: none; }

.superadmin-users-tabs {
    display: flex;
    gap: 0;
    padding: 0 28px 16px;
}

.superadmin-users-tab {
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    color: rgb(79 99 133);
    cursor: pointer;
    font-weight: 750;
    min-height: 42px;
    padding: 0 22px;
}

.superadmin-users-tab:first-child {
    border-radius: 7px 0 0 7px;
}

.superadmin-users-tab:last-child {
    border-radius: 0 7px 7px 0;
}

.superadmin-users-tab + .superadmin-users-tab {
    margin-left: -1px;
}

.superadmin-users-tab--active {
    color: rgb(79 70 229);
    box-shadow: inset 0 -3px 0 rgb(79 70 229);
}

.superadmin-users-table-wrap {
    overflow: visible;
    padding: 0 28px;
}

.superadmin-users-table {
    border: 1px solid rgb(214 225 238);
    border-radius: 8px;
    min-width: 1200px;
    overflow: hidden;
}

.superadmin-users-table th {
    background: rgb(248 250 252);
    border-bottom: 1px solid rgb(214 225 238);
    color: rgb(79 99 133);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: 14px 16px;
    text-transform: none;
}

.superadmin-users-table td {
    border-bottom: 1px solid rgb(226 233 242);
    color: rgb(18 35 65);
    font-size: 0.93rem;
    padding: 16px;
    vertical-align: middle;
}

.superadmin-users-user-cell {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 180px;
}

.superadmin-users-user-cell strong {
    color: rgb(7 21 48);
    font-weight: 800;
}

.superadmin-users-avatar {
    align-items: center;
    background: rgb(245 243 255);
    border-radius: 999px;
    color: rgb(79 70 229);
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 0.82rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.superadmin-users-org-pill,
.superadmin-users-role,
.superadmin-users-status {
    align-items: center;
    border-radius: 7px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    min-height: 26px;
    padding: 0.38rem 0.58rem;
}

.superadmin-users-org-pill {
    background: rgb(248 250 252);
    border: 1px solid rgb(214 225 238);
    color: rgb(79 99 133);
}

.superadmin-users-role {
    background: rgb(245 243 255);
    color: rgb(79 70 229);
}

.superadmin-users-role--org_admin {
    background: rgb(219 234 254);
    color: rgb(37 99 235);
}

.superadmin-users-role--superadmin {
    background: rgb(237 233 254);
    color: rgb(109 40 217);
}

.superadmin-users-status {
    background: transparent;
    gap: 8px;
    padding-left: 0;
}

.superadmin-users-status span {
    border-radius: 999px;
    height: 7px;
    width: 7px;
}

.superadmin-users-status--active span { background: rgb(22 163 74); }
.superadmin-users-status--inactive span { background: rgb(148 163 184); }

.superadmin-users-permissions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.superadmin-users-permissions span:not(.superadmin-users-permission-empty) {
    align-items: center;
    border: 1px solid rgb(203 216 232);
    border-radius: 999px;
    color: rgb(79 99 133);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 850;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.superadmin-users-permission-empty {
    color: rgb(100 116 139);
    font-size: 0.86rem;
}

.superadmin-users-actions .row-actions-dropdown {
    min-width: 210px;
}

.row-actions-note {
    color: rgb(100 116 139);
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.65rem 0.8rem;
}

.superadmin-users-details-row > td {
    background: rgb(250 249 255);
    padding: 0 24px 22px;
}

.superadmin-users-details {
    border-top: 1px solid rgb(226 233 242);
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
    padding: 24px 0 12px;
}

.superadmin-users-details section {
    border-left: 1px solid rgb(214 225 238);
    min-width: 0;
    padding-left: 24px;
}

.superadmin-users-details section:first-child {
    border-left: 0;
    padding-left: 0;
}

.superadmin-users-details h3 {
    color: rgb(79 99 133);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0 0 16px;
    text-transform: uppercase;
}

.superadmin-users-edit-form {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.superadmin-users-edit-form button,
.superadmin-users-credit-form button {
    justify-self: start;
}

.superadmin-users-edit-checks {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
}

.superadmin-users-edit-checks label {
    align-items: center;
    color: rgb(38 56 88);
    display: inline-flex;
    font-weight: 650;
    gap: 8px;
}

.superadmin-users-mini-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.superadmin-users-mini-list div {
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.superadmin-users-mini-list dt {
    color: rgb(79 99 133);
    font-size: 0.86rem;
    font-weight: 700;
}

.superadmin-users-mini-list dd {
    color: rgb(7 21 48);
    font-size: 0.9rem;
    font-weight: 800;
    margin: 0;
    text-align: right;
}

.superadmin-users-credit-form {
    display: grid;
    gap: 12px;
}

.superadmin-users-empty {
    color: rgb(79 99 133);
    padding: 28px;
    text-align: center;
}

.superadmin-users-pagination {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 22px 28px;
}

.superadmin-users-pagination > span {
    color: rgb(79 99 133);
    font-size: 0.92rem;
}

.superadmin-users-pagination > div {
    align-items: center;
    display: flex;
    gap: 8px;
}


.superadmin-users-page-button {
    align-items: center;
    background: var(--surface);
    border: 1px solid rgb(214 225 238);
    border-radius: 7px;
    color: rgb(38 56 88);
    display: inline-flex;
    font-weight: 750;
    height: 38px;
    justify-content: center;
    min-width: 38px;
    padding: 0 10px;
}

.superadmin-users-page-button--active {
    background: rgb(79 70 229);
    border-color: rgb(79 70 229);
    color: rgb(255 255 255);
}

.superadmin-users-page-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

@media (max-width: 1280px) {
    .superadmin-users-top-grid { grid-template-columns: 1fr; }
    .superadmin-users-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .superadmin-users-details section:nth-child(3) { border-left: 0; padding-left: 0; }
}

@media (max-width: 900px) {
    .superadmin-users-list-header,
    .superadmin-users-tools,
    .superadmin-users-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .superadmin-users-card-title-row {
        display: grid;
    }

    .superadmin-users-tools,
    .superadmin-users-search,
    .superadmin-users-page-size .form-control,
    .superadmin-users-filter-button {
        width: 100%;
    }

    .superadmin-users-filter-menu {
        left: 0;
        right: auto;
    }

    .superadmin-users-table-wrap {
        overflow-x: auto;
    }

    .superadmin-users-create-form,
    .superadmin-users-details,
    .superadmin-users-edit-form {
        grid-template-columns: 1fr;
    }

    .superadmin-users-details section,
    .superadmin-users-details section:nth-child(3) {
        border-left: 0;
        border-top: 1px solid rgb(214 225 238);
        padding-left: 0;
        padding-top: 20px;
    }

    .superadmin-users-details section:first-child {
        border-top: 0;
        padding-top: 0;
    }
}

@media (max-width: 640px) {
    .superadmin-users-page {
        gap: 18px;
        padding-top: 28px;
    }

    .superadmin-users-header h1 {
        font-size: 1.45rem;
    }

    .superadmin-users-create-card,
    .superadmin-users-promote-card,
    .superadmin-users-list-header,
    .superadmin-users-tabs,
    .superadmin-users-table-wrap,
    .superadmin-users-pagination {
        padding-left: 20px;
        padding-right: 20px;
    }

    .superadmin-users-tabs {
        overflow-x: auto;
    }
}

/* === Jira Configure ======================================================= */

.jira-config-alert {
    margin-bottom: 1rem;
}

.jira-config-copy {
    font-size: 0.875rem;
}

.jira-config-select {
    max-width: 400px;
}

.jira-config-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.jira-config-grid-2--compact {
    max-width: 600px;
}

.jira-config-grid-2--wide {
    max-width: 700px;
}

.jira-config-heading {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.jira-config-heading--spaced {
    margin: 1.5rem 0 0.5rem;
}

.jira-config-helper {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.jira-config-table {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
}

.jira-config-table-head-row {
    text-align: left;
    border-bottom: 2px solid var(--border-color, rgb(222 226 230));
}

.jira-config-table-head {
    padding: 0.5rem;
    font-size: 0.85rem;
}

.jira-config-table-head--action {
    width: 50px;
}

.jira-config-table-row {
    border-bottom: 1px solid var(--border-color, rgb(222 226 230));
}

.jira-config-table-cell {
    padding: 0.5rem;
}

.jira-config-input-compact {
    font-size: 0.85rem;
}

.jira-config-remove {
    background: none;
    border: none;
    color: rgb(220, 53, 69);
    cursor: pointer;
    font-size: 1.1rem;
}

.jira-config-add-btn {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.jira-config-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 500px;
}

.jira-config-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.jira-config-detail-label {
    font-size: 0.8rem;
    display: block;
}

.jira-config-code {
    font-size: 0.85rem;
}

/* === Sprints ============================================================= */

.sprint-callout--danger {
    border-left: 4px solid var(--danger);
}

.sprint-callout--primary {
    border-left: 4px solid var(--primary);
}

.sprint-callout-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.sprint-callout-body--compact {
    justify-content: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.sprint-callout-copy {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}

.sprint-team-label {
    margin: 0;
    white-space: nowrap;
    font-weight: 600;
}

.sprint-team-select {
    max-width: 300px;
}

.sprint-creation-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: end;
}

.sprint-form-label {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.sprint-capacity-input {
    width: 100px;
}

.sprint-helper-copy {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.sprint-inline-meta {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sprint-gen-field--button {
    align-self: end;
}

.sprint-empty-state {
    padding: 1rem;
    font-size: 0.875rem;
}

.sprint-empty-state--large {
    padding: 2rem;
}

.app-content:has(> .sprint-board-page) {
    max-width: none;
}

.sprint-board-page {
    width: min(100%, 1516px);
    margin: 0 auto;
    padding: 0 0 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sprint-board-header,
.sprint-board-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.sprint-board-title-block {
    min-width: 0;
}

.sprint-board-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sprint-board-title {
    margin: 0;
    color: var(--text);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
}

.sprint-board-status {
    align-self: center;
}

.sprint-board-subtitle,
.sprint-board-copy {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.sprint-board-copy {
    margin-top: 0;
}

.sprint-board-actions,
.sprint-board-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.sprint-board-actions form,
.sprint-board-page-menu form {
    margin: 0;
}

.sprint-board-back,
.sprint-board-main-action .btn,
.sprint-board-view-button {
    min-height: 42px;
}

.sprint-board-view-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.sprint-board-page-menu .row-actions-toggle {
    width: 42px;
    height: 42px;
}

.sprint-board-close-summary,
.sprint-board-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.sprint-board-close-summary {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    padding: 16px 18px;
    gap: 16px;
}

.sprint-board-close-summary strong {
    display: block;
    margin-top: 4px;
    font-size: 1.25rem;
    color: var(--text);
}

.sprint-board-shell {
    min-width: 0;
}

.sprint-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.board-column {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top-width: 5px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.board-column--backlog {
    border-top-color: rgb(100, 116, 139);
}

.board-column--in_progress {
    border-top-color: var(--primary);
}

.board-column--done {
    border-top-color: var(--success);
}

.board-column-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 22px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.board-column-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.board-column-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
}

.board-column-heading p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.35;
}

.board-column-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--primary);
    background: rgb(245, 243, 255);
    border-radius: 50%;
}

.board-column--backlog .board-column-icon {
    color: rgb(71, 85, 105);
    background: rgb(248, 250, 252);
}

.board-column--done .board-column-icon {
    color: var(--success);
    background: rgb(236, 253, 245);
}

.board-column-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.board-column-totals {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.board-column-points {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.board-column-body {
    min-height: 642px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgb(248, 250, 252);
}

.board-column--done .board-column-body {
    background: var(--surface);
}

.board-column-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    min-height: 512px;
    border: 1px dashed rgb(148, 163, 184);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.35;
    text-align: center;
    padding: 24px;
}

.board-empty-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.board-empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.board-story-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.board-story-card:hover,
.board-story-card--chosen,
.board-story-card--dragging {
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: var(--shadow-md);
}

.board-story-card--ghost {
    opacity: 0.45;
    background: rgb(238, 242, 255);
}

.board-story-card__top,
.board-story-card__grab {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.board-story-card__grab {
    flex: 1;
    justify-content: flex-start;
    min-width: 0;
}

.board-story-card__content {
    flex: 1;
    min-width: 0;
}

.board-story-card__handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    padding: 0;
    background: rgb(248, 250, 252);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: grab;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.board-story-card__handle:hover {
    background: rgb(238, 242, 255);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.26);
}

.board-story-card__handle:active {
    cursor: grabbing;
}

.board-story-card__handle svg,
.board-story-menu .row-actions-toggle svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.board-story-card__eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.board-story-card__label,
.board-story-card__priority {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.board-story-card__priority {
    color: var(--primary);
}

.board-story-title {
    margin: 0;
    color: var(--text);
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.43;
}

.board-story-parent {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.45;
}

.board-story-meta {
    flex-wrap: wrap;
    row-gap: 8px;
}

.board-story-menu .row-actions-dropdown {
    min-width: 190px;
}

.board-move-item {
    justify-content: space-between;
    align-items: center;
}

.board-move-item__label {
    pointer-events: none;
}

.board-move-item__current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgb(238, 242, 255);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.board-move-item--current,
.board-move-item[disabled] {
    background: rgb(238, 242, 255);
    color: var(--primary);
    cursor: default;
}

.board-move-item[disabled]:hover {
    background: rgb(238, 242, 255);
    color: var(--primary);
}

.board-add-story {
    min-height: 48px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--surface);
    border: 1px dashed rgb(148, 163, 184);
    border-radius: 8px;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.board-add-story:hover,
.board-add-story:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
    outline: none;
}

.sprint-board-summary-cell {
    min-width: 0;
    padding: 18px 28px;
    border-left: 1px solid var(--border);
    border-top: 5px solid transparent;
}

.sprint-board-summary-cell:first-child {
    border-left: 0;
}

.sprint-board-summary-cell--backlog {
    border-top-color: rgb(100, 116, 139);
    background: rgb(248, 250, 252);
}

.sprint-board-summary-cell--in-progress {
    border-top-color: var(--primary);
    background: rgb(245, 243, 255);
}

.sprint-board-summary-cell--done {
    border-top-color: var(--success);
    background: rgb(236, 253, 245);
}

.sprint-board-summary-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.3;
    text-transform: none;
}

.sprint-board-summary-cell strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
}

.sprint-board-summary-track {
    display: block;
    height: 6px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(226, 232, 240);
}

.sprint-board-summary-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
}

[data-board-summary-bar="done"] {
    background: var(--success);
}

[data-board-summary-bar="in_progress"] {
    background: var(--primary);
}

[data-board-summary-bar="backlog"] {
    background: rgb(100, 116, 139);
}

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

    .board-column-body,
    .board-column-empty {
        min-height: 280px;
    }

    .sprint-board-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sprint-board-page {
        padding-top: 28px;
    }

    .sprint-board-header,
    .sprint-board-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sprint-board-actions,
    .sprint-board-toolbar-actions {
        justify-content: flex-start;
    }

    .sprint-board-title {
        font-size: 1.65rem;
    }

    .board-column-header {
        flex-direction: column;
        align-items: stretch;
    }

    .board-column-totals {
        justify-content: flex-start;
    }

    .board-story-card {
        padding: 16px;
    }

    .sprint-board-summary {
        grid-template-columns: 1fr;
    }

    .sprint-board-summary-cell {
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .sprint-board-summary-cell:first-child {
        border-top: 0;
    }
}

/* === Access Tokens ======================================================= */

.access-token-card--success {
    border: 2px solid var(--success, rgb(22, 163, 74));
}

.access-token-title {
    color: var(--success, rgb(22, 163, 74));
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.access-token-copy {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.access-token-copy--small {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.access-token-inline-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.access-token-value {
    font-family: monospace;
    font-size: 0.85rem;
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2, rgb(248 250 252));
}

.access-token-team-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.access-token-team-copy {
    flex: 1;
    min-width: 200px;
}

.access-token-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.access-token-team-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.access-token-inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.jira-identity-picker {
    position: relative;
    flex: 1;
}

.jira-identity-suggestions {
    position: absolute;
    z-index: 200;
    top: calc(100% + 2px);
    left: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--bg-card, rgb(255, 255, 255));
    border: 1px solid var(--border-color, rgb(221 221 221));
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.jira-identity-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.jira-identity-option:hover,
.jira-identity-option.jip-active {
    background: var(--surface-2, rgb(248 250 252));
}

.jira-identity-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.jira-identity-name {
    font-size: 0.9em;
    font-weight: 500;
}

.jira-identity-email {
    margin-left: 4px;
    color: var(--text-muted, rgb(136 136 136));
    font-size: 0.8em;
}

.access-token-jira-current {
    margin-top: 4px;
    font-size: 0.8em;
}

.access-token-clear-link {
    color: var(--danger, rgb(220, 38, 38));
    font-size: 0.9em;
}

.access-token-jira-connect-copy {
    font-size: 0.9em;
}

.access-token-team-input {
    width: 220px;
}

.mcp-guide-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.mcp-guide-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.access-token-guide-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.access-token-step-copy {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.access-token-guide-intro {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.access-token-step-copy--spaced {
    margin-top: 1rem;
}

.access-token-snippet-wrap {
    position: relative;
}

.access-token-snippet {
    background: var(--surface-2, rgb(248 250 252));
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.78rem;
    overflow-x: auto;
    margin: 0;
    line-height: 1.6;
}

.access-token-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
}

.access-token-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.access-token-tool-card {
    background: var(--surface-2, rgb(248 250 252));
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.access-token-tool-name {
    font-size: 0.78rem;
    color: var(--primary-dark, rgb(29 78 216));
}

.access-token-tool-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0;
}

.access-token-footnote {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.app-content:has(> .developer-tokens-page) {
    max-width: none;
    padding: 2rem 2.25rem 2.5rem;
}

.developer-tokens-page {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
    color: var(--text, rgb(15 23 42));
}

.developer-tokens-header {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.15rem;
}

.developer-tokens-header .page-title {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.developer-tokens-header .page-subtitle,
.developer-token-card p,
.developer-token-muted,
.developer-token-security p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.developer-token-card,
.developer-token-alert,
.developer-token-security {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.developer-token-card {
    padding: 20px;
}

.developer-token-guides-card {
    overflow: hidden;
}

.developer-token-card h2,
.developer-token-security h2,
.developer-token-alert h2 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.developer-token-card p,
.developer-token-alert p,
.developer-token-security p {
    margin: 0.45rem 0 0;
}

.developer-token-alert {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.2rem;
    border-color: var(--success, rgb(16 185 129));
    background: color-mix(in srgb, var(--success, rgb(16 185 129)) 8%, var(--surface, rgb(255 255 255)));
}

.developer-token-copy-row,
.developer-token-form-row,
.developer-token-create-form,
.developer-token-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.developer-token-copy-input {
    flex: 1;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0 0.85rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    background: var(--surface-2, rgb(248 250 252));
    color: var(--text, rgb(15 23 42));
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.developer-token-identity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.developer-token-identity-card {
    display: grid;
    gap: 1rem;
}

.developer-token-card-copy code {
    font-size: 0.86em;
    color: var(--text, rgb(15 23 42));
    background: transparent;
}

.developer-token-form-row {
    align-items: flex-end;
}

.developer-token-form-row .btn,
.developer-token-create-form .btn,
.developer-token-security .btn {
    min-height: 40px;
    font-size: 14px;
    font-weight: 600;
}

.developer-token-select,
.developer-token-jira-picker,
.developer-token-field {
    flex: 1;
    min-width: 0;
}

.developer-token-field {
    display: grid;
    gap: 0.45rem;
}

.developer-token-field label,
.developer-token-label {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.developer-token-link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    border: 0;
    background: transparent;
    color: var(--primary, rgb(79 70 229));
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.developer-token-link-button:hover,
.developer-token-link-button:focus-visible,
.developer-token-inline-link:hover,
.developer-token-inline-link:focus-visible {
    text-decoration: underline;
}

.developer-token-section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.developer-token-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.75rem, 1fr));
    overflow: visible;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    background: var(--surface-2, rgb(248 250 252));
}

.developer-token-tab,
.developer-token-guide-row {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    background: transparent;
    color: var(--text, rgb(15 23 42));
    font-weight: 700;
    cursor: pointer;
}

.developer-token-tab {
    justify-content: flex-start;
    min-width: 0;
    min-height: 2.65rem;
    padding: 0 0.9rem;
    border-right: 1px solid var(--border, rgb(219 227 239));
    border-bottom: 1px solid var(--border, rgb(219 227 239));
    white-space: nowrap;
}

.developer-token-tab:last-child {
    border-right: 0;
}

.developer-token-tab span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.developer-token-tab:hover,
.developer-token-tab:focus-visible,
.developer-token-tab--active {
    color: var(--primary, rgb(79 70 229));
    background: var(--primary-light, rgb(238 242 255));
}

.developer-token-guide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-light);
    font-size: 12px;
    font-weight: 600;
}

.developer-token-guide-panel {
    margin-top: 0.8rem;
    padding: 1rem;
    min-width: 0;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    background: var(--surface, rgb(255 255 255));
}

.developer-token-guide-panel[hidden] {
    display: none;
}

.developer-token-snippet-wrap {
    position: relative;
    margin: 0.85rem 0;
}

.developer-token-snippet {
    min-height: 11.4rem;
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    background: var(--surface-2, rgb(248 250 252));
    color: var(--text, rgb(15 23 42));
    font-size: 0.82rem;
    line-height: 1.65;
}

.developer-token-copy-button {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    min-height: 1.9rem;
    padding: 0 0.75rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 7px;
    background: var(--surface, rgb(255 255 255));
    color: var(--text, rgb(15 23 42));
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.developer-token-inline-link {
    display: inline-flex;
    color: var(--primary, rgb(79 70 229));
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.developer-token-guide-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.developer-token-guide-row {
    min-height: 2.65rem;
    width: 100%;
    padding: 0 0.8rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    background: var(--surface-2, rgb(248 250 252));
    text-align: left;
}

.developer-token-guide-row:hover,
.developer-token-guide-row:focus-visible {
    border-color: var(--primary, rgb(79 70 229));
    background: var(--primary-light, rgb(238 242 255));
}

.developer-token-guide-row-title {
    min-width: 10rem;
}

.developer-token-guide-row-path {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted, rgb(71 85 105));
    font-size: 0.82rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.developer-token-create-form {
    margin-top: 1rem;
}

.developer-token-table-card {
    padding: 0;
    overflow: hidden;
}

.developer-token-table-card h2 {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
}

.developer-token-table-wrap {
    overflow-x: auto;
}

.developer-token-table {
    width: 100%;
    border-collapse: collapse;
}

.developer-token-table th,
.developer-token-table td {
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
    color: var(--text, rgb(15 23 42));
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.developer-token-table th {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.developer-token-table-name {
    font-weight: 600;
}

.developer-token-table code {
    color: var(--text-secondary, rgb(51 65 85));
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.85rem;
}

.developer-token-actions {
    justify-content: flex-end;
}

.developer-token-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.65rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 7px;
    background: var(--surface, rgb(255 255 255));
    color: var(--text-secondary, rgb(51 65 85));
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.developer-token-icon-button:hover,
.developer-token-icon-button:focus-visible {
    color: var(--primary, rgb(79 70 229));
    border-color: var(--primary, rgb(79 70 229));
    background: var(--primary-light, rgb(238 242 255));
}

.developer-token-icon-button--danger {
    color: var(--danger, rgb(220 38 38));
}

.developer-token-icon-button--danger:hover,
.developer-token-icon-button--danger:focus-visible {
    color: var(--danger, rgb(220 38 38));
    border-color: color-mix(in srgb, var(--danger, rgb(220 38 38)) 45%, var(--border, rgb(219 227 239)));
    background: color-mix(in srgb, var(--danger, rgb(220 38 38)) 8%, var(--surface, rgb(255 255 255)));
}

.developer-token-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: var(--text-muted, rgb(71 85 105));
    font-size: 0.88rem;
}

.developer-token-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.developer-token-pagination strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--primary, rgb(79 70 229));
    border-radius: 7px;
    color: var(--primary, rgb(79 70 229));
}

.developer-token-pagination-arrow {
    display: inline-flex;
    color: var(--text-muted, rgb(71 85 105));
    opacity: 0.45;
}

.developer-token-pagination-arrow--previous {
    transform: rotate(180deg);
}

.developer-token-empty {
    padding: 1.2rem;
}

.developer-token-security {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    border-color: color-mix(in srgb, var(--primary, rgb(79 70 229)) 35%, var(--border, rgb(219 227 239)));
    background: color-mix(in srgb, var(--primary, rgb(79 70 229)) 4%, var(--surface, rgb(255 255 255)));
}

.developer-token-security-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--primary);
    background: var(--primary-light);
}

.developer-token-modal {
    width: min(100% - 2rem, 440px);
}

.developer-token-modal .modal-body {
    display: grid;
    gap: 0.55rem;
}

html[data-theme="dark"] .developer-token-card,
html[data-theme="dark"] .developer-token-alert,
html[data-theme="dark"] .developer-token-security,
html[data-theme="dark"] .developer-token-guide-panel,
html[data-theme="dark"] .developer-token-copy-button,
html[data-theme="dark"] .developer-token-icon-button {
    background: var(--surface, rgb(17 24 39));
}

html[data-theme="dark"] .developer-token-tabs,
html[data-theme="dark"] .developer-token-guide-row,
html[data-theme="dark"] .developer-token-snippet,
html[data-theme="dark"] .developer-token-copy-input {
    background: var(--surface-2, rgb(15 23 42));
}

@media (max-width: 1100px) {
    .developer-token-identity-grid,
    .developer-token-alert,
    .developer-token-security {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .developer-token-card {
        padding: 1rem;
    }

    .developer-token-form-row,
    .developer-token-create-form,
    .developer-token-copy-row,
    .developer-token-table-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .developer-token-tabs {
        grid-template-columns: 1fr;
    }

    .developer-token-tab {
        justify-content: flex-start;
        border-right: 0;
        border-bottom: 1px solid var(--border, rgb(219 227 239));
    }

    .developer-token-guide-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        height: auto;
        padding: 0.8rem;
    }

    .developer-token-guide-row-path {
        grid-column: 2;
    }
}

.account-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.account-settings-grid > div,
.account-settings-grid > .form-group,
.account-settings-row,
.account-option-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.account-settings-grid > div,
.account-settings-grid > .form-group {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
}

.account-settings-grid > .form-group {
    margin-bottom: 0;
}

.account-readonly-grid {
    margin-top: 1rem;
}

.account-settings-grid strong,
.account-settings-row strong,
.account-option-card strong {
    color: var(--text);
}

.account-option-list,
.account-settings-list {
    display: grid;
    gap: 0.75rem;
}

.account-option-list legend {
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.account-option-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
}

.account-option-card.is-selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.account-option-card input {
    margin-top: 0.2rem;
}

.account-option-card span {
    display: grid;
    gap: 0.2rem;
}

.account-option-card small,
.account-settings-row p {
    color: var(--text-muted);
}

.account-settings-actions {
    margin-top: 1rem;
}

.account-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.toggle-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.toggle-control input {
    width: auto;
}

.app-content:has(> .preferences-page-header),
.app-content:has(> .profile-page-header) {
    max-width: none;
}


.app-content:has(> .profile-page-header) .page-title,
.app-content:has(> .preferences-page-header) .page-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.preferences-page-header {
    margin-bottom: 1.5rem;
}

.preferences-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) minmax(260px, 316px);
    gap: 1.5rem;
    align-items: start;
}

.preferences-tabs,
.preferences-panel,
.preferences-about {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
}

.preferences-tabs {
    display: grid;
    align-content: start;
    gap: 0.85rem;
    min-height: 39.9rem;
    padding: 1rem;
}

.preferences-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.preferences-tab:hover,
.preferences-tab:focus-visible,
.preferences-tab.is-active {
    background: var(--primary-light);
    color: var(--primary);
}

.preferences-tab-icon,
.preferences-about-list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.preferences-tab-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.preferences-main {
    min-width: 0;
}

.preferences-panel {
    padding: 1.5rem;
}

.preferences-panel[hidden] {
    display: none;
}

.preferences-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.preferences-panel-header h2,
.preferences-about h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.preferences-panel-header p,
.preferences-field-heading p,
.preferences-setting-row p,
.preferences-about p,
.preferences-event-card small,
.preferences-empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.preferences-panel-header p {
    margin-top: 0.55rem;
}

.preferences-secondary-button,
.preferences-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.preferences-secondary-button {
    gap: 0.5rem;
    padding: 0 1.05rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.preferences-secondary-button svg {
    width: 1rem;
    height: 1rem;
}

.preferences-secondary-button:hover,
.preferences-secondary-button:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.preferences-form {
    display: grid;
    gap: 1.5rem;
}

.preferences-field-heading {
    display: grid;
    gap: 0.5rem;
}

.preferences-field-heading h3,
.preferences-event-grid legend {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.preferences-theme-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.preferences-theme-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0.9rem;
    min-height: 14.2rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.preferences-theme-card.is-selected,
.preferences-theme-card:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.preferences-theme-card input {
    position: absolute;
    z-index: 2;
    top: 1.25rem;
    left: 1.25rem;
    width: 1rem;
    height: 1rem;
    opacity: 0;
    cursor: pointer;
}

.preferences-theme-radio {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.preferences-theme-card input:checked + .preferences-theme-radio {
    border: 4px solid var(--primary);
}

.preferences-theme-preview {
    display: grid;
    grid-template-columns: 32% 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 0.45rem;
    height: 6.9rem;
    margin: 0 0 0.25rem 2.1rem;
    padding: 0.65rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-secondary);
}

.preferences-theme-preview span {
    border-radius: 4px;
    background: var(--surface);
}

.preferences-theme-preview span:first-child {
    grid-row: 1 / -1;
    background: var(--primary);
}

.preferences-theme-preview--dark,
.preferences-theme-preview--system {
    background: var(--text);
}

.preferences-theme-preview--dark span,
.preferences-theme-preview--system span {
    background: var(--text-secondary);
}

.preferences-theme-preview--system {
    position: relative;
}

.preferences-theme-preview--system::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 43%;
    background: var(--surface);
}

.preferences-theme-card strong,
.preferences-setting-row strong,
.preferences-event-card strong,
.preferences-empty-state strong,
.preferences-about-list strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.preferences-theme-card small {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.preferences-primary-button {
    width: fit-content;
    min-width: 8.9rem;
    padding: 0 1.2rem;
    border: 0;
    background: var(--primary);
    color: var(--surface);
}

.preferences-primary-button:hover,
.preferences-primary-button:focus-visible {
    background: var(--primary-hover);
}

.preferences-setting-list {
    display: grid;
    gap: 0.85rem;
}

.preferences-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.7rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.preferences-setting-row > div {
    display: grid;
    gap: 0.35rem;
}

.preferences-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.preferences-toggle input {
    width: auto;
}

.preferences-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.preferences-form-field {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.preferences-form-field span {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.preferences-form-field select,
.preferences-form-field input {
    width: 100%;
    min-height: 2.65rem;
    padding: 0 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.preferences-event-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    border: 0;
    margin: 0;
    padding: 0;
}

.preferences-event-grid legend {
    grid-column: 1 / -1;
    margin-bottom: 0.15rem;
}

.preferences-event-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.preferences-event-card.is-selected,
.preferences-event-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.preferences-event-card input {
    margin-top: 0.2rem;
}

.preferences-event-card span {
    display: grid;
    gap: 0.25rem;
}

.preferences-empty-state {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.preferences-about {
    min-height: 23.7rem;
    padding: 1.5rem;
}

.preferences-about > p {
    margin-top: 1rem;
}

.preferences-about-list {
    display: grid;
    gap: 1.4rem;
    margin: 2rem 0 1.7rem;
}

.preferences-about-list div {
    display: grid;
    grid-template-columns: 2.35rem minmax(0, 1fr);
    gap: 0 0.75rem;
    align-items: center;
}

.preferences-about-list span {
    grid-row: span 2;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    background: var(--home-green-bg);
    color: var(--home-success-text);
}

.preferences-about-list svg {
    width: 1rem;
    height: 1rem;
}

.preferences-about a {
    display: inline-flex;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.preferences-about a:hover,
.preferences-about a:focus-visible {
    text-decoration: underline;
}

html[data-theme="dark"] .preferences-tabs,
html[data-theme="dark"] .preferences-panel,
html[data-theme="dark"] .preferences-about,
html[data-theme="dark"] .preferences-theme-card,
html[data-theme="dark"] .preferences-setting-row,
html[data-theme="dark"] .preferences-event-card,
html[data-theme="dark"] .preferences-form-field select,
html[data-theme="dark"] .preferences-form-field input {
    background: var(--surface);
}

html[data-theme="dark"] .preferences-theme-card.is-selected,
html[data-theme="dark"] .preferences-theme-card:has(input:checked),
html[data-theme="dark"] .preferences-event-card.is-selected,
html[data-theme="dark"] .preferences-event-card:has(input:checked),
html[data-theme="dark"] .preferences-tab:hover,
html[data-theme="dark"] .preferences-tab:focus-visible,
html[data-theme="dark"] .preferences-tab.is-active {
    background: var(--primary-light);
}

@media (max-width: 1280px) {
    .preferences-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .preferences-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 960px) {
    .preferences-layout,
    .preferences-theme-grid,
    .preferences-form-grid,
    .preferences-event-grid {
        grid-template-columns: 1fr;
    }

    .preferences-tabs {
        display: flex;
        gap: 8px;
        min-height: 0;
        overflow-x: auto;
        padding: 12px;
    }

    .preferences-tab {
        flex: 0 0 auto;
    }
}

.profile-page-header {
    margin-bottom: 1.5rem;
}

.profile-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.98fr);
    gap: 1.5rem;
    align-items: start;
}

.profile-main-column,
.profile-side-column {
    display: grid;
    gap: 1.5rem;
}

.profile-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: none;
}

.profile-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-panel-header-simple {
    margin-bottom: 1.75rem;
}

.profile-panel-header h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.profile-panel-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0.35rem 0 0;
}

.profile-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.profile-edit-button:hover,
.profile-action-row:hover,
.profile-signout-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.profile-field-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.profile-field-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-field-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-field-card {
    display: grid;
    align-content: center;
    min-height: 5.3rem;
    gap: 0.4rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.profile-field-card span,
.profile-password-field > span:first-child {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.profile-field-card strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.profile-field-card input {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    outline: 0;
}

.profile-field-card input::placeholder {
    color: var(--text);
    opacity: 1;
}

.profile-field-card input:not([readonly]) {
    color: var(--primary);
}

.profile-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    width: fit-content;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: var(--surface);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
}

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

.profile-action-row,
.profile-signout-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.profile-password-panel,
.profile-session-panel {
    padding: 1.55rem;
}

.profile-password-field {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
}

.profile-password-field .form-control {
    min-height: 2.6rem;
    border-radius: 8px;
}

.profile-password-requirements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
    margin: -0.15rem 0 1.35rem;
    padding: 0;
    list-style: none;
}

.profile-password-requirements li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--success);
    font-size: 0.78rem;
    line-height: 1.3;
}

.profile-password-requirements li:not(.is-met) {
    color: var(--text-muted);
}

.profile-session-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 4.8rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.profile-session-row span {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.profile-session-row strong {
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 700;
}

.profile-session-row small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.profile-session-row em {
    border-radius: 999px;
    background: var(--home-green-bg-strong);
    color: var(--home-success-text);
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    padding: 4px 8px;
    white-space: nowrap;
}

.profile-signout-button {
    justify-content: flex-start;
    gap: 0.65rem;
    color: var(--primary);
    cursor: pointer;
}

@media (max-width: 1180px) {
    .profile-page-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .profile-field-grid-two,
    .profile-field-grid-four,
    .profile-password-requirements {
        grid-template-columns: 1fr;
    }

    .profile-panel {
        padding: 16px;
    }

    .profile-panel-header {
        align-items: stretch;
        flex-direction: column;
    }
}

.mcp-guide-sublabel {
    font-size: 0.78rem;
    color: var(--text-muted, rgb(107, 114, 128));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mcp-guide-sublabel code {
    font-size: 0.75rem;
    background: none;
    color: inherit;
}

.access-token-step-list {
    margin: .5rem 0 0 1.25rem;
    font-size: .875rem;
    line-height: 1.75;
}
.access-token-step-list li {
    margin-bottom: .25rem;
}

.access-token-form-title {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.access-token-create-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.access-token-create-name {
    flex: 1;
    min-width: 200px;
}

.access-token-table-wrap {
    padding: 0;
    overflow-x: auto;
}

.access-token-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.access-token-table {
    width: 100%;
    border-collapse: collapse;
}

.access-token-table-head {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.access-token-table-row {
    border-bottom: 1px solid var(--border);
}

.access-token-table-cell {
    padding: 0.5rem 0.75rem;
}

.access-token-table-cell--strong {
    font-weight: 600;
}

.access-token-table-cell--mono {
    font-family: monospace;
    font-size: 0.85rem;
}

.access-token-table-cell--muted {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.access-token-table-cell--actions {
    text-align: right;
}

/* Generated Extracted Styles */
.gen-style-0596d1 { font-size:0.75rem; margin-top:0.4rem; line-height:1.45; }
.gen-style-075804 { min-width: 120px; }
.gen-style-0a07c7 { font-size: 0.8125rem; }
.gen-style-0f09ce { margin: 0; flex-shrink: 0; }
.gen-style-111a68 { font-weight:400; color:rgb(107, 114, 128); }
.gen-style-13f83e { display:flex; align-items:center; gap:0.75rem; }
.gen-style-1459fb { font-size: 0.8rem; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-style-14c236 { flex-wrap: wrap; }
.gen-style-156729 { flex-wrap: wrap; margin-left: auto; }
.gen-style-217e9b { padding:3rem; }
.gen-style-257995 { margin-bottom: 2rem; }
.gen-style-25eb7a { flex:1; color:var(--text); }
.gen-style-26dd46 { padding:0; }
.gen-style-26ef78 { display: flex; align-items: center; gap: 0.625rem; }
.gen-style-2917c0 { font-size: 1.125rem; }
.gen-style-33f917 { width:100%; font-size:0.8125rem; border:1px solid rgb(209, 213, 219); border-radius:4px; padding:0.5rem; }
.gen-style-34964f { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; background:var(--surface-2, rgb(241, 245, 249)); }
.gen-style-393e6a { background:<?= $seatColor ?>; height:100%; border-radius:3px; width:<?= $seatPct ?>%; transition:width 300ms ease; }
.gen-style-39b6fc { padding:0.6rem 0.85rem; font-size:0.875rem; font-weight:600; color:rgb(6, 95, 70); cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; background:rgb(236, 253, 245); border-radius:6px; user-select:none; }
.gen-style-3bdbf2 { font-size:0.8rem; margin-top:0.1rem; }
.gen-style-3c621e { width: <?= $pct ?>% }
.gen-style-40caf7 { width:100%; font-size:0.8125rem; font-family:inherit; border:1px solid rgb(209, 213, 219); border-radius:4px; padding:0.5rem; resize:vertical; }
.gen-style-44292d { color:var(--text-secondary); font-style:italic; margin:0; font-size:0.875rem; }
.gen-style-45ff67 { font-size:0.8rem; margin-top:0.4rem; }
.gen-style-464282 { font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
                               text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.75rem;
                               border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.gen-style-46dcee { margin:0; }
.gen-style-49cdf8 { flex: 1; }
.gen-style-4aca16 { margin:0.25rem 0 0; font-size:0.875rem; }
.gen-style-4cb8ce { position:relative; }
.gen-style-4d19ca { margin-top:0.75rem; background:var(--border); border-radius:3px; height:5px; }
.gen-style-50915c { font-size:0.875rem; }
.gen-style-53a668 { display:flex; flex-wrap:wrap; gap:0.35rem; margin-bottom:0.5rem; min-height:0; }
.gen-style-5678e1 { font-size:1.125rem; }
.gen-style-588c2d { width: 80px; }
.gen-style-5b214b { flex-shrink:0; }
.gen-style-5cca83 { gap:0.25rem; }
.gen-style-5e9beb { padding:0.75rem 0.85rem 0.85rem; }
.gen-style-600069 { margin-left: 0.5rem; }
.gen-style-616405 { text-decoration: none; font-size: 0.75rem; }
.gen-style-6420dc { width: 130px; flex: 0 0 auto; }
.gen-style-6b7db9 { font-size: 0.85rem; font-weight: 600; }
.gen-style-6be3bc { display:flex; align-items:center; gap:6px; font-size:14px; cursor:pointer; }
.gen-style-703ccd { align-self: flex-end; }
.gen-style-754ab1 { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); }
.gen-style-793a57 { margin-top:0.25rem; }
.gen-style-7b090a { display:flex; align-items:center; gap:1rem; padding:0.75rem 1.25rem; border-bottom:1px solid var(--border); font-size:0.875rem; }
.gen-style-7f3b53 { padding:0.6rem 0.85rem; font-size:0.875rem; font-weight:600; color:rgb(91, 33, 182); cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; background:rgb(245, 243, 255); border-radius:6px; user-select:none; }
.gen-style-83bdfb { font-size: 0.875rem; word-break: break-all; }
.gen-style-860063 { font-size:0.75rem; color:rgb(107, 114, 128); font-weight:400; }
.gen-style-8796ca { font-size:0.9375rem; }
.gen-style-889e64 { display:flex; flex-direction:column; gap:6px; padding-top:4px; }
.gen-style-8c82cd { color: rgb(100, 116, 139); font-size: 14px; margin-top: 8px; }
.gen-style-91792f { white-space: nowrap; font-size: 0.85rem; }
.gen-style-963e14 { font-size:0.7rem; flex-shrink:0; }
.gen-style-972f37 { flex-wrap: wrap; gap: 1rem; }
.gen-style-9c9fd4 { padding-top: 1rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; align-items: center; }
.gen-style-a530f6 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; flex-wrap: wrap; }
.gen-style-a95f6d { color: rgb(203, 213, 225); font-style: italic; }
.gen-style-aa73f6 { flex-shrink:0; font-size:0.75rem; }
.gen-style-ad4b28 { border:1px solid rgb(209, 250, 229); border-radius:6px; margin-bottom:0.75rem; }
.gen-style-b56181 { overflow-x: auto; }
.gen-style-b662f2 { padding: 0; }
.gen-style-c54f77 { border:1px solid rgb(237, 233, 254); border-radius:6px; margin-bottom:0.75rem; }
.gen-style-ca0e4e { display:none; position:absolute; top:calc(100% + 2px); left:0; right:0; z-index:200;
                    background:rgb(255, 255, 255); border:1px solid var(--border); border-radius:6px;
                    box-shadow:0 4px 16px rgba(0,0,0,0.12); max-height:200px; overflow-y:auto; }
.gen-style-cb4589 { display:none }
.gen-style-cfdf60 { padding: 3rem; }
.gen-style-d3297f { margin-bottom: 1.5rem; }
.gen-style-d3af80 { display: flex; align-items: center; gap: 0.5rem;
                                      padding: 0.4rem 0.6rem; border-radius: 4px; cursor: pointer;
                                      background: <?= $checked ? 'var(--primary-light, rgb(239 246 255))' : 'transparent' ?>;
                                      border: 1px solid <?= $checked ? 'var(--primary, rgb(59 130 246))' : 'var(--border)' ?>; }
.gen-style-daea08 { font-size:0.75rem; margin-top:0.35rem; }
.gen-style-dcab71 { font-size: 0.7rem; }
.gen-style-dd0c1e { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.4rem; }
.gen-style-e2b74b { margin: 0; }
.gen-style-e7992d { font-size: 0.85rem; }
.gen-style-f49cbe { font-size:0.75rem; margin:0 0 0.5rem; }
.gen-style-f8a732 { margin-top: 0.5rem; }
.gen-style-fb2a71 { font-size: 0.8rem; }
.gen-style-fcb571 { font-weight:600; border-bottom:1px solid var(--border); padding-bottom:0.5rem; margin-bottom:0.5rem; }

/* === Superadmin Personas (CSP Migration) ==================================== */
.persona-card {
    background: var(--surface, rgb(255, 255, 255));
    border: 1px solid var(--border, rgb(229, 231, 235));
    border-radius: var(--radius, 8px);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.persona-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.persona-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text, rgb(31 41 55));
}
.persona-stage-badge {
    font-size: 0.72rem;
    font-weight: 500;
}
.panel-sub-accordion {
    margin-left: 0;
    border-color: var(--border, rgb(229, 231, 235));
}
.persona-panel-actions {
    border-top: 1px solid var(--border, rgb(229, 231, 235));
    padding-top: 1rem;
    margin-top: 0.5rem;
}
.persona-actions-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.persona-level-help {
    font-size: 0.9rem;
}
.persona-level-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.persona-level-icon {
    font-size: 1.2rem;
}

/* Modal System (Generic) */
.modal-lg,
.wi-modal,
.story-modal {
    max-width: 920px;
}

.story-modal {
    max-width: 1120px;
}

.story-modal .modal-header {
    padding: 1.55rem 2rem 1.1rem;
}

.story-modal-body {
    gap: 0.85rem 1.65rem;
    grid-auto-flow: row;
    grid-auto-rows: max-content;
    padding: 1.15rem 2rem 1.5rem;
}

.story-modal .form-group {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.story-modal .modal-field-wrap {
    align-self: start;
}

.story-modal .modal-field-wrap[data-field="assignee_user_id"] {
    grid-column: 1 / -1;
    max-width: 31rem;
}

.story-modal .modal-field-wrap[data-field="title"],
.story-modal .modal-field-wrap[data-field="description"],
.story-modal .modal-field-wrap[data-field="acceptance_criteria"],
.story-modal .modal-field-wrap[data-field="kr_hypothesis"],
.story-modal .modal-field-wrap[data-field="blocked_by"],
.story-modal .modal-field-wrap[data-field="git_links"] {
    grid-column: 1 / -1;
}

.story-modal-helper {
    color: var(--text-light);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0.45rem 0 0;
}

.story-assignee-control {
    position: relative;
}

.story-assignee-control select {
    padding-left: 3.3rem;
}

.story-assignee-avatar {
    align-items: center;
    background: rgb(241, 245, 249);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 999px;
    color: rgb(71, 85, 105);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 1.7rem;
    justify-content: center;
    left: 0.8rem;
    line-height: 1;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1.7rem;
    z-index: 1;
}

.story-assignee-avatar svg {
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 1rem;
}

.story-assignee-avatar--initials {
    background: rgb(226, 232, 240);
}

.story-modal .modal-inline-control {
    align-items: center;
}

.story-modal .modal-inline-control .btn {
    white-space: nowrap;
}

.story-modal .modal-detail {
    margin-bottom: 0;
}

.story-modal .git-links-section {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 0.75rem 1rem;
    grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
    margin-top: 0.4rem;
    padding-top: 1rem;
}

.story-modal .git-links-section__header {
    align-items: flex-start;
    display: block;
    margin-bottom: 0;
}

.story-modal .git-links-section__title {
    color: var(--text);
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
}

.story-modal .git-links-section__loading {
    display: inline-block;
    margin-top: 0.25rem;
}

.story-modal .git-links-section__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.story-modal .git-links-section__list,
.story-modal .git-links-section__error {
    grid-column: 2;
}

.story-modal .git-link-row {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.story-modal .git-link-ref {
    min-width: 0;
    overflow-wrap: anywhere;
}

.story-modal .modal-footer {
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (max-width: 900px) {
    .story-modal .git-links-section {
        grid-template-columns: 1fr;
    }

    .story-modal .git-links-section__list,
    .story-modal .git-links-section__error {
        grid-column: 1;
    }
}

@media (max-width: 720px) {
    .story-modal .modal-header,
    .story-modal-body,
    .story-modal .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .story-modal .git-links-section__form {
        grid-template-columns: 1fr;
    }
}
.billing-confirmation-modal {
    max-width: 560px;
}

.billing-topup-modal {
    max-width: 560px;
}

.billing-topup-modal .modal-body {
    padding-bottom: 1rem;
}

.billing-topup-modal .modal-footer {
    border-top: 1px solid var(--border);
}

.billing-confirmation-copy {
    margin: 0 0 1rem;
    color: var(--text, rgb(31 41 55));
    line-height: 1.6;
}
.billing-confirmation-note {
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: var(--text, rgb(31 41 55));
}
.billing-confirmation-error {
    margin: 0.75rem 0 0;
    color: rgb(185, 28, 28);
    font-size: 0.9rem;
    font-weight: 600;
}

/* === Privacy, Terms, and Support ========================================= */

.policy-document {
    max-width: 860px;
    margin: 2rem auto 4rem;
}

.policy-document__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.9rem;
}

.policy-document__body {
    background: var(--surface, rgb(255, 255, 255));
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    padding: 2rem;
    line-height: 1.7;
    box-shadow: var(--shadow-sm);
}

.policy-document__body h1 {
    margin-top: 0;
}

.policy-acknowledgement {
    max-width: 980px;
    margin: 0 auto 4rem;
}

.policy-acknowledgement .page-header {
    margin-bottom: 1.25rem;
}

.policy-acknowledgement .page-header h1 {
    margin-bottom: 0.35rem;
}

.policy-acknowledgement__shell {
    background: var(--surface, rgb(255, 255, 255));
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.policy-acknowledgement__intro {
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
    background: rgb(248, 250, 252);
}

.policy-acknowledgement__intro h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.policy-acknowledgement__intro p {
    margin: 0;
    color: var(--text-muted, rgb(100, 116, 139));
}

.policy-acknowledgement__documents {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.policy-acknowledgement__document {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 150px;
    padding: 1.1rem;
    background: rgb(255, 255, 255);
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    box-shadow: none;
}

.policy-acknowledgement__document h2 {
    margin: 0;
    font-size: 1.1rem;
}

.policy-acknowledgement__document p {
    margin: 0;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.92rem;
}

.policy-acknowledgement__document a {
    margin-top: auto;
    font-weight: 700;
    text-decoration: none;
}

.policy-acknowledgement__document a:hover,
.policy-acknowledgement__document a:focus {
    text-decoration: underline;
}

.policy-acknowledgement__form {
    display: grid;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border, rgb(219 227 239));
}

.policy-consent,
.support-diagnostics {
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 6px;
    background: rgb(248, 250, 252);
}

.policy-consent {
    padding: 0.85rem 1rem;
}

.support-diagnostics {
    padding: 0.7rem 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    line-height: 1.45;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
}

.support-page-header {
    margin-bottom: 1.25rem;
}

.support-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
    max-width: 1280px;
}

.support-hero__content {
    align-self: center;
}

.support-hero__content h2 {
    margin: 0 0 0.5rem;
    color: var(--text, rgb(15 23 42));
    font-size: 1.45rem;
}

.support-hero__content p,
.support-quick-card p,
.support-section-heading p,
.support-card-intro {
    color: var(--text-muted, rgb(100, 116, 139));
    line-height: 1.55;
}

.support-hero__content p {
    margin: 0 0 1rem;
    max-width: 680px;
}

.support-search {
    display: block;
    max-width: 620px;
}

.support-search .form-control {
    min-height: 3rem;
    padding-left: 1rem;
}

.support-quick-card {
    margin-top: 0;
    background: var(--primary-light, rgb(238 242 255));
    border-color: rgb(199, 210, 254);
    box-shadow: var(--shadow-sm);
}

.support-quick-card h2 {
    margin: 0 0 0.5rem;
    color: var(--text, rgb(15 23 42));
    font-size: 1.1rem;
}

.support-quick-card p {
    margin: 0 0 1rem;
}

.support-section {
    max-width: 1280px;
    margin-bottom: 1.5rem;
}

.support-section-heading {
    margin-bottom: 0.85rem;
}

.support-section-heading h2 {
    margin: 0 0 0.35rem;
    color: var(--text, rgb(15 23 42));
    font-size: 1.25rem;
}

.support-section-heading p {
    margin: 0;
}

.support-topic-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.support-topic-card {
    margin-top: 0;
    min-height: 100%;
}

.support-topic-card[hidden] {
    display: none;
}

.support-topic-card .card-body {
    display: flex;
    flex-direction: column;
    min-height: 12rem;
    padding: 1rem;
}

.support-topic-card h3 {
    margin: 0.55rem 0 0.5rem;
    color: var(--text, rgb(15 23 42));
    font-size: 0.96rem;
}

.support-topic-card p {
    margin: 0 0 1rem;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.84rem;
    line-height: 1.55;
}

.support-card-link {
    margin-top: auto;
    color: var(--primary, rgb(79, 70, 229));
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.support-card-link:hover,
.support-card-link:focus {
    text-decoration: underline;
}

.support-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    gap: 1.5rem;
    align-items: start;
    max-width: 1280px;
}

.support-main-column {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.support-guide-card,
.support-form-card,
.support-resource-card {
    margin-top: 0;
}

.support-form-card {
    position: sticky;
    top: 1rem;
}

.support-card-intro {
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}

.support-guide-card .card-header {
    align-items: flex-start;
}

.support-guide-card .card-header .text-muted {
    margin: 0.35rem 0 0;
}

.support-guide-list {
    padding: 0;
}

.support-guide-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
}

.support-guide-row:last-child {
    border-bottom: 0;
}

.support-guide-row__heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.support-guide-row h3 {
    color: var(--text, rgb(15 23 42));
    font-size: 1rem;
    margin: 0;
}

.support-guide-row p {
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0;
}

.support-guide-row__next {
    margin-top: 0.35rem !important;
}

.support-guide-row__next strong,
.support-guide-row__actions strong {
    color: var(--text, rgb(15 23 42));
}

.support-guide-row__actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: flex-start;
}

.support-guide-row__actions span {
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.82rem;
    line-height: 1.4;
}

.support-guide__stage {
    color: var(--primary, rgb(29 78 216));
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.support-resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.support-link-list {
    padding: 0;
}

.support-link-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
    color: var(--text, rgb(15 23 42));
    text-decoration: none;
}

.support-link-list a:last-child {
    border-bottom: 0;
}

.support-link-list a:hover,
.support-link-list a:focus {
    background: var(--bg, rgb(248 250 252));
    text-decoration: none;
}

.support-link-list strong {
    display: block;
    margin-bottom: 0.2rem;
}

.support-link-list small {
    display: block;
    color: var(--text-muted, rgb(100, 116, 139));
    line-height: 1.45;
}

.support-form {
    margin-top: 0;
}

.support-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.support-form .form-group {
    margin-bottom: 1rem;
}

.support-form .form-control {
    width: 100%;
    min-height: 2.45rem;
    box-sizing: border-box;
}

.support-form textarea.form-control {
    min-height: 7.5rem;
}

.support-form .support-summary-input.form-control {
    min-height: 2.45rem;
}

.settings-policy-textarea {
    width: 100%;
    min-height: 16rem;
    resize: vertical;
    line-height: 1.5;
}

.support-email,
.support-links {
    margin-bottom: 0;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.84rem;
}

.support-email {
    margin-top: 0.9rem;
}

@media (max-width: 960px) {
    .support-hero,
    .support-layout {
        grid-template-columns: 1fr;
    }

    .support-form-card {
        position: static;
    }

    .support-topic-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .policy-acknowledgement__documents {
        grid-template-columns: 1fr;
    }

    .support-form-grid {
        grid-template-columns: 1fr;
    }

    .support-topic-grid,
    .support-resource-grid {
        grid-template-columns: 1fr;
    }

    .support-guide-row {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

.support-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    gap: 1.25rem;
    align-items: start;
    max-width: 1280px;
}

.support-dashboard__main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.support-search-card {
    margin-top: 0;
}

.support-search-card .card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
}

.support-search-card h2 {
    margin: 0 0 0.35rem;
    color: var(--text, rgb(15 23 42));
    font-size: 1.2rem;
}

.support-search-card p,
.support-card-intro {
    margin: 0;
}

.support-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.support-guide-card {
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 6px;
    background: var(--surface, rgb(253 253 255));
    box-shadow: none;
}

.support-guide-card[hidden] {
    display: none;
}

.support-guide-card summary {
    display: grid;
    gap: 0.55rem;
    min-height: 13rem;
    padding: 1rem;
    cursor: pointer;
    list-style: none;
}

.support-guide-card summary::-webkit-details-marker {
    display: none;
}

.support-guide-card summary:hover,
.support-guide-card summary:focus-visible {
    background: var(--bg, rgb(248 250 252));
}

.support-guide-card[open] summary {
    min-height: auto;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
}

.support-guide-card__stage {
    color: var(--primary, rgb(79, 70, 229));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.support-guide-card__title {
    color: var(--text, rgb(15 23 42));
    font-weight: 700;
}

.support-guide-card__summary {
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.92rem;
    line-height: 1.5;
}

.support-guide-card__action {
    align-self: end;
    color: var(--primary, rgb(79, 70, 229));
    font-size: 0.86rem;
    font-weight: 700;
}

.support-guide-card__details {
    padding: 1rem;
    background: var(--bg, rgb(248 250 252));
}

.support-guide-card__details dl {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.support-guide-card__details dt {
    margin-bottom: 0.18rem;
    color: var(--text, rgb(15 23 42));
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.support-guide-card__details dd {
    margin: 0;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 0.9rem;
    line-height: 1.45;
}

.support-empty-state {
    margin: 0;
    padding: 0 1.25rem 1.25rem;
    color: var(--text-muted, rgb(100, 116, 139));
}

.support-resource-card {
    margin-top: 0;
}

.support-form-card .card-body {
    display: grid;
    gap: 1rem;
}

.support-form .form-group {
    margin-bottom: 0;
}

.support-form {
    display: grid;
    gap: 1rem;
}

.support-form .btn {
    width: fit-content;
}

.support-form .support-summary-input.form-control {
    min-height: 4.5rem;
    resize: vertical;
}

@media (max-width: 1180px) {
    .support-guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .support-dashboard,
    .support-search-card .card-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .support-guide-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .support-search-card .card-body {
        padding: 1rem;
    }
}

/* === Support Design System Pilot =========================================== */

.support-theme .app-content {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - var(--topbar-height));
    padding: 28px 32px 32px;
}

.support-theme .support-page-header {
    align-items: center;
    margin-bottom: 24px;
}

.support-theme .support-page-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.support-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
    width: 100%;
}

.support-workspace__main,
.support-workspace__aside {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.support-panel,
.support-hero-panel,
.support-summary-strip,
.support-list-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.support-hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    min-height: 0;
    overflow: hidden;
}

.support-hero-panel__content {
    padding: 24px;
}

.support-kicker,
.support-hero-panel__meta,
.support-section-heading > span,
.support-guide-stage,
.support-new-badge {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.support-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--primary);
}

.support-hero-panel h2 {
    max-width: 760px;
    margin: 0 0 16px;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.support-search-field {
    position: relative;
    display: block;
    max-width: 820px;
}

.support-search-field svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    transform: translateY(-50%);
}

.support-search-field .form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    box-shadow: none;
}

.support-search-field .form-control:focus-visible,
.support-topic-pill:focus-visible,
.support-resource-card:focus-visible,
.support-guide-link:focus-visible,
.support-update-link:focus-visible,
.support-secondary-action:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

.support-search-field .form-control::placeholder {
    color: var(--text-muted);
}

.support-topic-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.support-topic-pill {
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.support-topic-pill:hover,
.support-topic-pill:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.support-hero-panel__aside {
    display: grid;
    align-content: center;
    gap: 16px;
    padding: 24px;
    border-left: 1px solid var(--border);
    background: var(--bg-secondary);
}

.support-hero-panel__aside strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.support-hero-panel__aside ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.support-hero-panel__aside li {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.support-hero-panel__aside svg {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    fill: none;
    stroke: var(--success);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.support-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
}

.support-summary-strip div {
    min-width: 0;
    padding: 16px 20px;
    border-right: 1px solid var(--border);
}

.support-summary-strip div:last-child {
    border-right: 0;
}

.support-summary-strip span,
.support-summary-strip strong,
.support-summary-strip small {
    display: block;
    min-width: 0;
}

.support-summary-strip span {
    overflow: hidden;
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-summary-strip strong {
    margin-top: 4px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.support-summary-strip small {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.support-browse-panel,
.support-product-guides,
.support-resource-panel,
.support-list-panel,
.support-contact-card,
.support-status-card {
    padding: 20px;
}

.support-browse-panel h2,
.support-product-guides h2,
.support-resource-panel h2,
.support-list-panel h3,
.support-contact-card h2,
.support-status-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.support-list-panel h3,
.support-contact-card h2,
.support-status-card h2 {
    font-size: 16px;
}

.support-category-grid,
.support-product-guide-grid,
.support-resource-grid {
    display: grid;
    gap: 12px;
}

.support-category-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 16px;
}

.support-product-guide-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.support-resource-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.support-category-card[hidden],
.support-product-guide[hidden],
.support-guide-link[hidden],
.support-update-link[hidden] {
    display: none;
}
.support-category-card,
.support-product-guide,
.support-resource-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: none;
}

.support-category-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    min-height: 128px;
    padding: 20px;
}

.support-category-card__icon,
.support-card-heading__icon,
.support-guide-link__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--primary);
}

.support-category-card__icon {
    width: 32px;
    height: 32px;
}

.support-category-card__icon svg,
.support-card-heading__icon svg,
.support-guide-link__icon svg,
.support-resource-card svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.support-category-card h3,
.support-product-guide__title,
.support-resource-card strong {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.support-category-card p,
.support-product-guide p,
.support-product-guide dd,
.support-resource-card small,
.support-card-heading p,
.support-section-heading p,
.support-email,
.support-status-card p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.support-category-card p {
    min-height: 0;
    margin: 8px 0 12px;
}

.support-category-card a,
.support-status-card a,
.support-secondary-action,
.support-product-guide__action {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.support-category-card a:hover,
.support-category-card a:focus,
.support-status-card a:hover,
.support-status-card a:focus,
.support-secondary-action:hover,
.support-secondary-action:focus,
.support-product-guide__action:hover,
.support-product-guide__action:focus {
    text-decoration: underline;
}

.support-section-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.support-section-heading p {
    max-width: 720px;
    margin: 8px 0 0;
}

.support-section-heading > span,
.support-guide-stage,
.support-new-badge {
    border-radius: var(--radius-full);
}

.support-section-heading > span {
    flex: 0 0 auto;
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.support-product-guide {
    display: grid;
    gap: 16px;
    align-content: start;
    min-height: 320px;
    padding: 20px;
}

.support-product-guide header {
    display: grid;
    gap: 8px;
}

.support-guide-stage {
    width: fit-content;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
}

.support-product-guide p,
.support-product-guide dl {
    margin: 0;
}

.support-product-guide dl {
    display: grid;
    gap: 10px;
}

.support-product-guide dl div {
    display: grid;
    gap: 4px;
}

.support-product-guide dt {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.support-product-guide__action,
.support-product-guide__restricted {
    align-self: end;
    width: fit-content;
    margin-top: auto;
}

.support-product-guide__restricted {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.support-resource-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    min-height: 104px;
    padding: 16px;
    color: var(--text);
    text-decoration: none;
}

.support-resource-card:hover,
.support-resource-card:focus {
    border-color: var(--primary);
}

.support-resource-card span {
    display: grid;
    place-items: center;
    grid-row: 1 / span 2;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
}

.support-resource-card small {
    display: block;
    grid-column: 2;
    margin-top: 4px;
}

.support-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
    gap: 16px;
    margin-top: 20px;
}

.support-guide-list,
.support-update-list {
    margin-top: 16px;
}

.support-guide-link,
.support-update-link {
    display: grid;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
}

.support-guide-link {
    grid-template-columns: 18px minmax(0, 1fr) max-content 12px;
    gap: 12px;
}

.support-update-link {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 10px;
}

.support-guide-link:last-child,
.support-update-link:last-child {
    border-bottom: 0;
}

.support-guide-link__icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.support-guide-link__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-guide-link__views,
.support-update-link time {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.support-new-badge {
    padding: 4px 8px;
    background: var(--primary-light);
    color: var(--primary);
}

.support-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    margin-top: 20px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}

.support-workspace__aside {
    position: sticky;
    top: 24px;
}

.support-card-heading {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.support-card-heading__icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: var(--radius);
    background: var(--primary-light);
}

.support-card-heading p {
    margin: 8px 0 0;
}

.support-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.support-form .form-group {
    margin: 0;
}

.support-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.support-form .form-control {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.support-form textarea.form-control {
    min-height: 96px;
    padding: 10px 12px;
    resize: vertical;
}

.support-form #details {
    min-height: 128px;
}

.support-counted-field {
    position: relative;
}

.support-counter {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
}

.support-diagnostics {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
}

.support-diagnostics input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.support-diagnostics .page-info {
    margin-left: 0;
}

.support-diagnostics .page-info-btn {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.support-diagnostics .page-info-popover {
    left: auto;
    right: -8px;
}

.support-diagnostics .page-info-popover::before {
    left: auto;
    right: 14px;
}

.support-form .btn {
    width: fit-content;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
}

.support-email {
    margin: 16px 0 0;
}

.support-email a {
    color: var(--primary);
    text-decoration: none;
}

.support-status-card h2 {
    margin-bottom: 16px;
}

.support-status-line {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--success);
    font-size: 14px;
}

.support-status-line span {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--success);
}

.support-status-card p {
    margin: 8px 0 16px 24px;
}

.support-empty-state {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

@media (max-width: 1240px) {
    .support-workspace {
        grid-template-columns: 1fr;
    }

    .support-workspace__aside {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .support-product-guide-grid,
    .support-resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .support-theme .app-content {
        padding: 24px 18px 36px;
    }

    .support-hero-panel,
    .support-category-grid,
    .support-lower-grid,
    .support-summary-strip,
    .support-workspace__aside {
        grid-template-columns: 1fr;
    }

    .support-hero-panel__aside {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .support-summary-strip div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .support-summary-strip div:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 560px) {
    .support-theme .app-content {
        padding: 20px 14px 32px;
    }

    .support-category-card,
    .support-guide-link,
    .support-update-link {
        grid-template-columns: 1fr;
    }

    .support-guide-link__title {
        white-space: normal;
    }

    .support-topic-row span {
        flex-basis: 100%;
    }

    .support-product-guide-grid,
    .support-resource-grid {
        grid-template-columns: 1fr;
    }

    .support-section-heading {
        display: grid;
    }

    .support-hero-panel__content,
    .support-hero-panel__aside,
    .support-browse-panel,
    .support-product-guides,
    .support-resource-panel,
    .support-contact-card,
    .support-status-card {
        padding: 20px;
    }
}

/* === Accessibility ========================================================= */

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: rgb(255, 255, 255);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transform: translateY(-200%);
    transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
}

/* === Flash Messages ========================================================= */

/* === StratFlow App Shell ================================================== */

:root {
    --shell-app-bg: rgb(248 251 255);
    --shell-sidebar-bg: linear-gradient(180deg, rgb(6 26 51) 0%, rgb(8 35 63) 48%, rgb(6 27 52) 100%);
    --shell-sidebar-text: rgb(231 237 248);
    --shell-white: rgb(255 255 255);
    --shell-icon-soft: rgb(219 234 254);
    --shell-muted: rgb(169 186 208);
    --shell-muted-strong: rgb(184 201 223);
    --shell-option-bg: rgb(11 31 56);
    --shell-section: rgb(196 210 231);
    --shell-active-bg: linear-gradient(135deg, rgb(83 55 232) 0%, rgb(99 55 216) 52%, rgb(51 75 221) 100%);
    --shell-done: rgb(34 197 94);
    --shell-navy: rgb(15 36 64);
    --shell-topbar-border: rgb(229 237 247);
    --shell-control: rgb(98 113 141);
    --shell-control-border: rgb(216 226 241);
    --shell-input-text: rgb(23 35 59);
    --shell-placeholder: rgb(115 131 159);
    --shell-chip-bg: rgb(242 245 250);
    --shell-chip-text: rgb(80 95 122);
    --shell-top-icon: rgb(7 23 52);
    --shell-hover: rgb(64 56 216);
    --shell-divider: rgb(219 228 241);
    --shell-brand-blue: rgb(22 132 255);
}

html[data-theme="dark"] {
    --shell-app-bg: rgb(13 21 36);
    --shell-topbar-border: rgb(38 50 68);
    --shell-control: rgb(148 163 184);
    --shell-control-border: rgb(51 65 85);
    --shell-input-text: rgb(226 232 240);
    --shell-placeholder: rgb(148 163 184);
    --shell-chip-bg: rgb(30 41 59);
    --shell-chip-text: rgb(203 213 225);
    --shell-top-icon: rgb(226 232 240);
    --shell-hover: rgb(165 180 252);
    --shell-divider: rgb(51 65 85);
}

.app-layout {
    background: var(--shell-app-bg);
}

.admin-theme,
.admin-theme .app-content,
.admin-theme .app-main,
.superadmin-theme,
.superadmin-theme .app-content,
.superadmin-theme .app-main {
    background: var(--shell-app-bg);
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--shell-sidebar-bg);
    color: var(--shell-sidebar-text);
}

.sidebar-brand {
    height: 70px;
    justify-content: flex-start;
    padding: 27px 20px 12px;
    background: transparent;
    border-bottom: 0;
}

.sidebar-brand a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--shell-white);
    text-decoration: none;
    letter-spacing: 0;
}

.sidebar-brand-full {
    min-width: 0;
}

.sidebar-brand .sidebar-brand-mark {
    display: none;
}

.sidebar.is-collapsed .sidebar-brand .sidebar-brand-mark {
    display: inline-flex;
}

.sidebar-brand-text {
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    color: var(--shell-white);
}

.sidebar-brand-mark-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.sidebar-brand-mark-logo--wordmark {
    color: var(--shell-brand-blue);
}

.sidebar-workspace {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 16px);
    min-height: 56px;
    margin: 3px 8px 18px;
    padding: 10px 10px;
    border: 1px solid rgba(168, 189, 216, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--shell-white);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: background 150ms ease, border-color 150ms ease;
}

.sidebar-workspace:hover,
.sidebar-workspace[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(168, 189, 216, 0.34);
}

.sidebar-workspace-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    color: var(--shell-icon-soft);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    flex: 0 0 auto;
}

.sidebar-workspace-initial {
    background: var(--shell-active-bg);
    color: var(--shell-white);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.sidebar-workspace-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-workspace-name {
    font-size: 13.5px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--shell-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-workspace-label {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--shell-muted);
}

.sidebar-workspace-chevron {
    margin-left: auto;
    color: var(--shell-muted-strong);
}

.sidebar-popover {
    position: fixed;
    z-index: 260;
    background: var(--shell-white);
    border: 1px solid rgb(221 228 238);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    color: rgb(15 23 42);
}

.sidebar-popover[hidden] {
    display: none;
}

.sidebar-project-popover {
    top: 105px;
    left: 129px;
    width: 208px;
    padding-top: 13px;
    overflow: hidden;
}

.sidebar-popover-heading {
    padding: 0 17px 9px;
    color: rgb(83 98 124);
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sidebar-project-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 0 12px 8px;
}

.sidebar-project-option,
.sidebar-popover-action {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-project-option {
    gap: 12px;
    min-height: 49px;
    padding: 6px 5px;
    border-radius: 7px;
    color: rgb(15 23 42);
}

.sidebar-project-option:hover {
    background: rgb(248 250 252);
}

.sidebar-project-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgb(241 245 249);
    color: rgb(85 98 120);
    font-size: 13px;
    font-weight: 700;
    flex: 0 0 auto;
}

.sidebar-project-initial.is-selected {
    background: var(--shell-active-bg);
    color: var(--shell-white);
}

.sidebar-project-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.sidebar-project-title {
    color: rgb(15 23 42);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-project-plan {
    margin-top: 5px;
    color: rgb(86 102 130);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-project-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: rgb(16 185 129);
    flex: 0 0 auto;
}

.sidebar-project-check .nav-icon {
    width: 14px;
    height: 14px;
}

.sidebar-popover-action {
    background: transparent;
    border: 0;
    gap: 12px;
    height: 42px;
    padding: 0 18px;
    border-top: 1px solid rgb(226 232 240);
    color: rgb(23 35 59);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    width: 100%;
}

.sidebar-popover-action:hover {
    background: rgb(248 250 252);
    text-decoration: none;
}

.sidebar-popover-action .nav-icon {
    width: 14px;
    height: 14px;
    color: rgb(37 55 86);
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px 10px;
}

.sidebar-nav a {
    gap: 11px;
    min-height: 33px;
    padding: 8px 12px;
    margin: 2px 0;
    color: rgba(241, 247, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    border-radius: 7px;
    border-left: 0;
    transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--shell-white);
}

.sidebar-nav a.active {
    background: var(--shell-active-bg);
    color: var(--shell-white);
    border-left: 0;
    box-shadow: none;
}

.sidebar-nav .nav-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: currentColor;
}

.sidebar-section-label {
    padding: 17px 6px 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--shell-section);
    letter-spacing: 0;
}

.sidebar-divider {
    border-top: 1px solid rgba(168, 189, 216, 0.16);
    margin: 17px 6px 13px;
}

.nav-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.28);
}

.nav-dot--done {
    background: var(--shell-done);
}

.sidebar-footer {
    margin-top: auto;
    padding: 0 18px 17px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 65px;
    padding: 16px 0;
    border-top: 1px solid rgba(168, 189, 216, 0.18);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    background: transparent;
    color: var(--shell-white);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
}

.sidebar-user:hover,
.sidebar-user[aria-expanded="true"] {
    color: var(--shell-white);
}

.sidebar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--shell-white);
    color: var(--shell-navy);
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
}

.sidebar-user-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13.5px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--shell-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--shell-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-chevron {
    margin-left: auto;
    color: var(--shell-muted-strong);
}

.sidebar-profile-popover {
    left: 145px;
    bottom: 79px;
    width: 172px;
    padding: 11px 0;
}

.sidebar-profile-popover::before {
    position: absolute;
    left: -7px;
    bottom: 15px;
    width: 12px;
    height: 12px;
    content: "";
    background: var(--shell-white);
    border-left: 1px solid rgb(221 228 238);
    border-bottom: 1px solid rgb(221 228 238);
    transform: rotate(45deg);
}

.sidebar-profile-popover a,
.sidebar-profile-popover button {
    display: flex;
    align-items: center;
    min-height: 31px;
    width: 100%;
    padding: 0 17px;
    border: 0;
    background: transparent;
    color: rgb(23 35 59);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    text-align: left;
}

.sidebar-profile-popover form {
    margin: 0;
}

.sidebar-profile-popover a:hover,
.sidebar-profile-popover button:hover,
.sidebar-profile-popover button:focus-visible {
    background: rgb(248 250 252);
    text-decoration: none;
}

.sidebar-profile-popover hr {
    border: none;
    border-top: 1px solid rgb(226 232 240);
    margin: 9px 17px;
}

.sidebar-profile-popover .sidebar-profile-danger {
    color: rgb(239 68 68);
}

.sidebar-collapse-btn {
    gap: 10px;
    padding: 13px 0 0;
    border-top: 1px solid rgba(168, 189, 216, 0.16);
    color: var(--shell-muted-strong);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-collapse-btn:hover {
    background: transparent;
    color: var(--shell-white);
}

.sidebar.is-collapsed .sidebar-workspace,
.sidebar.is-collapsed .sidebar-popover,
.sidebar.is-collapsed .sidebar-section-label,
.sidebar.is-collapsed .nav-label,
.sidebar.is-collapsed .nav-dot,
.sidebar.is-collapsed .sidebar-divider,
.sidebar.is-collapsed .sidebar-user-copy,
.sidebar.is-collapsed .sidebar-user-chevron {
    display: none;
}

.sidebar.is-collapsed .sidebar-brand {
    justify-content: center;
    padding: 20px 0 12px;
}

.sidebar.is-collapsed .sidebar-nav a,
.sidebar.is-collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 10px 0;
    margin-left: 10px;
    margin-right: 10px;
    gap: 0;
}

.sidebar.is-collapsed .sidebar-user {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.app-main {
    margin-left: var(--sidebar-width);
    background: var(--shell-app-bg);
}

.app-topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--shell-topbar-border);
    justify-content: flex-end;
    gap: 22px;
    padding: 0 24px;
}

html[data-theme="dark"] .app-topbar {
    background: rgba(15, 23, 42, 0.96);
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 286px;
    height: 38px;
    margin-left: auto;
    color: var(--shell-control);
    background: var(--shell-white);
    border: 1px solid var(--shell-control-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 35, 64, 0.03);
}

html[data-theme="dark"] .topbar-search,
html[data-theme="dark"] .sidebar-toggle {
    background: var(--surface);
    border-color: var(--border);
}

.shell-command-palette {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(420px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    z-index: 340;
    border: 1px solid rgb(226 232 240);
    border-radius: 10px;
    background: var(--shell-white);
    box-shadow: 0 18px 46px rgba(15, 35, 64, 0.16), 0 2px 8px rgba(15, 35, 64, 0.08);
    overflow: hidden;
    color: rgb(15 23 42);
}

html[data-theme="dark"] .shell-command-palette {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: var(--shadow-xl);
}

.shell-command-palette[hidden] {
    display: none;
}

.shell-command-results {
    max-height: min(480px, calc(100vh - var(--topbar-height) - 48px));
    overflow-y: auto;
    padding: 10px;
}

.shell-command-section + .shell-command-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgb(238 242 247);
}

html[data-theme="dark"] .shell-command-section + .shell-command-section {
    border-top-color: var(--border);
}

.shell-command-section h3 {
    margin: 4px 8px 7px;
    color: rgb(100 116 139);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
}

html[data-theme="dark"] .shell-command-section h3,
html[data-theme="dark"] .shell-command-item span,
html[data-theme="dark"] .shell-command-empty {
    color: var(--text-muted);
}

.shell-command-item {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.shell-command-item:hover,
.shell-command-item:focus-visible,
.shell-command-item.is-active {
    background: rgb(238 242 255);
    outline: none;
}

html[data-theme="dark"] .shell-command-item:hover,
html[data-theme="dark"] .shell-command-item:focus-visible,
html[data-theme="dark"] .shell-command-item.is-active {
    background: rgba(129, 140, 248, 0.16);
}

.shell-command-item strong {
    font-size: 13px;
    line-height: 1.2;
    font-weight: 800;
}

.shell-command-item span,
.shell-command-empty {
    color: rgb(71 85 105);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
}

.shell-command-empty {
    margin: 0;
    padding: 18px 20px;
    text-align: center;
}

.shell-command-empty[hidden] {
    display: none;
}

.topbar-search .topbar-icon {
    width: 16px;
    height: 16px;
    margin-left: 13px;
    flex: 0 0 auto;
}

.topbar-search input {
    min-width: 0;
    flex: 1;
    height: 100%;
    padding: 0 8px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--shell-input-text);
    font-size: 12px;
    font-weight: 500;
}

.topbar-search input::placeholder {
    color: var(--shell-placeholder);
}

.topbar-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 23px;
    min-width: 37px;
    margin-right: 7px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--shell-chip-bg);
    color: var(--shell-chip-text);
    font-size: 11px;
    font-weight: 800;
}

.topbar-right {
    gap: 21px;
    flex-shrink: 0;
    margin-left: 0;
}

.topbar-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--shell-top-icon);
    cursor: pointer;
}

.topbar-icon-button:hover {
    color: var(--shell-hover);
}

.topbar-icon-button--chevron {
    width: 16px;
    color: var(--shell-navy);
    margin-left: -10px;
}

.topbar-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.topbar-notifications {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-notification-button {
    width: 24px;
}

.topbar-notification-badge {
    position: absolute;
    top: 3px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 999px;
    background: rgb(239 68 68);
    color: var(--shell-white);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    box-shadow: 0 0 0 2px var(--shell-white);
}

.topbar-notification-badge[hidden] {
    display: none;
}

html[data-theme="dark"] .topbar-notification-badge {
    box-shadow: 0 0 0 2px rgb(15 23 42);
}

.topbar-notification-popover {
    position: fixed;
    top: calc(var(--topbar-height) + 1px);
    right: 24px;
    width: 402px;
    max-width: calc(100vw - var(--sidebar-width) - 48px);
    max-height: calc(100vh - var(--topbar-height) - 28px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--shell-white);
    border: 1px solid rgb(226 232 240);
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(15, 35, 64, 0.18), 0 2px 8px rgba(15, 35, 64, 0.08);
    color: var(--shell-input-text);
    z-index: 350;
}

html[data-theme="dark"] .topbar-notification-popover,
html[data-theme="dark"] .topbar-appearance-popover {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: var(--shadow-xl);
}

.topbar-notification-popover[hidden] {
    display: none;
}

.topbar-notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid rgb(238 242 247);
}

html[data-theme="dark"] .topbar-notification-header,
html[data-theme="dark"] .topbar-notification-footer,
html[data-theme="dark"] .topbar-appearance-footer {
    border-color: var(--border);
}

.topbar-notification-header h2 {
    margin: 0;
    color: rgb(15 23 42);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}

html[data-theme="dark"] .topbar-notification-header h2,
html[data-theme="dark"] .topbar-notification-copy strong,
html[data-theme="dark"] .topbar-appearance-header h2,
html[data-theme="dark"] .topbar-appearance-option,
html[data-theme="dark"] .topbar-appearance-copy strong,
html[data-theme="dark"] .notification-page-list strong {
    color: var(--text);
}

.topbar-notification-mark-read {
    border: 0;
    background: transparent;
    color: rgb(37 99 235);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.topbar-notification-mark-read:hover,
.topbar-notification-mark-read:focus-visible,
.topbar-notification-footer:hover,
.topbar-notification-footer:focus-visible {
    color: rgb(29 78 216);
    text-decoration: none;
}

.topbar-notification-body {
    overflow-y: auto;
    padding: 19px 24px 0;
}

.topbar-notification-section-label {
    margin: 0 0 14px;
    color: rgb(71 85 105);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
}

html[data-theme="dark"] .topbar-notification-section-label,
html[data-theme="dark"] .topbar-notification-empty,
html[data-theme="dark"] .topbar-notification-copy span,
html[data-theme="dark"] .topbar-notification-copy time,
html[data-theme="dark"] .topbar-appearance-header p,
html[data-theme="dark"] .topbar-appearance-copy span,
html[data-theme="dark"] .topbar-appearance-footer {
    color: var(--text-muted);
}

.topbar-notification-empty {
    margin: 22px 0 34px;
    color: rgb(71 85 105);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.topbar-notification-empty[hidden] {
    display: none;
}

.topbar-notification-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 8px;
    gap: 14px;
    align-items: start;
    min-height: 90px;
}

.topbar-notification-item:not(:last-child) {
    margin-bottom: 18px;
}

.topbar-notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-top: 1px;
}

.topbar-notification-icon .topbar-icon {
    width: 19px;
    height: 19px;
}

.topbar-notification-icon--purple {
    background: rgb(237 233 254);
    color: rgb(79 70 229);
}

.topbar-notification-icon--green {
    background: rgb(220 252 231);
    color: rgb(16 185 129);
}

.topbar-notification-icon--orange {
    background: rgb(254 243 199);
    color: rgb(245 158 11);
}

.topbar-notification-icon--blue {
    background: rgb(219 234 254);
    color: rgb(37 99 235);
}

.topbar-notification-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-notification-copy strong {
    margin: 1px 0 4px;
    color: rgb(15 23 42);
    font-size: 14px;
    line-height: 1.25;
    font-weight: 800;
}

.topbar-notification-copy span,
.topbar-notification-copy time {
    color: rgb(71 85 105);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.topbar-notification-copy time {
    margin-top: 1px;
}

.topbar-notification-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 1px;
}

.topbar-notification-priority {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgb(241 245 249);
    color: rgb(71 85 105);
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
}

.topbar-notification-priority--high,
.topbar-notification-priority--critical {
    background: rgb(254 226 226);
    color: rgb(220 38 38);
}

html[data-theme="dark"] .topbar-notification-priority {
    background: var(--surface-muted);
    color: var(--text-muted);
}

html[data-theme="dark"] .topbar-notification-priority--high,
html[data-theme="dark"] .topbar-notification-priority--critical {
    background: rgba(220, 38, 38, 0.18);
    color: rgb(252 165 165);
}

.topbar-notification-unread-dot {
    width: 7px;
    height: 7px;
    margin-top: 16px;
    border-radius: 999px;
    background: rgb(37 99 235);
}

.topbar-notification-divider {
    height: 1px;
    margin: 4px 0 20px;
    border: 0;
    background: rgb(226 232 240);
}

html[data-theme="dark"] .topbar-notification-divider {
    background: var(--border);
}

.topbar-notification-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 53px;
    border-top: 1px solid rgb(238 242 247);
    color: rgb(37 99 235);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.notifications-page,
.export-data-page {
    display: grid;
    gap: 16px;
    width: 100%;
}

.notifications-page-header,
.export-data-page-header {
    margin: 0;
}

.notifications-page-header .page-title,
.export-data-page-header .page-title {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.notifications-page-header .page-subtitle {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.notifications-panel,
.export-data-panel {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: none;
}

.notifications-panel {
    padding: 20px;
}

.notifications-panel h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.notifications-empty {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.notification-page-list {
    display: grid;
    gap: 0;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.notification-page-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 4px 16px;
    min-height: 56px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.notification-page-list li:last-child {
    border-bottom: 0;
}

.notification-page-list strong {
    min-width: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.notification-page-list span {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.notification-page-list time {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    white-space: nowrap;
}

.export-data-page {
    max-width: 960px;
}

.export-data-panel {
    display: grid;
    gap: 16px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.export-data-panel p,
.export-data-panel form {
    margin: 0;
}

.export-data-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
}

.export-data-list li {
    padding-left: 4px;
}

.export-data-action {
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 720px) {
    .notification-page-list li {
        grid-template-columns: 1fr;
    }

    .notification-page-list time {
        grid-column: 1;
        grid-row: auto;
    }
}

.topbar-appearance {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.topbar-theme-button {
    width: 38px;
    border-radius: 8px;
}

.topbar-theme-button[aria-expanded="true"] {
    background: rgb(239 246 255);
    color: rgb(37 99 235);
}

html[data-theme="dark"] .topbar-theme-button[aria-expanded="true"] {
    background: rgba(129, 140, 248, 0.16);
    color: rgb(165 180 252);
}

.topbar-theme-button[aria-expanded="true"]::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -13px;
    width: 12px;
    height: 12px;
    background: var(--shell-white);
    border-left: 1px solid rgb(226 232 240);
    border-top: 1px solid rgb(226 232 240);
    transform: translateX(-50%) rotate(45deg);
    z-index: 361;
}

html[data-theme="dark"] .topbar-theme-button[aria-expanded="true"]::after {
    background: var(--surface);
    border-color: var(--border);
}

.topbar-theme-chevron {
    margin-left: -6px;
}

.topbar-appearance-popover {
    position: fixed;
    top: calc(var(--topbar-height) + 1px);
    right: 64px;
    width: 268px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--shell-white);
    border: 1px solid rgb(226 232 240);
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(15, 35, 64, 0.18), 0 2px 8px rgba(15, 35, 64, 0.08);
    color: var(--shell-input-text);
    z-index: 360;
}

.topbar-appearance-popover[hidden] {
    display: none;
}

.topbar-appearance-header {
    padding: 24px 26px 19px;
}

.topbar-appearance-header h2 {
    margin: 0 0 11px;
    color: rgb(15 23 42);
    font-size: 17px;
    line-height: 1.2;
    font-weight: 800;
}

.topbar-appearance-header p {
    margin: 0;
    color: rgb(71 85 105);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
}

.topbar-appearance-options {
    display: grid;
    gap: 4px;
    padding: 0 26px 25px;
}

.topbar-appearance-option {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 18px;
    gap: 13px;
    align-items: center;
    min-height: 72px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgb(15 23 42);
    text-align: left;
    cursor: pointer;
}

.topbar-appearance-option:hover .topbar-appearance-icon,
.topbar-appearance-option:focus-visible .topbar-appearance-icon {
    border-color: rgb(191 219 254);
    background: rgb(239 246 255);
}

.topbar-appearance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgb(226 232 240);
    border-radius: 7px;
    background: rgb(248 250 252);
    color: rgb(15 36 64);
}

html[data-theme="dark"] .topbar-appearance-icon {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-secondary);
}

.topbar-appearance-icon--selected {
    background: rgb(239 246 255);
    color: rgb(37 99 235);
}

html[data-theme="dark"] .topbar-appearance-icon--selected,
html[data-theme="dark"] .topbar-appearance-option:hover .topbar-appearance-icon,
html[data-theme="dark"] .topbar-appearance-option:focus-visible .topbar-appearance-icon {
    background: rgba(129, 140, 248, 0.16);
    border-color: rgba(165, 180, 252, 0.42);
    color: rgb(165 180 252);
}

.topbar-appearance-icon .topbar-icon {
    width: 20px;
    height: 20px;
}

.topbar-appearance-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-appearance-copy strong {
    margin-bottom: 6px;
    color: rgb(15 23 42);
    font-size: 14px;
    line-height: 1.1;
    font-weight: 800;
}

.topbar-appearance-copy span {
    color: rgb(71 85 105);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 600;
}

.topbar-appearance-radio {
    width: 16px;
    height: 16px;
    border: 1.5px solid rgb(191 203 219);
    border-radius: 999px;
}

html[data-theme="dark"] .topbar-appearance-radio {
    border-color: rgb(100 116 139);
}

.topbar-appearance-option.is-selected .topbar-appearance-radio {
    border: 5px solid rgb(0 122 255);
    box-shadow: 0 0 0 2px rgb(219 234 254);
}

.topbar-appearance-footer {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 83px;
    padding: 21px 26px;
    border-top: 1px solid rgb(226 232 240);
    background: rgb(248 250 252);
    color: rgb(71 85 105);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
}

html[data-theme="dark"] .topbar-appearance-footer {
    background: var(--bg-secondary);
}

.topbar-appearance-footer a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgb(0 102 255);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.topbar-appearance-footer a:hover,
.topbar-appearance-footer a:focus-visible {
    color: rgb(29 78 216);
    text-decoration: none;
}

.topbar-appearance-footer .topbar-icon {
    width: 12px;
    height: 12px;
}

.topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--shell-divider);
    margin-left: -2px;
}

.topbar-threepoints-lockup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 86px;
    overflow: hidden;
}

.topbar-threepoints-logo {
    height: 30px;
    width: auto;
    display: block;
    object-fit: contain;
}

.sidebar-toggle {
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--shell-white);
    border: 1px solid var(--shell-control-border);
    border-radius: 8px;
    color: var(--shell-top-icon);
}

.app-content {
    padding: 32px 40px 48px;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .app-main {
        margin-left: 0;
    }

    .app-topbar {
        gap: 8px;
        padding: 0 10px;
    }

    .sidebar-toggle {
        display: inline-flex;
        margin-right: auto;
    }

    .topbar-search {
        width: 92px;
        margin-left: 0;
    }

    .topbar-search input {
        display: none;
    }

    .topbar-search .topbar-icon {
        margin-left: 11px;
    }

    .topbar-shortcut {
        margin-left: auto;
    }

    .topbar-right {
        gap: 8px;
    }

    .topbar-icon-button {
        width: 20px;
    }

    .topbar-notification-popover {
        top: calc(var(--topbar-height) + 1px);
        right: 10px;
        width: calc(100vw - 20px);
        max-width: none;
    }

    .topbar-appearance-popover {
        top: calc(var(--topbar-height) + 1px);
        right: 10px;
        width: calc(100vw - 20px);
    }

    .topbar-icon-button--chevron {
        margin-left: -4px;
    }

    .topbar-divider {
        margin-left: 0;
    }

    .topbar-threepoints-lockup {
        width: 76px;
    }

    .app-content {
        padding: 24px 18px 36px;
    }
}

/* === Risks Page Redesign ================================================== */

.app-content:has(> .risks-page) {
    max-width: none;
}

.risks-page {
    color: rgb(15, 23, 42);
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 0 auto;
    max-width: 1540px;
    width: 100%;
}

.risks-page svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.risks-page__header,
.risks-page__actions,
.risks-settings-button,
.risks-add-button,
.risks-list-card__header,
.risks-risk-row,
.risks-score-box,
.risks-severity,
.risks-pro-tip {
    align-items: center;
    display: flex;
}

.risks-page__header {
    justify-content: space-between;
    gap: 24px;
    min-height: 60px;
}

.risks-page__title {
    align-items: center;
    color: rgb(15, 23, 42);
    display: flex;
    font-size: 28px;
    font-weight: 700;
    gap: 10px;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
}

.risks-page__info .page-info-btn {
    align-items: center;
    background: rgb(241, 245, 249);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 999px;
    color: rgb(100, 116, 139);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.risks-page__subtitle {
    color: rgb(71, 85, 105);
    font-size: 15px;
    line-height: 1.5;
    margin: 8px 0 0;
}

.risks-page__actions {
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.risks-page__actions .btn-sm {
    font-size: 14px;
    height: 40px;
    padding: 0 18px;
}

.risks-page__actions .inline-form {
    margin: 0;
}

.risks-settings-button,
.risks-add-button {
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    height: 40px;
    justify-content: center;
    padding: 0 18px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.risks-settings-button {
    background: rgb(79, 70, 229);
    border: 0;
    color: rgb(255, 255, 255);
}

.risks-settings-button:hover {
    background: rgb(91, 82, 240);
}

.risks-settings-button svg {
    height: 17px;
    width: 17px;
}

.risks-add-button {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(214, 226, 242);
    color: rgb(37, 99, 235);
}

.risks-add-button:hover {
    background: rgb(239, 246, 255);
    border-color: rgb(147, 197, 253);
}

.risks-heatmap-card,
.risks-list-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(218, 226, 237);
    border-radius: 8px;
}

.risks-heatmap-card {
    min-height: 330px;
    padding: 24px 28px 28px;
}

.risks-heatmap-card h2,
.risks-list-card h2 {
    color: rgb(15, 23, 42);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.risks-heatmap-layout {
    align-items: center;
    display: grid;
    gap: 64px;
    grid-template-columns: minmax(420px, 560px) minmax(170px, 220px) minmax(90px, 1fr);
    min-height: 256px;
    padding-top: 18px;
}

.risks-heatmap-stage {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: center;
}

.risks-page .heatmap-y-label,
.risks-page .heatmap-x-label,
.risks-page .heatmap-row-label,
.risks-page .heatmap-col-label {
    color: rgb(30, 58, 105);
}

.risks-page .heatmap-y-label,
.risks-page .heatmap-x-label {
    font-size: 13px;
    font-weight: 700;
}

.risks-page .heatmap-row-label,
.risks-page .heatmap-col-label {
    font-size: 12px;
    font-weight: 600;
}

.risks-page .risks-heatmap-grid {
    gap: 4px;
    grid-template-columns: 32px repeat(5, 74px);
    grid-template-rows: repeat(5, 48px) 24px;
}

.risks-page .risks-heatmap-cell {
    border: 0;
    border-radius: 4px;
    color: rgb(255, 255, 255);
    cursor: default;
    font-size: 15px;
    font-weight: 700;
    min-height: 0;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
}

.risks-page .risks-heatmap-cell.has-risks {
    cursor: pointer;
}

.risks-page .risks-heatmap-cell.has-risks:hover {
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
    transform: translateY(-1px);
}

.risks-page .risks-heatmap-cell--low {
    background: rgb(187, 247, 208);
    color: rgb(6, 95, 70);
}

.risks-page .risks-heatmap-cell--medium {
    background: rgb(254, 240, 138);
    color: rgb(146, 64, 14);
}

.risks-page .risks-heatmap-cell--high {
    background: rgb(254, 215, 170);
    color: rgb(154, 52, 18);
}

.risks-page .risks-heatmap-cell--critical {
    background: rgb(252, 165, 165);
    color: rgb(255, 255, 255);
}

.risks-page .heatmap-cell--selected {
    outline: 3px solid rgb(79, 70, 229);
    outline-offset: -3px;
}

.risks-heatmap-legend {
    display: grid;
    gap: 24px;
}

.risks-legend-row {
    align-items: center;
    color: rgb(71, 85, 105);
    display: flex;
    font-size: 14px;
    gap: 12px;
}

.risks-legend-dot {
    border-radius: 999px;
    height: 8px;
    width: 8px;
}

.risks-legend-dot--low { background: rgb(16, 185, 129); }
.risks-legend-dot--medium { background: rgb(245, 197, 66); }
.risks-legend-dot--high { background: rgb(249, 115, 22); }
.risks-legend-dot--critical { background: rgb(239, 68, 68); }

.risks-band-totals {
    border-left: 1px solid rgb(218, 226, 237);
    display: grid;
    gap: 24px;
    min-height: 170px;
    padding-left: 54px;
}

.risks-band-total {
    color: rgb(15, 23, 42);
    font-size: 17px;
    font-weight: 800;
}

.risks-list-card {
    padding: 18px 18px 20px;
}

.risks-list-card__header {
    gap: 16px;
    justify-content: space-between;
    margin: 0 0 16px;
}

.risks-list {
    gap: 12px;
}

.risks-page .risks-risk-row {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(218, 226, 237);
    border-radius: 8px;
    display: grid;
    gap: 18px;
    grid-template-columns: 42px minmax(280px, 1fr) 62px 62px 62px 108px 36px;
    min-height: 88px;
    padding: 16px;
}

.risks-page .risks-risk-row:hover {
    background: rgb(249, 250, 252);
}

.risks-risk-rank {
    align-items: center;
    border-radius: 8px;
    display: flex;
    font-size: 16px;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.risks-risk-rank--low,
.risks-score-box--low {
    background: rgb(220, 252, 231);
    color: rgb(5, 150, 105);
}

.risks-risk-rank--medium,
.risks-score-box--medium {
    background: rgb(255, 247, 237);
    color: rgb(217, 119, 6);
}

.risks-risk-rank--high,
.risks-score-box--high {
    background: rgb(255, 237, 213);
    color: rgb(234, 88, 12);
}

.risks-risk-rank--critical,
.risks-score-box--critical {
    background: rgb(254, 226, 226);
    color: rgb(239, 68, 68);
}

.risks-risk-main {
    min-width: 0;
}

.risks-risk-main h3 {
    color: rgb(15, 23, 42);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 4px;
}

.risks-risk-main p {
    color: rgb(71, 85, 105);
    font-size: 13px;
    line-height: 1.35;
    margin: 0 0 6px;
}

.risks-risk-meta {
    align-items: center;
    color: rgb(100, 116, 139);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 10px;
}

.risks-linked-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.risks-linked-items span {
    background: rgb(241, 245, 249);
    border-radius: 999px;
    color: rgb(71, 85, 105);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
}

.risks-score-box {
    border-radius: 8px;
    flex-direction: column;
    gap: 2px;
    height: 38px;
    justify-content: center;
    width: 54px;
}

.risks-score-box strong {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.risks-score-box span {
    color: rgb(71, 85, 105);
    font-size: 10px;
    line-height: 1.1;
}

.risks-severity {
    border: 1px solid;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    gap: 8px;
    height: 36px;
    justify-content: center;
    padding: 0 12px;
}

.risks-severity span {
    border-radius: 999px;
    height: 7px;
    width: 7px;
}

.risks-severity--low {
    background: rgb(240, 253, 244);
    border-color: rgb(187, 247, 208);
    color: rgb(5, 150, 105);
}

.risks-severity--low span { background: rgb(16, 185, 129); }

.risks-severity--medium {
    background: rgb(255, 251, 235);
    border-color: rgb(253, 230, 138);
    color: rgb(217, 119, 6);
}

.risks-severity--medium span { background: rgb(245, 197, 66); }

.risks-severity--high {
    background: rgb(255, 247, 237);
    border-color: rgb(254, 215, 170);
    color: rgb(234, 88, 12);
}

.risks-severity--high span { background: rgb(249, 115, 22); }

.risks-severity--critical {
    background: rgb(254, 242, 242);
    border-color: rgb(254, 202, 202);
    color: rgb(239, 68, 68);
}

.risks-severity--critical span { background: rgb(239, 68, 68); }

.risks-page .row-actions-menu {
    justify-self: end;
}

.risks-empty-state {
    align-items: center;
    background: rgb(249, 250, 252);
    border: 1px dashed rgb(203, 213, 225);
    border-radius: 8px;
    color: rgb(71, 85, 105);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 34px;
    text-align: center;
}

.risks-empty-state h3 {
    color: rgb(15, 23, 42);
    margin: 0;
}

.risks-empty-state p {
    margin: 0;
}

.risks-workflow-footer .workflow-nav {
    margin-top: 0;
}

.risks-pro-tip {
    background: var(--home-pro-tip-bg, rgb(238, 251, 247));
    border: 1px solid var(--home-pro-tip-border, rgb(207, 238, 227));
    border-radius: 8px;
    color: rgb(71, 85, 105);
    gap: 14px;
    min-height: 52px;
    padding: 0 16px;
}

.risks-pro-tip > svg {
    color: rgb(5, 150, 105);
    height: 19px;
    width: 19px;
}

.risks-pro-tip strong {
    color: rgb(5, 150, 105);
    font-size: 14px;
    font-weight: 700;
}

.risks-pro-tip span {
    flex: 1;
    font-size: 13px;
}

.risks-pro-tip kbd {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(218, 226, 237);
    border-radius: 5px;
    color: rgb(51, 65, 85);
    font-size: 12px;
    padding: 2px 8px;
}

.risks-pro-tip button {
    background: transparent;
    border: 0;
    color: rgb(71, 85, 105);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    margin-left: auto;
}

html[data-theme="dark"] .risks-page,
html[data-theme="dark"] .risks-page__title,
html[data-theme="dark"] .risks-heatmap-card h2,
html[data-theme="dark"] .risks-list-card h2,
html[data-theme="dark"] .risks-risk-main h3,
html[data-theme="dark"] .risks-band-total,
html[data-theme="dark"] .risks-empty-state h3 {
    color: rgb(226, 232, 240);
}

html[data-theme="dark"] .risks-page__subtitle,
html[data-theme="dark"] .risks-risk-main p,
html[data-theme="dark"] .risks-risk-meta,
html[data-theme="dark"] .risks-legend-row,
html[data-theme="dark"] .risks-pro-tip,
html[data-theme="dark"] .risks-score-box span {
    color: var(--text-muted);
}

html[data-theme="dark"] .risks-heatmap-card,
html[data-theme="dark"] .risks-list-card,
html[data-theme="dark"] .risks-page .risks-risk-row {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] .risks-page .risks-risk-row:hover,
html[data-theme="dark"] .risks-empty-state {
    background: rgb(30, 41, 59);
}

html[data-theme="dark"] .risks-band-totals {
    border-left-color: rgb(51, 65, 85);
}

@media (max-width: 1180px) {
    .risks-heatmap-layout {
        gap: 28px;
        grid-template-columns: 1fr;
    }

    .risks-band-totals {
        border-left: 0;
        border-top: 1px solid rgb(218, 226, 237);
        display: flex;
        min-height: 0;
        padding: 18px 0 0;
    }

    .risks-page .risks-risk-row {
        grid-template-columns: 42px minmax(240px, 1fr) repeat(3, 62px) 108px 36px;
    }
}

@media (max-width: 900px) {
    .risks-page__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .risks-page__actions {
        justify-content: flex-start;
    }

    .risks-page .risks-risk-row {
        align-items: flex-start;
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .risks-score-box,
    .risks-severity,
    .risks-page .row-actions-menu {
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .risks-heatmap-card,
    .risks-list-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .risks-page .risks-heatmap-grid {
        grid-template-columns: 26px repeat(5, 46px);
        grid-template-rows: repeat(5, 42px) 22px;
    }

    .risks-pro-tip {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: 14px;
        padding-top: 14px;
    }
}

/* === User Stories Redesign ================================================= */

.app-content:has(> .user-stories-page) {
    max-width: none;
}

.user-stories-page {
    color: rgb(15, 23, 42);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1540px;
    width: 100%;
}

.user-stories-page svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.user-stories-page__header,
.user-stories-page__actions,
.user-stories-page__title,
.user-story-split-grid,
.user-story-group__header,
.user-story-group__identity,
.user-story-group__stats,
.user-stories-action,
.user-story-ai-button,
.user-story-generate-more,
.user-story-group__view-all,
.user-stories-pro-tip {
    align-items: center;
    display: flex;
}

.user-stories-page__header {
    gap: 24px;
    justify-content: space-between;
    min-height: 60px;
}

.user-stories-page__header > div:first-child {
    min-width: 0;
}

.user-stories-page__title {
    color: rgb(15, 23, 42);
    font-size: 28px;
    font-weight: 700;
    gap: 10px;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
}

.user-stories-count {
    background: rgb(239, 238, 255);
    border-radius: 999px;
    color: rgb(79, 70, 229);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 9px;
}

.user-stories-info {
    align-items: center;
    background: rgb(241, 245, 249);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 999px;
    color: rgb(100, 116, 139);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.user-stories-page__subtitle {
    color: rgb(71, 85, 105);
    font-size: 15px;
    line-height: 1.5;
    margin: 8px 0 0;
}

.user-stories-page__actions {
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.user-stories-page__actions .btn-sm,
.user-stories-page__actions .user-stories-action {
    font-size: 14px;
    height: 40px;
    padding: 0 18px;
}

.user-stories-page__actions .inline-form {
    margin: 0;
}

.user-stories-action,
.user-story-ai-button,
.user-story-generate-more {
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.user-stories-action--secondary {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(214, 226, 242);
    color: rgb(51, 65, 85);
}

.user-stories-action--primary,
.user-story-ai-button,
.user-story-generate-more {
    background: rgb(79, 70, 229);
    border: 1px solid rgb(79, 70, 229);
    color: rgb(255, 255, 255);
}

.user-story-generate-more {
    background: rgb(255, 255, 255);
    border-color: rgb(214, 226, 242);
    color: rgb(71, 85, 105);
    font-size: 13px;
    height: 34px;
    padding: 0 14px;
}

.user-stories-action--danger {
    background: rgb(220, 38, 38);
    border: 1px solid rgb(220, 38, 38);
    color: rgb(255, 255, 255);
}

.user-stories-action:hover,
.user-story-ai-button:hover,
.user-story-generate-more:hover {
    text-decoration: none;
}

.user-stories-action--secondary:hover,
.user-story-generate-more:hover {
    background: rgb(248, 250, 252);
    border-color: rgb(180, 194, 214);
    color: rgb(15, 23, 42);
}

.user-stories-action--primary:hover,
.user-story-ai-button:hover {
    background: rgb(91, 82, 240);
    border-color: rgb(91, 82, 240);
    color: rgb(255, 255, 255);
}

.user-stories-action--danger:hover {
    background: rgb(185, 28, 28);
    border-color: rgb(185, 28, 28);
    color: rgb(255, 255, 255);
}

.user-stories-action svg,
.user-story-ai-button svg,
.user-story-generate-more svg,
.user-story-group__view-all svg {
    height: 16px;
    width: 16px;
}

.user-story-split-card,
.user-story-group,
.user-story-empty-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(218, 226, 237);
    border-radius: 8px;
}

.user-story-split-card {
    padding: 22px 26px 18px;
}

.user-story-split-card h2,
.user-story-group h2,
.user-story-empty-card h2 {
    color: rgb(15, 23, 42);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.user-story-split-card p {
    color: rgb(71, 85, 105);
    font-size: 14px;
    margin: 8px 0 18px;
}

.user-story-split-grid {
    border-bottom: 1px solid rgb(226, 232, 240);
    border-top: 1px solid rgb(226, 232, 240);
    display: grid;
    gap: 14px 32px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    padding: 16px 0;
}

.user-story-check {
    align-items: center;
    color: rgb(15, 23, 42);
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    min-width: 0;
}

.user-story-check input {
    height: 14px;
    margin: 0;
    width: 14px;
}

.user-story-check span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-story-ai-button {
    font-size: 14px;
    height: 38px;
    margin-top: 14px;
    padding: 0 18px;
}

.user-story-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.user-story-group {
    overflow: visible;
}

.user-story-group__header {
    background: rgb(248, 250, 252);
    border-bottom: 1px solid rgb(226, 232, 240);
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 64px;
    padding: 13px 18px;
}

.user-story-group__identity {
    gap: 14px;
    min-width: 0;
}

.user-story-group__number,
.user-story-priority {
    align-items: center;
    background: rgb(239, 238, 255);
    border-radius: 999px;
    color: rgb(79, 70, 229);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    height: 26px;
    justify-content: center;
    min-width: 26px;
}

.user-story-group__identity h2 {
    font-size: 15px;
    margin-bottom: 4px;
}

.user-story-group__identity p {
    color: rgb(100, 116, 139);
    font-size: 12px;
    margin: 0;
}

.user-story-group__stats {
    color: rgb(51, 65, 85);
    font-size: 13px;
    font-weight: 700;
    gap: 16px;
}

.user-story-group__stats > span[aria-hidden="true"] {
    background: rgb(203, 213, 225);
    height: 20px;
    width: 1px;
}

.user-story-group__chevron {
    color: rgb(15, 23, 42);
    display: inline-flex;
}

.user-story-list {
    background: rgb(255, 255, 255);
}

.user-story-row-details {
    margin: 0;
}

.user-story-row {
    align-items: center;
    border-bottom: 1px solid rgb(226, 232, 240);
    display: grid;
    gap: 14px;
    grid-template-columns: 20px 28px minmax(0, 1fr) 72px 52px 126px 128px 42px;
    min-height: 72px;
    padding: 10px 16px;
}

.user-story-row:hover {
    background: rgb(248, 250, 252);
}

.user-story-row-details:last-child > summary.user-story-row {
    border-bottom: none;
}

.user-story-info {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 7px;
}

.user-story-info strong {
    color: rgb(15, 23, 42);
    flex-basis: 100%;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
}

.user-story-tag {
    border: 0;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    padding: 3px 8px;
}

.user-story-size {
    background: rgb(239, 238, 255);
    border-radius: 999px;
    color: rgb(79, 70, 229);
    font-size: 12px;
    height: 22px;
    justify-self: center;
    min-width: 48px;
}

.user-story-row .quality-pill {
    height: 22px;
    justify-self: center;
    min-width: 36px;
}

.user-story-quality-placeholder {
    background: rgb(241, 245, 249);
    color: rgb(100, 116, 139);
}

.user-story-team,
.user-story-updated {
    color: rgb(100, 116, 139);
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-story-updated {
    text-align: left;
}

.user-story-row .row-actions-menu {
    justify-self: end;
}

.user-story-empty-row {
    color: rgb(100, 116, 139);
    font-size: 14px;
    padding: 22px;
    text-align: center;
}

.user-story-group__view-all {
    background: transparent;
    border-bottom: 0;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgb(226, 232, 240);
    color: rgb(79, 70, 229);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    height: 36px;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

.user-story-group__view-all:hover {
    background: rgb(248, 250, 252);
    text-decoration: none;
}

.user-story-group__view-all[hidden] {
    display: none;
}

.user-story-pagination {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.user-story-empty-card {
    padding: 42px;
    text-align: center;
}

.user-story-empty-card p {
    color: rgb(71, 85, 105);
    margin: 8px auto 0;
    max-width: 560px;
}

.user-stories-workflow-footer .workflow-nav {
    margin: 0;
}

.user-stories-pro-tip {
    background: var(--home-pro-tip-bg, rgb(238, 251, 247));
    border: 1px solid var(--home-pro-tip-border, rgb(207, 238, 227));
    border-radius: 8px;
    color: rgb(51, 65, 85);
    gap: 14px;
    min-height: 56px;
    padding: 0 18px;
}

.user-stories-pro-tip > svg {
    color: rgb(5, 150, 105);
    height: 22px;
    width: 22px;
}

.user-stories-pro-tip strong {
    color: rgb(5, 150, 105);
    font-size: 14px;
}

.user-stories-pro-tip span {
    font-size: 14px;
}

.user-stories-pro-tip kbd {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 5px;
    color: rgb(51, 65, 85);
    font-size: 12px;
    padding: 2px 7px;
}

.user-stories-pro-tip button {
    background: transparent;
    border: 0;
    color: rgb(51, 65, 85);
    cursor: pointer;
    display: inline-flex;
    margin-left: auto;
    padding: 4px;
}

.user-stories-pro-tip button svg {
    height: 18px;
    width: 18px;
}

html[data-theme="dark"] .user-stories-page {
    color: rgb(226, 232, 240);
}

html[data-theme="dark"] .user-stories-page__title,
html[data-theme="dark"] .user-story-split-card h2,
html[data-theme="dark"] .user-story-group h2,
html[data-theme="dark"] .user-story-info strong,
html[data-theme="dark"] .user-story-group__chevron {
    color: var(--text);
}

html[data-theme="dark"] .user-stories-page__subtitle,
html[data-theme="dark"] .user-story-split-card p,
html[data-theme="dark"] .user-story-group__identity p,
html[data-theme="dark"] .user-story-team,
html[data-theme="dark"] .user-story-updated,
html[data-theme="dark"] .user-story-empty-row {
    color: var(--text-muted);
}

html[data-theme="dark"] .user-story-split-card,
html[data-theme="dark"] .user-story-group,
html[data-theme="dark"] .user-story-empty-card,
html[data-theme="dark"] .user-story-list {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] .user-story-group__header,
html[data-theme="dark"] .user-story-row:hover {
    background: rgb(30, 41, 59);
}

html[data-theme="dark"] .user-story-row,
html[data-theme="dark"] .user-story-split-grid,
html[data-theme="dark"] .user-story-group__view-all {
    border-color: var(--border);
}

html[data-theme="dark"] .user-stories-action--secondary,
html[data-theme="dark"] .user-story-generate-more {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .user-stories-pro-tip {
    background: rgba(5, 150, 105, 0.14);
    border-color: rgba(5, 150, 105, 0.28);
    color: rgb(226, 232, 240);
}

@media (max-width: 1180px) {
    .user-story-group__header {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-story-group__stats {
        justify-content: flex-start;
    }

    .user-story-row {
        grid-template-columns: 20px 28px minmax(0, 1fr) 64px 46px 90px 42px;
    }

    .user-story-updated {
        display: none;
    }
}

@media (max-width: 760px) {
    .user-stories-page__header,
    .user-stories-page__actions,
    .user-stories-pro-tip {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-story-row {
        grid-template-columns: 20px 28px minmax(0, 1fr) 42px;
    }

    .user-story-size,
    .user-story-row .quality-pill,
    .user-story-team {
        grid-column: 3 / 4;
        justify-self: start;
    }

    .user-story-row .row-actions-menu {
        grid-column: 4 / 5;
        grid-row: 1 / 2;
    }

    .user-stories-pro-tip button {
        margin-left: 0;
    }
}

/* Sprints redesign */
.app-content:has(> .sprints-page) {
    max-width: none;
}

.sprints-page {
    color: rgb(15, 23, 42);
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 0 auto;
    max-width: 1540px;
    width: 100%;
}

.sprints-page svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.sprints-page__header,
.sprints-page__actions,
.sprints-page__title,
.sprints-action,
.sprints-card-header,
.sprints-select-wrap,
.sprints-input-icon,
.sprints-create-submit,
.sprints-icon-button,
.sprints-sprint-header,
.sprints-sprint-main,
.sprints-expanded-meta,
.sprints-expanded-tags,
.sprints-team-chip,
.sprints-story-row,
.sprints-workflow-footer,
.sprints-footer-button,
.sprints-pro-tip {
    align-items: center;
    display: flex;
}

.sprints-page__header {
    justify-content: space-between;
}

.sprints-page__title {
    gap: 10px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0;
}

.sprints-info,
.sprints-count {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
}

.sprints-info .page-info-btn {
    background: rgb(245, 247, 251);
    border: 1px solid rgb(213, 221, 234);
    color: rgb(79, 70, 229);
    height: 22px;
    width: 22px;
}

.sprints-count {
    background: rgb(238, 236, 255);
    color: rgb(79, 70, 229);
    min-width: 28px;
    padding: 4px 8px;
}

.sprints-page__subtitle {
    color: rgb(71, 85, 105);
    font-size: 15px;
    line-height: 1.5;
    margin: 10px 0 0;
}

.sprints-page__actions {
    gap: 16px;
}

.sprints-page__actions .inline-form {
    margin: 0;
}

.sprints-page__actions .btn-sm,
.sprints-action {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 8px;
    color: rgb(51, 65, 85);
    font-size: 14px;
    font-weight: 800;
    gap: 8px;
    height: 42px;
    justify-content: center;
    padding: 0 18px;
    text-decoration: none;
}

.sprints-page__actions .btn-sm:hover,
.sprints-action:hover {
    border-color: rgb(148, 163, 184);
    text-decoration: none;
}

.sprints-action svg,
.sprints-page__actions .btn-sm svg {
    height: 18px;
    width: 18px;
}

.sprints-action--primary {
    background: rgb(79, 70, 229);
    border-color: transparent;
    color: rgb(255, 255, 255);
    min-width: 154px;
}

.sprints-create-card,
.sprints-backlog-card,
.sprints-list-card,
.sprints-empty-admin-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(214, 218, 225);
    border-radius: 8px;
}

.sprints-create-card {
    padding: 24px 24px 28px;
}

.sprints-create-card h2,
.sprints-card-header h2 {
    color: rgb(15, 23, 42);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.sprints-create-form {
    align-items: end;
    display: grid;
    gap: 28px;
    grid-template-columns: 1.35fr 1.2fr 1fr 1fr 1fr auto;
    margin-top: 28px;
}

.sprints-field {
    color: rgb(30, 41, 59);
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 800;
    gap: 9px;
    min-width: 0;
}

.sprints-field strong {
    color: rgb(239, 68, 68);
}

.sprints-field input,
.sprints-field select,
.sprints-select-wrap,
.sprints-input-icon {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 6px;
    color: rgb(51, 65, 85);
    font-size: 14px;
    height: 40px;
    min-width: 0;
    width: 100%;
}

.sprints-field input,
.sprints-field select {
    outline: 0;
}

.sprints-select-wrap,
.sprints-input-icon {
    box-shadow: inset 0 -1px 0 rgb(203, 213, 225);
    gap: 10px;
    padding: 0 14px;
}

.sprints-select-wrap:focus-within,
.sprints-input-icon:focus-within {
    border-color: rgb(79, 70, 229);
    box-shadow: inset 0 -1px 0 rgb(79, 70, 229), 0 0 0 3px rgb(238, 242, 255);
}

.sprints-select-wrap svg,
.sprints-input-icon svg {
    color: rgb(71, 85, 105);
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.sprints-select-wrap select,
.sprints-input-icon input {
    border: 0;
    height: 38px;
    padding: 0;
}

.sprints-field > input {
    padding: 0 14px;
}

.sprints-create-submit {
    background: rgb(79, 70, 229);
    border: 0;
    border-radius: 6px;
    color: rgb(255, 255, 255);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    min-width: 132px;
    padding: 0 20px;
}

.sprints-board-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: 350px minmax(0, 1fr);
}

.sprints-backlog-card,
.sprints-list-card {
    min-height: 570px;
    overflow: hidden;
}

.sprints-card-header {
    border-bottom: 1px solid rgb(226, 232, 240);
    justify-content: space-between;
    min-height: 62px;
    padding: 0 20px;
}

.sprints-card-header h2 span {
    background: rgb(238, 242, 255);
    border-radius: 999px;
    color: rgb(15, 23, 42);
    font-size: 12px;
    font-weight: 800;
    margin-left: 8px;
    padding: 4px 9px;
}

.sprints-icon-button {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 6px;
    color: rgb(51, 65, 85);
    cursor: pointer;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.sprints-icon-button svg {
    height: 18px;
    width: 18px;
}

.sprints-backlog-filter-panel {
    background: rgb(249, 250, 252);
    border-bottom: 1px solid rgb(226, 232, 240);
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 112px;
    padding: 14px 20px;
}

.sprints-backlog-filter-panel[hidden] {
    display: none;
}

.sprints-backlog-filter-field {
    color: rgb(71, 85, 105);
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
    min-width: 0;
}

.sprints-backlog-filter-field--wide,
.sprints-backlog-filter-clear {
    grid-column: 1 / -1;
}

.sprints-backlog-filter-field input,
.sprints-backlog-filter-field select {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 6px;
    color: rgb(15, 23, 42);
    font-size: 13px;
    height: 36px;
    padding: 0 10px;
    width: 100%;
}

.sprints-backlog-filter-clear {
    background: transparent;
    border: 0;
    color: rgb(79, 70, 229);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    justify-self: start;
    padding: 0;
}

.sprints-backlog-list {
    min-height: 508px;
    padding: 20px;
}

.sprints-backlog-empty {
    align-items: center;
    border: 1px dashed rgb(203, 213, 225);
    border-radius: 8px;
    color: rgb(100, 116, 139);
    display: flex;
    flex-direction: column;
    height: 312px;
    justify-content: center;
    text-align: center;
}

.sprints-backlog-empty svg {
    color: rgb(148, 163, 184);
    height: 48px;
    margin-bottom: 18px;
    width: 48px;
}

.sprints-backlog-empty strong {
    color: rgb(15, 23, 42);
    font-size: 15px;
}

.sprints-backlog-empty p {
    line-height: 1.45;
    margin: 8px 0 0;
    max-width: 220px;
}

.sprints-backlog-empty--filtered {
    height: 240px;
}

.sprints-backlog-empty--filtered[hidden] {
    display: none;
}

.sprint-story-item--backlog {
    background: rgb(249, 250, 252);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    margin-bottom: 10px;
    padding: 12px;
}

.sprint-story-item--backlog[hidden] {
    display: none;
}

.sprints-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px 10px;
}

.sprints-sprint-card {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    overflow: hidden;
}

.sprints-sprint-card--expanded {
    background: rgb(249, 251, 255);
}

.sprints-sprint-card [hidden] {
    display: none !important;
}

.sprints-sprint-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
    min-height: 54px;
    padding: 10px 18px;
}

.sprints-sprint-header:hover {
    background: rgb(248, 250, 252);
}

.sprints-sprint-main {
    flex: 1 1 100%;
    gap: 12px;
    min-width: 0;
}

.sprints-sprint-main h3 {
    color: rgb(15, 23, 42);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sprints-status-pill {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    padding: 5px 11px;
}

.sprints-status-pill--active,
.sprints-status-pill--completed {
    background: rgb(209, 250, 229);
    color: rgb(4, 120, 87);
}

.sprints-status-pill--planning,
.sprints-status-pill--risk {
    background: rgb(255, 237, 213);
    color: rgb(194, 65, 12);
}

.sprints-status-pill--critical {
    background: rgb(254, 226, 226);
    color: rgb(220, 38, 38);
}

.sprints-story-status-chip {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    min-height: 24px;
    padding: 4px 10px;
    white-space: nowrap;
}

.sprints-story-status-chip--backlog {
    background: rgb(241, 245, 249);
    color: rgb(71, 85, 105);
}

.sprints-story-status-chip--in-progress {
    background: rgb(224, 231, 255);
    color: rgb(67, 56, 202);
}

.sprints-story-status-chip--done {
    background: rgb(209, 250, 229);
    color: rgb(4, 120, 87);
}

.sprints-sprint-collapsed-meta {
    align-items: center;
    display: grid;
    flex: 1 1 100%;
    gap: 8px;
    grid-template-columns: minmax(104px, 150px) minmax(86px, 1fr) minmax(132px, max-content) 28px;
    max-width: none;
    min-width: 0;
}

.sprints-sprint-collapsed-meta > * {
    min-width: 0;
}

.sprints-team-chip {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 6px;
    color: rgb(71, 85, 105);
    font-size: 12px;
    font-weight: 700;
    gap: 7px;
    height: 24px;
    min-width: 0;
    overflow: hidden;
    padding: 0 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sprints-team-chip svg {
    flex: 0 0 auto;
    height: 13px;
    width: 13px;
}

.sprints-capacity-bar {
    background: rgb(226, 232, 240);
    border-radius: 999px;
    height: 12px;
    margin-bottom: 0;
    overflow: hidden;
    position: relative;
}

.sprints-capacity-bar .capacity-fill {
    background: rgb(5, 150, 105);
    border-radius: 999px;
    height: 100%;
}

.sprints-capacity-bar .capacity-fill.over-capacity {
    background: rgb(220, 38, 38);
}

.sprints-capacity-bar .capacity-label {
    color: rgb(15, 23, 42);
    font-size: 11px;
    font-weight: 800;
    inset: 0;
    left: 0;
    line-height: 12px;
    position: absolute;
    text-align: center;
    top: 0;
    transform: none;
}

.sprints-date-range {
    color: rgb(71, 85, 105);
    font-size: 13px;
    font-weight: 600;
    justify-self: end;
    white-space: nowrap;
}

.sprints-sprint-chevron,
.sprints-row-menu {
    background: transparent;
    border: 0;
    color: rgb(15, 23, 42);
    cursor: pointer;
    height: 28px;
    padding: 0;
    width: 28px;
}

.sprints-sprint-chevron svg {
    height: 18px;
    width: 18px;
}

.sprints-sprint-chevron[hidden],
[data-sprints-expanded-only][hidden],
[data-sprints-collapsed-only][hidden],
.sprints-story-list[hidden] {
    display: none;
}

.sprints-expanded-meta {
    border-top: 1px solid rgb(226, 232, 240);
    gap: 18px;
    padding: 8px 18px 16px;
}

.sprints-expanded-meta .sprints-capacity-bar {
    flex: 1;
    min-width: 260px;
}

.sprints-expanded-tags {
    gap: 10px;
}

.sprints-card-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.sprints-row-action,
.sprints-auto-fill {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 6px;
    color: rgb(79, 70, 229);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    height: 30px;
    padding: 0 12px;
    text-decoration: none;
}

.sprints-row-action--danger {
    color: rgb(220, 38, 38);
}

.sprints-story-list {
    background: rgb(255, 255, 255);
    border-top: 1px solid rgb(226, 232, 240);
}

.sprints-story-list--collapsed {
    border-top: 0;
    min-height: 4px;
}

.sprints-story-row {
    border-bottom: 1px solid rgb(226, 232, 240);
    color: rgb(15, 23, 42);
    display: grid;
    font-size: 13px;
    font-weight: 700;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 56px 144px 32px;
    min-height: 43px;
    padding: 0 18px;
}

.sprints-story-row:last-child {
    border-bottom: 0;
}

.story-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sprints-points-pill {
    background: rgb(238, 242, 255);
    border: 0;
    border-radius: 999px;
    color: rgb(79, 70, 229);
    font-size: 12px;
    font-weight: 800;
    justify-self: start;
    padding: 4px 9px;
}

.story-parent-tag,
.sprints-jira-link {
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
}

.story-parent-tag {
    background: rgb(238, 242, 255);
    color: rgb(79, 70, 229);
}

.sprints-jira-link {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    color: rgb(79, 70, 229);
    text-align: center;
    text-decoration: none;
}

.sprints-empty-list {
    color: rgb(100, 116, 139);
    padding: 24px;
}

.sprints-empty-admin-card {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 24px;
}

.sprints-empty-admin-card h2 {
    font-size: 20px;
    margin: 0 0 8px;
}

.sprints-empty-admin-card p {
    color: rgb(71, 85, 105);
    margin: 0;
}

.sprints-workflow-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
}

.sprints-workflow-footer > span {
    color: rgb(71, 85, 105);
    font-size: 13px;
    font-weight: 700;
}

.sprints-footer-button {
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
    gap: 8px;
    height: 40px;
    justify-content: center;
    text-decoration: none;
}

.sprints-footer-button svg {
    height: 16px;
    width: 16px;
}

.sprints-footer-button--secondary {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    color: rgb(51, 65, 85);
    justify-self: start;
    padding: 0 18px;
}

.sprints-footer-button--primary {
    background: rgb(79, 70, 229);
    color: rgb(255, 255, 255);
    justify-self: end;
    padding: 0 24px;
}

.sprints-pro-tip {
    background: rgb(238, 251, 247);
    border: 1px solid rgb(207, 238, 227);
    border-radius: 8px;
    color: rgb(51, 65, 85);
    gap: 14px;
    min-height: 56px;
    padding: 0 18px;
}

.sprints-pro-tip > span:first-child {
    align-items: center;
    border: 1px solid rgb(16, 185, 129);
    border-radius: 999px;
    color: rgb(5, 150, 105);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.sprints-pro-tip strong {
    color: rgb(5, 150, 105);
    font-size: 14px;
}

.sprints-pro-tip span {
    font-size: 14px;
}

.sprints-pro-tip kbd {
    background: rgb(255, 255, 255);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 5px;
    color: rgb(51, 65, 85);
    font-size: 12px;
    padding: 2px 7px;
}

.sprints-pro-tip button {
    background: transparent;
    border: 0;
    color: rgb(51, 65, 85);
    cursor: pointer;
    display: inline-flex;
    margin-left: auto;
    padding: 4px;
}

.sprints-pro-tip button svg {
    height: 18px;
    width: 18px;
}

html[data-theme="dark"] .sprints-page {
    color: var(--text);
}

html[data-theme="dark"] .sprints-page__title,
html[data-theme="dark"] .sprints-create-card h2,
html[data-theme="dark"] .sprints-card-header h2,
html[data-theme="dark"] .sprints-sprint-main h3,
html[data-theme="dark"] .sprints-backlog-empty strong,
html[data-theme="dark"] .sprints-story-row {
    color: var(--text);
}

html[data-theme="dark"] .sprints-page__subtitle,
html[data-theme="dark"] .sprints-date-range,
html[data-theme="dark"] .sprints-workflow-footer > span,
html[data-theme="dark"] .sprints-empty-list {
    color: var(--text-muted);
}

html[data-theme="dark"] .sprints-create-card,
html[data-theme="dark"] .sprints-backlog-card,
html[data-theme="dark"] .sprints-list-card,
html[data-theme="dark"] .sprints-empty-admin-card,
html[data-theme="dark"] .sprints-sprint-card,
html[data-theme="dark"] .sprints-story-list {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] .sprints-sprint-card--expanded {
    background: var(--surface);
}

html[data-theme="dark"] .sprints-sprint-header:hover {
    background: var(--surface-hover);
}

html[data-theme="dark"] .sprints-card-header,
html[data-theme="dark"] .sprints-expanded-meta,
html[data-theme="dark"] .sprints-story-row {
    border-color: var(--border);
}

html[data-theme="dark"] .sprints-field input,
html[data-theme="dark"] .sprints-field select,
html[data-theme="dark"] .sprints-select-wrap,
html[data-theme="dark"] .sprints-input-icon,
html[data-theme="dark"] .sprints-backlog-filter-field input,
html[data-theme="dark"] .sprints-backlog-filter-field select,
html[data-theme="dark"] .sprints-page__actions .btn-sm,
html[data-theme="dark"] .sprints-action,
html[data-theme="dark"] .sprints-team-chip,
html[data-theme="dark"] .sprints-row-action,
html[data-theme="dark"] .sprints-auto-fill,
html[data-theme="dark"] .sprints-footer-button--secondary,
html[data-theme="dark"] .sprint-story-item--backlog {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .sprints-backlog-filter-panel {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] .sprints-action--primary,
html[data-theme="dark"] .sprints-footer-button--primary {
    color: rgb(255, 255, 255);
}

html[data-theme="dark"] .sprints-select-wrap,
html[data-theme="dark"] .sprints-input-icon {
    box-shadow: inset 0 -1px 0 var(--border);
}

html[data-theme="dark"] .sprints-pro-tip {
    background: rgba(5, 150, 105, 0.14);
    border-color: rgba(5, 150, 105, 0.28);
    color: var(--text);
}

html[data-theme="dark"] .sprints-pro-tip kbd {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

html[data-theme="dark"] .sprints-pro-tip button {
    color: var(--text-secondary);
}

html[data-theme="dark"] .sprints-pro-tip button:hover,
html[data-theme="dark"] .sprints-pro-tip button:focus-visible {
    color: var(--text);
}

/* Workflow page action consistency: Work Items is the reference treatment. */
.roadmap-page__title,
.sprints-page__title {
    font-weight: 750;
}

.roadmap-card__title,
.roadmap-source-group__title,
.roadmap-source-item__name,
.sprints-create-card h2,
.sprints-card-header h2 {
    font-weight: 750;
}

.roadmap-page__actions .btn,
.roadmap-okr-card__actions .btn,
.roadmap-diagram-card__controls .roadmap-view-button,
.sprints-page__actions .btn-sm,
.sprints-action,
.sprints-create-submit,
.sprints-row-action,
.sprints-auto-fill,
.sprints-footer-button,
.sprints-empty-admin-card .sprints-action,
.sprint-board-back,
.sprint-board-main-action .btn,
.sprint-board-view-button {
    border-radius: 8px;
    font-weight: 700;
    min-height: 38px;
}

.roadmap-page__actions .btn,
.roadmap-okr-card__actions .btn,
.sprints-page__actions .btn-sm,
.sprints-action,
.sprints-create-submit,
.sprints-footer-button,
.sprints-empty-admin-card .sprints-action,
.sprint-board-back,
.sprint-board-main-action .btn,
.sprint-board-view-button {
    padding-left: 1rem;
    padding-right: 1rem;
}

.sprints-action,
.sprints-create-submit,
.sprints-footer-button {
    height: 38px;
}

.sprints-create-submit,
.sprints-row-action,
.sprints-auto-fill {
    border-radius: 8px;
    font-weight: 700;
}

.sprints-row-action--button {
    color: rgb(51, 65, 85);
    font-size: 0.8125rem;
    height: 38px;
    line-height: 1.2;
}

.sprints-row-action--button:hover {
    color: rgb(15, 23, 42);
    text-decoration: none;
}

.sprints-page__actions,
.sprints-card-actions {
    gap: 12px;
}

.sprints-field,
.sprints-story-row,
.sprints-points-pill,
.story-parent-tag,
.sprints-jira-link,
.sprints-workflow-footer > span {
    font-weight: 700;
}

@media (max-width: 1280px) {
    .sprints-create-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sprints-board-layout {
        grid-template-columns: 310px minmax(0, 1fr);
    }

    .sprints-sprint-collapsed-meta {
        grid-template-columns: minmax(96px, 132px) minmax(80px, 1fr) minmax(132px, max-content) 28px;
        max-width: none;
    }
}

@media (max-width: 980px) {
    .sprints-page__header,
    .sprints-page__actions,
    .sprints-pro-tip,
    .sprints-expanded-meta {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .sprints-create-form,
    .sprints-sprint-collapsed-meta {
        grid-template-columns: 1fr;
    }

    .sprints-sprint-collapsed-meta {
        flex-basis: 100%;
        max-width: none;
        width: 100%;
    }

    .sprints-story-row {
        grid-template-columns: minmax(0, 1fr) 56px 32px;
    }

    .sprints-jira-link {
        display: none;
    }

    .sprints-pro-tip button {
        margin-left: 0;
    }
}
.app-content:has(> .invoice-admin-page) {
    max-width: none;
    padding: 2rem 2.25rem 2.5rem;
}

.invoice-admin-page {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
    color: var(--text, rgb(15 23 42));
}

.invoice-admin-page-header,
.invoice-admin-page-actions,
.invoice-admin-filters,
.invoice-admin-pagination,
.invoice-admin-panel__heading,
.invoice-admin-xero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invoice-admin-page-header {
    justify-content: space-between;
}

.invoice-admin-page-header h1 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: 800;
}

.invoice-admin-page-header p,
.invoice-admin-metric span,
.invoice-admin-table span,
.invoice-admin-xero-meta dt,
.invoice-admin-activity small {
    color: var(--text-muted, rgb(71 85 105));
}

.invoice-admin-page-header p {
    margin: 0.45rem 0 0;
    font-size: 0.94rem;
}

.invoice-admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0 1rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.invoice-admin-button--primary {
    border-color: var(--primary, rgb(79 70 229));
    background: var(--primary, rgb(79 70 229));
    color: var(--surface, rgb(255 255 255));
}

.invoice-admin-button--secondary {
    background: var(--surface, rgb(255 255 255));
    color: var(--text, rgb(15 23 42));
}

.invoice-admin-alert,
.invoice-admin-metric,
.invoice-admin-ledger,
.invoice-admin-panel {
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 10px;
    background: var(--surface, rgb(255 255 255));
}

.invoice-admin-alert {
    padding: 0.9rem 1rem;
    font-weight: 700;
}

.invoice-admin-alert--danger {
    color: var(--danger, rgb(239 68 68));
    background: color-mix(in srgb, var(--danger, rgb(239 68 68)) 8%, var(--surface, rgb(255 255 255)));
}

.invoice-admin-alert--success {
    color: var(--success, rgb(16 185 129));
    background: color-mix(in srgb, var(--success, rgb(16 185 129)) 8%, var(--surface, rgb(255 255 255)));
}

.invoice-admin-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.invoice-admin-metric {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 8rem;
    padding: 1.25rem;
}

.invoice-admin-metric__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 900;
}

.invoice-admin-metric__icon--purple { color: var(--primary, rgb(79 70 229)); background: rgb(238 242 255); }
.invoice-admin-metric__icon--orange { color: rgb(217 119 6); background: rgb(255 247 237); }
.invoice-admin-metric__icon--green { color: rgb(5 150 105); background: rgb(220 252 231); }
.invoice-admin-metric__icon--red { color: rgb(239 68 68); background: rgb(254 226 226); }

.invoice-admin-metric strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.7rem;
    line-height: 1.15;
}

.invoice-admin-metric small {
    display: block;
    margin-top: 0.55rem;
    color: var(--primary, rgb(79 70 229));
    font-weight: 800;
}

.invoice-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1.25rem;
    align-items: start;
}

.invoice-admin-ledger,
.invoice-admin-panel {
    overflow: hidden;
}

.invoice-admin-filters {
    flex-wrap: wrap;
    padding: 1rem;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
}

.invoice-admin-filters label,
.invoice-admin-create-form label {
    display: grid;
    gap: 0.45rem;
    color: var(--text, rgb(15 23 42));
    font-size: 0.82rem;
    font-weight: 800;
}

.invoice-admin-filters input,
.invoice-admin-filters select,
.invoice-admin-create-form input,
.invoice-admin-create-form select {
    min-height: 2.5rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 7px;
    background: var(--surface, rgb(255 255 255));
    color: var(--text, rgb(15 23 42));
    padding: 0 0.8rem;
}

.invoice-admin-filters input {
    width: 14rem;
}

.invoice-admin-per-page {
    margin-left: auto;
}

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

.invoice-admin-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.invoice-admin-table th,
.invoice-admin-table td {
    padding: 1.15rem 1rem;
    border-bottom: 1px solid var(--border, rgb(219 227 239));
    text-align: left;
    vertical-align: middle;
}

.invoice-admin-table th {
    color: var(--text-muted, rgb(71 85 105));
    font-size: 0.78rem;
    font-weight: 900;
}

.invoice-admin-table td {
    font-size: 0.9rem;
}

.invoice-admin-table td > a,
.invoice-admin-panel__heading a {
    color: var(--primary, rgb(79 70 229));
    font-weight: 800;
    text-decoration: none;
}

.invoice-admin-table td > span,
.invoice-admin-table td strong + span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
}

.invoice-admin-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.45rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.invoice-admin-status--paid { color: rgb(5 150 105); background: rgb(220 252 231); }
.invoice-admin-status--pending { color: rgb(217 119 6); background: rgb(255 237 213); }
.invoice-admin-status--overdue,
.invoice-admin-status--failed { color: rgb(225 29 72); background: rgb(255 228 230); }
.invoice-admin-status--draft { color: rgb(71 85 105); background: rgb(241 245 249); }

.invoice-admin-menu-button {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 7px;
    background: var(--surface, rgb(255 255 255));
    font-weight: 900;
}

.invoice-admin-pagination {
    justify-content: space-between;
    padding: 1rem;
}

.invoice-admin-pagination nav {
    display: flex;
    gap: 0.45rem;
}

.invoice-admin-pagination a,
.invoice-admin-pagination nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    border: 1px solid var(--border, rgb(219 227 239));
    border-radius: 7px;
    color: var(--text, rgb(15 23 42));
    text-decoration: none;
    font-weight: 800;
}

.invoice-admin-pagination a.is-active {
    border-color: var(--primary, rgb(79 70 229));
    background: var(--primary, rgb(79 70 229));
    color: var(--surface, rgb(255 255 255));
}

.invoice-admin-side {
    display: grid;
    gap: 1rem;
}

.invoice-admin-panel {
    padding: 1.2rem;
}

.invoice-admin-panel h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
}

.invoice-admin-create-form {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.invoice-admin-create-form strong {
    color: var(--danger, rgb(239 68 68));
}

.invoice-admin-create-form span {
    color: var(--text-muted, rgb(71 85 105));
    font-weight: 500;
}

.invoice-admin-create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9rem;
    gap: 1rem;
}

.invoice-admin-panel__heading {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.invoice-admin-connection {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgb(241 245 249);
    color: rgb(71 85 105);
    font-size: 0.75rem;
    font-weight: 900;
}

.invoice-admin-connection.is-connected {
    background: rgb(220 252 231);
    color: rgb(5 150 105);
}

.invoice-admin-xero-meta {
    display: grid;
    gap: 0.9rem;
    margin: 0;
}

.invoice-admin-xero-meta div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.invoice-admin-xero-meta dt,
.invoice-admin-xero-meta dd {
    margin: 0;
    font-size: 0.86rem;
}

.invoice-admin-xero-meta dd {
    font-weight: 800;
}

.invoice-admin-xero-actions {
    margin-top: 1rem;
}

.invoice-admin-xero-actions > *,
.invoice-admin-xero-actions .invoice-admin-button {
    flex: 1;
}

.invoice-admin-activity {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.invoice-admin-activity li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.invoice-admin-activity li > span {
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    flex: 0 0 auto;
}

.invoice-admin-activity strong,
.invoice-admin-activity small {
    display: block;
}

.invoice-admin-empty {
    padding: 2rem;
    color: var(--text-muted, rgb(71 85 105));
    text-align: center;
}

@media (max-width: 1180px) {
    .invoice-admin-metrics,
    .invoice-admin-layout {
        grid-template-columns: 1fr;
    }

    .invoice-admin-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .app-content:has(> .invoice-admin-page) {
        padding: 1.25rem 1rem 2rem;
    }

    .invoice-admin-page-header,
    .invoice-admin-page-actions,
    .invoice-admin-pagination,
    .invoice-admin-xero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .invoice-admin-metrics,
    .invoice-admin-create-grid {
        grid-template-columns: 1fr;
    }

    .invoice-admin-filters > *,
    .invoice-admin-filters input,
    .invoice-admin-filters select,
    .invoice-admin-button {
        width: 100%;
    }

    .invoice-admin-per-page {
        margin-left: 0;
    }
}
/* === Admin Team Management ============================================== */
.app-content:has(> .team-management-page) {
    max-width: none;
    padding: 28px 32px 32px;
}

.team-management-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1668px;
    padding: 0;
}

.team-management-header,
.team-management-header__actions,
.team-management-metrics,
.team-management-workspace,
.team-management-detail__hero,
.team-management-detail__badges,
.team-management-members__header,
.team-management-add-member,
.team-management-capacity-overview {
    align-items: center;
    display: flex;
}

.team-management-header {
    gap: 16px;
    justify-content: space-between;
}

.team-management-header h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 8px;
}

.team-management-header p,
.team-management-dialog__header p,
.team-management-detail__hero p,
.team-management-detail__facts p,
.team-management-empty span,
.team-management-capacity-overview span,
.team-management-member small {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.team-management-header__actions {
    gap: 12px;
}

.team-management-button,
.team-management-create-row,
.team-management-actions__toggle,
.team-management-add-member button,
.team-management-actions__menu button,
.team-management-dialog__close,
.team-management-icon-button,
.team-management-kebab {
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    justify-content: center;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.team-management-button {
    border: 1px solid var(--border);
    height: 40px;
    padding: 0 16px;
}

.team-management-button--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
}

.team-management-button--primary:hover,
.team-management-button--primary:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.team-management-button--secondary {
    background: var(--surface);
    color: var(--text);
}

.team-management-button--secondary:hover,
.team-management-create-row:hover,
.team-management-add-member button:hover {
    background: var(--bg-secondary);
}

.team-management-button svg,
.team-management-create-row svg,
.team-management-actions__toggle svg,
.team-management-actions__menu svg,
.team-management-add-member svg,
.team-management-icon-button svg,
.team-management-kebab svg,
.team-management-search svg,
.team-management-detail__badges svg {
    height: 16px;
    width: 16px;
}

.team-management-search svg {
    flex: 0 0 16px;
}

.team-management-metrics {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-management-metric,
.team-management-teams,
.team-management-detail,
.team-management-capacity-overview aside,
.team-management-dialog__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.team-management-metric {
    align-items: center;
    display: flex;
    gap: 16px;
    min-height: 108px;
    padding: 20px 24px;
}

.team-management-metric small,
.team-management-detail__facts small,
.team-management-capacity-overview small,
.team-management-team-card small {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.team-management-metric strong {
    color: var(--text);
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 4px;
}

.team-management-metric em {
    color: var(--text-secondary);
    display: block;
    font-size: 14px;
    font-style: normal;
    margin-top: 4px;
}

.team-management-metric__icon,
.team-management-avatar,
.team-management-dialog__icon,
.team-management-member > span {
    align-items: center;
    border-radius: var(--radius-full);
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
}

.team-management-metric__icon {
    height: 56px;
    width: 56px;
}

.team-management-metric__icon svg,
.team-management-avatar svg,
.team-management-dialog__icon svg {
    height: 24px;
    width: 24px;
}

.team-management-tone--violet {
    background: var(--primary-light);
    color: var(--primary);
}

.team-management-tone--green {
    background: var(--success-soft);
    color: var(--success);
}

.team-management-tone--blue,
.team-management-tone--teal {
    background: var(--info-soft);
    color: var(--info);
}

.team-management-tone--orange {
    background: var(--warning-soft);
    color: var(--warning);
}

.team-management-tone--rose {
    background: var(--danger-soft);
    color: var(--danger);
}

.team-management-workspace {
    align-items: stretch;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(360px, 416px) minmax(0, 1fr);
}

.team-management-teams,
.team-management-detail {
    min-width: 0;
    padding: 20px;
}

.team-management-panel__head {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.team-management-panel__head h2,
.team-management-detail__hero h2,
.team-management-members h3,
.team-management-dialog__header h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0;
}

.team-management-search {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-sizing: border-box;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    height: 40px;
    margin-bottom: 0;
    min-width: 0;
    padding: 0 12px;
    width: 100%;
}

.team-management-search:focus-within,
.team-management-form input:focus,
.team-management-form textarea:focus,
.team-management-add-member select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.16);
    outline: 0;
}

.team-management-search input {
    background: transparent;
    border: 0;
    box-shadow: none;
    box-sizing: border-box;
    color: var(--text);
    flex: 1 1 auto;
    font: inherit;
    font-size: 14px;
    height: 100%;
    line-height: normal;
    min-height: 0;
    min-width: 0;
    outline: 0;
    padding: 0;
    width: 100%;
}

.team-management-team-list {
    display: grid;
    gap: 8px;
}

.team-management-team-card {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 84px;
    padding: 12px;
}

.team-management-team-card.is-selected {
    background: var(--primary-light);
    border-color: var(--primary);
}

.team-management-team-card a {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.team-management-avatar {
    height: 48px;
    width: 48px;
}

.team-management-avatar--large {
    height: 64px;
    width: 64px;
}

.team-management-team-card__body,
.team-management-member strong {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.team-management-team-card__body strong,
.team-management-member strong,
.team-management-detail__facts strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.team-management-team-card__meta {
    align-items: end;
    display: grid;
    gap: 8px;
    justify-items: end;
    min-width: 80px;
}

.team-management-badge,
.team-management-detail__badges span,
.team-management-members__row em {
    align-items: center;
    border-radius: var(--radius-full);
    display: inline-flex;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    gap: 4px;
    min-height: 24px;
    padding: 0 8px;
    width: fit-content;
}

.team-management-badge--success {
    background: var(--success-soft);
    color: var(--success);
}

.team-management-badge--primary {
    background: var(--primary-light);
    color: var(--primary);
}

.team-management-badge--muted {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.team-management-team-card progress,
.team-management-workload progress,
.team-management-capacity-overview progress {
    appearance: none;
    background: var(--bg-secondary);
    border: 0;
    border-radius: var(--radius-full);
    height: 6px;
    overflow: hidden;
    width: 76px;
}

.team-management-team-card progress::-webkit-progress-bar,
.team-management-workload progress::-webkit-progress-bar,
.team-management-capacity-overview progress::-webkit-progress-bar {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.team-management-team-card progress::-webkit-progress-value,
.team-management-workload progress::-webkit-progress-value,
.team-management-capacity-overview progress::-webkit-progress-value,
.team-management-team-card progress::-moz-progress-bar,
.team-management-workload progress::-moz-progress-bar,
.team-management-capacity-overview progress::-moz-progress-bar {
    background: var(--primary);
    border-radius: var(--radius-full);
}

.team-management-kebab,
.team-management-icon-button {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    height: 28px;
    padding: 0;
    width: 28px;
}

.team-management-kebab {
    border-radius: 6px;
}

.team-management-kebab:hover,
.team-management-icon-button:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.team-management-create-row {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    height: 40px;
    margin-top: 16px;
    width: 100%;
}

.team-management-detail {
    padding: 24px;
}

.team-management-detail__hero {
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    padding-bottom: 24px;
}

.team-management-detail__hero > div:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.team-management-detail__badges {
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}

.team-management-detail__badges > span:not(.team-management-badge) {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.team-management-actions {
    margin-left: auto;
    position: relative;
}

.team-management-actions__toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    height: 40px;
    padding: 0 14px;
}

.team-management-actions__toggle:hover {
    background: var(--bg-secondary);
}

.team-management-actions__menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 4px;
    min-width: 192px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 25;
}

.team-management-actions__menu button {
    background: transparent;
    border: 0;
    color: var(--text);
    height: 36px;
    justify-content: flex-start;
    padding: 0 8px;
    width: 100%;
}

.team-management-actions__menu button:hover {
    background: var(--bg-secondary);
}

.team-management-actions__menu form {
    margin: 0;
}

.team-management-actions__menu .team-management-actions__danger {
    color: var(--danger);
}

.team-management-detail__facts {
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.46fr);
    padding: 24px 0;
}

.team-management-detail__facts > div + div {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

.team-management-detail__facts small + strong,
.team-management-detail__facts p + small {
    margin-top: 16px;
}

.team-management-members {
    padding: 24px 0 0;
}

.team-management-members__header {
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.team-management-add-member {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1fr) max-content;
    min-width: 0;
    width: min(100%, 456px);
}

.team-management-add-member select,
.team-management-form input,
.team-management-form textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: 0;
}

.team-management-add-member select {
    height: 40px;
    min-width: 0;
    padding: 0 12px;
    width: 100%;
}

.team-management-add-member button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    flex: none;
    height: 40px;
    line-height: 1;
    min-width: 132px;
    padding: 0 14px;
    white-space: nowrap;
}

.team-management-members__table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.team-management-members__row {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 1.15fr) minmax(120px, 0.7fr) minmax(176px, 0.9fr) minmax(116px, 0.58fr) 32px;
    min-height: 60px;
    padding: 0 16px;
}

.team-management-members__row + .team-management-members__row {
    border-top: 1px solid var(--border);
}

.team-management-members__row--head {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    min-height: 40px;
    text-transform: uppercase;
}

.team-management-member {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.team-management-member > span {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    height: 36px;
    width: 36px;
}

.team-management-workload {
    align-items: center;
    display: flex;
    gap: 12px;
}

.team-management-members__empty,
.team-management-empty {
    color: var(--text-secondary);
    padding: 24px;
    text-align: center;
}

.team-management-empty {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.team-management-empty strong {
    color: var(--text);
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-management-capacity-overview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 20px;
    margin-top: 24px;
    padding: 16px;
}

.team-management-capacity-overview > div:first-child {
    min-width: 120px;
}

.team-management-capacity-overview > div:nth-child(3) {
    text-align: right;
}

.team-management-capacity-overview strong {
    color: var(--text);
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 8px;
}

.team-management-capacity-overview progress {
    flex: 1;
    min-width: 180px;
    width: auto;
}

.team-management-capacity-overview aside {
    min-width: 176px;
    padding: 16px;
}

.team-management-dialog {
    align-items: center;
    background: rgb(15 23 42 / 0.58);
    backdrop-filter: blur(8px);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 32px;
    position: fixed;
    z-index: 1000;
}

.team-management-dialog[hidden],
.team-management-actions__menu[hidden] {
    display: none;
}

.team-management-dialog__card {
    max-height: min(760px, calc(100vh - 64px));
    max-width: 760px;
    overflow: auto;
    width: min(760px, 100%);
}

.team-management-dialog__header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    padding: 24px;
}

.team-management-dialog__icon {
    background: var(--primary-light);
    border-radius: var(--radius);
    color: var(--primary);
    height: 48px;
    width: 48px;
}

.team-management-dialog__header > div {
    flex: 1;
    min-width: 0;
}

.team-management-dialog__close {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    font-size: 24px;
    height: 32px;
    line-height: 1;
    width: 32px;
}

.team-management-dialog__close:hover {
    color: var(--text);
}

.team-management-form {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 24px 24px 0;
}

.team-management-form label {
    color: var(--text);
    display: grid;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
}

.team-management-form input,
.team-management-form textarea {
    min-height: 40px;
    padding: 0 12px;
}

.team-management-form textarea {
    min-height: 112px;
    padding: 12px;
    resize: vertical;
}

.team-management-form__wide {
    grid-column: 1 / -1;
}

.team-management-dialog__footer {
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin: 4px -24px 0;
    padding: 20px 24px;
}

@media (max-width: 1250px) {
    .app-content:has(> .team-management-page) {
        padding: 24px;
    }

    .team-management-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-management-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-content:has(> .team-management-page) {
        padding: 16px 12px 32px;
    }

    .team-management-header,
    .team-management-header__actions,
    .team-management-detail__hero,
    .team-management-members__header,
    .team-management-add-member,
    .team-management-capacity-overview {
        align-items: stretch;
        flex-direction: column;
    }

    .team-management-metrics,
    .team-management-form,
    .team-management-detail__facts {
        grid-template-columns: 1fr;
    }

    .team-management-detail__facts > div + div {
        border-left: 0;
        border-top: 1px solid var(--border);
        padding: 20px 0 0;
    }

    .team-management-members__table {
        overflow-x: auto;
    }

    .team-management-members__row {
        min-width: 820px;
    }

    .team-management-button,
    .team-management-add-member select,
    .team-management-add-member button {
        width: 100%;
    }

    .team-management-dialog {
        padding: 12px;
    }

    .team-management-dialog__header,
    .team-management-form {
        padding-left: 20px;
        padding-right: 20px;
    }

    .team-management-dialog__footer {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
}
/* === Superadmin Audit Logs ================================================== */
.app-content:has(> .superadmin-audit-page) {
    max-width: none;
    padding: 28px 32px 32px;
}

.superadmin-audit-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1668px;
    padding: 0;
}

.superadmin-audit-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.superadmin-audit-header h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 8px;
}

.superadmin-audit-header p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    margin: 0;
}

.superadmin-audit-button {
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    height: 40px;
    justify-content: center;
    padding: 0 16px;
    text-decoration: none;
    white-space: nowrap;
}


.superadmin-audit-filter-form > .superadmin-audit-button {
    align-self: start;
    margin-top: 24px;
}
.superadmin-audit-button svg,
.superadmin-audit-date-control svg,
.superadmin-audit-stat__icon svg,
.superadmin-audit-resource svg {
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.superadmin-audit-button--primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: rgb(255 255 255);
    min-width: 112px;
}

.superadmin-audit-button--primary:hover,
.superadmin-audit-button--primary:focus-visible {
    background: var(--primary-dark);
    color: rgb(255 255 255);
    text-decoration: none;
}

.superadmin-audit-button--secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.superadmin-audit-button--secondary:hover,
.superadmin-audit-button--secondary:focus-visible {
    background: var(--bg-secondary);
    color: var(--text);
    text-decoration: none;
}

.superadmin-audit-filters,
.superadmin-audit-table-panel,
.superadmin-audit-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.superadmin-audit-filter-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(280px, 1.35fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.1fr) auto auto;
    padding: 20px;
}

.superadmin-audit-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.superadmin-audit-field > span:first-child,
.superadmin-audit-show-form label {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.superadmin-audit-field .form-control,
.superadmin-audit-show-form .form-control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
}

.superadmin-audit-date-control {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    gap: 8px;
    grid-template-columns: 16px minmax(0, 1fr) auto minmax(0, 1fr);
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
}

.superadmin-audit-date-control input {
    background: transparent;
    border: 0;
    color: var(--text);
    font: inherit;
    min-width: 0;
    outline: 0;
    padding: 0;
}

.superadmin-audit-date-control > span {
    color: var(--text-muted);
    font-size: 12px;
}

.superadmin-audit-stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.superadmin-audit-stat {
    align-items: center;
    display: flex;
    gap: 16px;
    min-height: 104px;
    padding: 20px;
}

.superadmin-audit-stat__icon {
    align-items: center;
    border-radius: var(--radius);
    display: inline-flex;
    flex: 0 0 auto;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.superadmin-audit-stat__icon--blue { background: rgb(224 242 254); color: rgb(37 99 235); }
.superadmin-audit-stat__icon--purple { background: var(--primary-light); color: var(--primary); }
.superadmin-audit-stat__icon--red { background: var(--danger-soft); color: var(--danger); }

.superadmin-audit-stat__label {
    color: var(--text-secondary);
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
}

.superadmin-audit-stat strong {
    color: var(--text);
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 8px;
}

.superadmin-audit-delta {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.superadmin-audit-delta--up { color: var(--success); }
.superadmin-audit-delta--down { color: var(--danger); }
.superadmin-audit-delta--flat { color: var(--text-muted); }

.superadmin-audit-table-panel {
    overflow: visible;
}

.superadmin-audit-table-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.superadmin-audit-table-header h2 {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.superadmin-audit-show-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.superadmin-audit-show-form .form-control {
    min-width: 88px;
}

.superadmin-audit-table-wrap {
    overflow-x: auto;
}

.superadmin-audit-table {
    border-collapse: collapse;
    min-width: 1320px;
    width: 100%;
}

.superadmin-audit-table th,
.superadmin-audit-table td {
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

.superadmin-audit-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-transform: uppercase;
}

.superadmin-audit-table td {
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    height: 56px;
    line-height: 1.45;
}

.superadmin-audit-time,
.superadmin-audit-mono {
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: nowrap;
}

.superadmin-audit-badge {
    align-items: center;
    border-radius: var(--radius-full);
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    min-height: 24px;
    padding: 0 10px;
    white-space: nowrap;
}

.superadmin-audit-badge--success { background: var(--success-soft); color: var(--success); }
.superadmin-audit-badge--neutral { background: var(--bg-secondary); color: var(--text-secondary); }
.superadmin-audit-badge--warning { background: var(--warning-soft); color: var(--warning); }
.superadmin-audit-badge--danger { background: var(--danger-soft); color: var(--danger); }
.superadmin-audit-badge--info { background: var(--primary-light); color: var(--primary); }

.superadmin-audit-user,
.superadmin-audit-resource {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.superadmin-audit-user span:last-child,
.superadmin-audit-resource span:last-child {
    min-width: 0;
}

.superadmin-audit-avatar,
.superadmin-audit-resource > span:first-child {
    align-items: center;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    height: 32px;
    justify-content: center;
    text-transform: uppercase;
    width: 32px;
}

.superadmin-audit-resource > span:first-child {
    background: transparent;
    border-radius: 0;
    color: var(--text-secondary);
}

.superadmin-audit-user strong,
.superadmin-audit-resource strong {
    color: var(--text);
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.superadmin-audit-user small,
.superadmin-audit-resource small {
    color: var(--text-secondary);
    display: block;
    font-size: 12px;
    line-height: 1.35;
    margin-top: 4px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.superadmin-audit-details {
    color: var(--text-secondary);
    max-width: 360px;
}

.superadmin-audit-details-text {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 40px;
    max-width: 360px;
    overflow: hidden;
    text-decoration: none;
    word-break: break-word;
}

.superadmin-audit-expand-cell {
    position: relative;
    width: 56px;
}

.superadmin-audit-details-toggle summary {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    font-size: 20px;
    height: 32px;
    justify-content: center;
    line-height: 1;
    list-style: none;
    width: 32px;
}

.superadmin-audit-details-toggle summary::-webkit-details-marker {
    display: none;
}

.superadmin-audit-details-toggle[open] summary {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(90deg);
}

.superadmin-audit-details-toggle > div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 8px;
    min-width: 320px;
    padding: 14px;
    position: absolute;
    right: 42px;
    top: 40px;
    z-index: 20;
}

.superadmin-audit-details-toggle > div strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.superadmin-audit-details-toggle > div span {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.superadmin-audit-empty {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    padding: 24px;
}

.superadmin-audit-pagination {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px 20px;
}

.superadmin-audit-pagination > span {
    color: var(--text-secondary);
    font-size: 13px;
}

.superadmin-audit-pages {
    align-items: center;
    display: flex;
    gap: 8px;
}

.superadmin-audit-pages a,
.superadmin-audit-pages span {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    height: 32px;
    justify-content: center;
    min-width: 32px;
    padding: 0 10px;
    text-decoration: none;
}

.superadmin-audit-pages span {
    border-color: transparent;
    color: var(--text-muted);
}

.superadmin-audit-pages a.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: rgb(255 255 255);
}

.superadmin-audit-pages a.is-disabled {
    color: var(--text-muted);
    pointer-events: none;
}

@media (max-width: 1180px) {
    .superadmin-audit-filter-form,
    .superadmin-audit-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .app-content:has(> .superadmin-audit-page) {
        padding: 20px 14px 32px;
    }

    .superadmin-audit-page { gap: 16px; }

    .superadmin-audit-header,
    .superadmin-audit-pagination,
    .superadmin-audit-table-header {
        align-items: stretch;
        flex-direction: column;
    }

    .superadmin-audit-filter-form,
    .superadmin-audit-stats {
        grid-template-columns: 1fr;
    }

    .superadmin-audit-button,
    .superadmin-audit-show-form,
    .superadmin-audit-show-form .form-control {
        width: 100%;
    }

    .superadmin-audit-filter-form > .superadmin-audit-button {
        margin-top: 0;
    }

    .superadmin-audit-date-control {
        grid-template-columns: 16px 1fr;
    }

    .superadmin-audit-date-control > span {
        display: none;
    }
}
/* === Superadmin AI Reliability & Failures ================================== */
.app-content:has(> .superadmin-ai-page) {
    max-width: none;
}

.superadmin-ai-page {
    color: rgb(7 21 48);
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 0 auto;
    max-width: 1668px;
    padding: 0 0 18px;
}

.superadmin-ai-header {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.superadmin-ai-header h1 {
    color: rgb(7 21 48);
    font-size: 1.64rem;
    font-weight: 850;
    line-height: 1.15;
    margin: 0 0 10px;
}

.superadmin-ai-header p {
    color: rgb(60 78 111);
    font-size: 0.91rem;
    line-height: 1.45;
    margin: 0;
}

.superadmin-ai-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.superadmin-ai-actions form { margin: 0; }

.superadmin-ai-button {
    align-items: center;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 850;
    gap: 8px;
    justify-content: center;
    min-height: 37px;
    padding: 0 16px;
    text-decoration: none;
    white-space: nowrap;
}

.superadmin-ai-button svg,
.superadmin-ai-date-control svg,
.superadmin-ai-search-control svg,
.superadmin-ai-stat-icon svg {
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.superadmin-ai-button--primary {
    background: rgb(79 70 229);
    border: 1px solid rgb(79 70 229);
    color: rgb(255 255 255);
}

.superadmin-ai-button--secondary {
    background: rgb(255 255 255);
    border: 1px solid rgb(203 216 234);
    color: rgb(7 21 48);
}

.superadmin-ai-button:hover,
.superadmin-ai-button:focus-visible { text-decoration: none; }
.superadmin-ai-button--primary:hover,
.superadmin-ai-button--primary:focus-visible { background: rgb(67 56 202); color: rgb(255 255 255); }
.superadmin-ai-button--secondary:hover,
.superadmin-ai-button--secondary:focus-visible { background: rgb(248 250 252); color: rgb(7 21 48); }

.superadmin-ai-filters,
.superadmin-ai-table-panel {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
}

.superadmin-ai-filter-form {
    display: grid;
    gap: 20px 22px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 18px;
}

.superadmin-ai-filter-form label {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.superadmin-ai-filter-form label > span:first-child,
.superadmin-ai-show-form label {
    color: rgb(7 21 48);
    font-size: 0.76rem;
    font-weight: 850;
}

.superadmin-ai-filter-form .form-control,
.superadmin-ai-show-form .form-control {
    border: 1px solid rgb(203 216 234);
    border-radius: 7px;
    color: rgb(7 21 48);
    font-size: 0.9rem;
    min-height: 37px;
}

.superadmin-ai-date,
.superadmin-ai-request { grid-column: span 2; }

.superadmin-ai-date-control,
.superadmin-ai-search-control {
    align-items: center;
    border: 1px solid rgb(203 216 234);
    border-radius: 7px;
    display: grid;
    gap: 8px;
    min-height: 37px;
    padding: 0 12px;
}

.superadmin-ai-date-control { grid-template-columns: 18px minmax(0, 1fr) auto minmax(0, 1fr); }
.superadmin-ai-search-control { grid-template-columns: 18px minmax(0, 1fr); }

.superadmin-ai-date-control input,
.superadmin-ai-search-control input {
    background: transparent;
    border: 0;
    color: rgb(7 21 48);
    font: inherit;
    min-width: 0;
    outline: 0;
    padding: 0;
}

.superadmin-ai-date-control > span {
    color: rgb(86 102 130);
    font-size: 0.8rem;
}

.superadmin-ai-filter-actions {
    align-items: end;
    display: flex;
    gap: 12px;
    grid-column: span 1;
    justify-content: flex-end;
}

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

.superadmin-ai-stats article {
    align-items: center;
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    display: flex;
    gap: 22px;
    min-height: 122px;
    padding: 22px 24px;
}

.superadmin-ai-stat-icon {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.superadmin-ai-stat-icon--red { background: rgb(254 226 226); color: rgb(239 68 68); }
.superadmin-ai-stat-icon--orange { background: rgb(255 237 213); color: rgb(234 88 12); }
.superadmin-ai-stat-icon--green { background: rgb(209 250 229); color: rgb(5 150 105); }
.superadmin-ai-stat-icon--purple { background: rgb(237 233 254); color: rgb(79 70 229); }

.superadmin-ai-stats small {
    color: rgb(47 64 96);
    display: block;
    font-size: 0.78rem;
    font-weight: 850;
    margin-bottom: 8px;
}

.superadmin-ai-stats strong {
    color: rgb(7 21 48);
    display: block;
    font-size: 1.58rem;
    font-weight: 850;
    line-height: 1;
    margin-bottom: 10px;
}

.superadmin-ai-stats a,
.superadmin-ai-delta {
    display: block;
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 750;
}

.superadmin-ai-delta--up { color: rgb(5 150 105); }
.superadmin-ai-delta--down { color: rgb(225 29 72); }
.superadmin-ai-delta--flat { color: rgb(86 102 130); }

.superadmin-ai-table-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 18px 20px 10px;
}

.superadmin-ai-table-header h2 {
    align-items: center;
    color: rgb(7 21 48);
    display: flex;
    font-size: 1.12rem;
    font-weight: 850;
    gap: 10px;
    margin: 0;
}

.superadmin-ai-table-header h2 span {
    background: rgb(241 245 249);
    border-radius: 999px;
    color: rgb(47 64 96);
    font-size: 0.72rem;
    font-weight: 850;
    padding: 4px 8px;
}

.superadmin-ai-show-form {
    align-items: center;
    display: flex;
    gap: 10px;
}

.superadmin-ai-show-form .form-control { min-width: 80px; }
.superadmin-ai-table-wrap { overflow-x: auto; }

.superadmin-ai-table {
    border-collapse: collapse;
    min-width: 1360px;
    width: 100%;
}

.superadmin-ai-table th,
.superadmin-ai-table td {
    border-bottom: 1px solid rgb(226 232 240);
    color: rgb(7 21 48);
    font-size: 0.85rem;
    height: 50px;
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
}

.superadmin-ai-table th {
    background: rgb(248 250 252);
    color: rgb(47 64 96);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.superadmin-ai-table code {
    background: transparent;
    color: rgb(37 55 86);
    font-size: 0.84rem;
    padding: 0;
}

.superadmin-ai-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 850;
    min-height: 22px;
    padding: 5px 10px;
    white-space: nowrap;
}

.superadmin-ai-status--failed { background: rgb(254 226 226); color: rgb(225 29 72); }
.superadmin-ai-status--timeout { background: rgb(255 237 213); color: rgb(234 88 12); }
.superadmin-ai-status--safety_blocked { background: rgb(254 243 199); color: rgb(180 83 9); }
.superadmin-ai-status--retried { background: rgb(219 234 254); color: rgb(37 99 235); }
.superadmin-ai-status--rate_limited { background: rgb(237 233 254); color: rgb(79 70 229); }

.superadmin-ai-provider {
    align-items: center;
    display: inline-flex;
    gap: 9px;
    white-space: nowrap;
}

.superadmin-ai-provider span {
    align-items: center;
    background: rgb(238 242 255);
    border-radius: 6px;
    color: rgb(79 70 229);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 900;
    height: 24px;
    justify-content: center;
    min-width: 24px;
}

.superadmin-ai-expand-cell { position: relative; width: 40px; }

.superadmin-ai-expand-cell details summary,
.superadmin-ai-actions-menu summary {
    align-items: center;
    border: 1px solid rgb(215 225 239);
    border-radius: 7px;
    color: rgb(37 55 86);
    cursor: pointer;
    display: inline-flex;
    height: 29px;
    justify-content: center;
    list-style: none;
    width: 29px;
}

.superadmin-ai-expand-cell details summary::-webkit-details-marker,
.superadmin-ai-actions-menu summary::-webkit-details-marker { display: none; }

.superadmin-ai-expand-cell details[open] summary {
    background: rgb(238 242 255);
    border-color: rgb(129 140 248);
    color: rgb(79 70 229);
    transform: rotate(90deg);
}

.superadmin-ai-expand-cell details > div,
.superadmin-ai-actions-menu > div {
    background: rgb(255 255 255);
    border: 1px solid rgb(215 225 239);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 8px;
    min-width: 280px;
    padding: 14px;
    position: absolute;
    z-index: 30;
}

.superadmin-ai-expand-cell details > div { left: 44px; top: 40px; }
.superadmin-ai-actions-menu { position: relative; }
.superadmin-ai-actions-menu > div { min-width: 170px; right: 0; top: 34px; }
.superadmin-ai-expand-cell details > div strong { font-size: 0.82rem; }

.superadmin-ai-expand-cell details > div span,
.superadmin-ai-actions-menu a {
    color: rgb(60 78 111);
    font-size: 0.8rem;
    line-height: 1.35;
    text-decoration: none;
}

.superadmin-ai-actions-menu a:hover { color: rgb(79 70 229); }

.superadmin-ai-empty {
    color: rgb(60 78 111);
    font-size: 0.9rem;
    margin: 0;
    padding: 30px 22px;
}

.superadmin-ai-pagination {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px 22px;
}

.superadmin-ai-pagination > span {
    color: rgb(60 78 111);
    font-size: 0.84rem;
}

.superadmin-ai-pagination nav {
    align-items: center;
    display: flex;
    gap: 7px;
}

.superadmin-ai-pagination nav a,
.superadmin-ai-pagination nav span {
    align-items: center;
    border: 1px solid rgb(215 225 239);
    border-radius: 7px;
    color: rgb(7 21 48);
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    min-width: 32px;
    padding: 0 10px;
    text-decoration: none;
}

.superadmin-ai-pagination nav span { border-color: transparent; color: rgb(86 102 130); }
.superadmin-ai-pagination nav a.is-active { background: rgb(79 70 229); border-color: rgb(79 70 229); color: rgb(255 255 255); }
.superadmin-ai-pagination nav a.is-disabled { color: rgb(148 163 184); pointer-events: none; }

@media (max-width: 1180px) {
    .superadmin-ai-filter-form,
    .superadmin-ai-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .superadmin-ai-date,
    .superadmin-ai-request,
    .superadmin-ai-filter-actions { grid-column: span 1; }
}

@media (max-width: 760px) {
    .superadmin-ai-header,
    .superadmin-ai-table-header,
    .superadmin-ai-pagination { align-items: stretch; flex-direction: column; }
    .superadmin-ai-actions,
    .superadmin-ai-filter-actions { align-items: stretch; flex-direction: column; }
    .superadmin-ai-filter-form,
    .superadmin-ai-stats { grid-template-columns: 1fr; }
    .superadmin-ai-button,
    .superadmin-ai-actions form,
    .superadmin-ai-show-form,
    .superadmin-ai-show-form .form-control { width: 100%; }
    .superadmin-ai-date-control { grid-template-columns: 18px 1fr; }
    .superadmin-ai-date-control > span { display: none; }
}

/* Superadmin context template detail */
.app-content:has(> .context-template-detail-page) {
    max-width: none;
    padding: 1.5rem 2.25rem 3rem;
}

.context-template-detail-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    width: 100%;
}

.context-template-detail-hero {
    align-items: flex-end;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    padding: 0.25rem 0 0.25rem;
}

.context-template-detail-hero__back {
    color: var(--primary);
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-decoration: none;
}

.context-template-detail-hero__back:hover,
.context-template-detail-hero__back:focus {
    color: var(--primary-dark);
    text-decoration: none;
}

.context-template-detail-hero .page-title {
    font-size: 1.85rem;
    line-height: 1.15;
    margin: 0;
}

.context-template-detail-hero__subtitle {
    color: var(--text-light);
    font-size: 0.96rem;
    line-height: 1.45;
    margin: 0.65rem 0 0;
}

.context-template-detail-hero__actions,
.context-template-detail-footer {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.context-template-detail-hero__actions form,
.context-template-detail-footer form {
    margin: 0;
}

.context-template-detail-hero__actions .btn,
.context-template-detail-footer .btn {
    border-radius: 0.45rem;
    font-size: 0.91rem;
    min-height: 2.65rem;
    min-width: 10.25rem;
    padding: 0 1.15rem;
}

.context-template-detail-page svg {
    flex: 0 0 auto;
    height: 1rem;
    width: 1rem;
}

.context-template-detail-summary,
.context-template-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xs);
}

.context-template-detail-summary {
    padding: 1.55rem 1.75rem 1.45rem;
}

.context-template-detail-summary__grid {
    display: grid;
    gap: 0;
    grid-template-columns: 0.75fr 0.7fr 0.95fr 0.85fr 1.1fr 0.75fr 0.9fr;
    margin: 0;
}

.context-template-detail-summary__grid div {
    border-right: 1px solid var(--border);
    min-width: 0;
    padding: 0.2rem 2rem 0.35rem 0;
}

.context-template-detail-summary__grid div + div {
    padding-left: 2rem;
}

.context-template-detail-summary__grid div:last-child {
    border-right: 0;
    padding-right: 0;
}

.context-template-detail-summary dt {
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.55rem;
}

.context-template-detail-summary dd {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.context-template-detail-status {
    align-items: center;
    border-radius: 0.35rem;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    min-height: 1.55rem;
    padding: 0 0.55rem;
}

.context-template-detail-status--active {
    background: var(--success-soft);
    color: var(--success);
}

.context-template-detail-status--draft,
.context-template-detail-status--pending {
    background: var(--warning-soft);
    color: var(--warning);
}

.context-template-detail-status--deprecated,
.context-template-detail-status--retired {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.context-template-detail-summary__description {
    border-top: 1px solid var(--border);
    margin-top: 1.45rem;
    padding-top: 1.35rem;
}

.context-template-detail-summary__description span,
.context-template-detail-section > span {
    color: var(--text-light);
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

.context-template-detail-summary__description p,
.context-template-detail-empty {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.5;
    margin: 0;
}

.context-template-detail-card {
    overflow: hidden;
    padding: 1.35rem 1.55rem;
}

.context-template-detail-card h2 {
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 1rem;
}

.context-template-detail-card h2 span {
    color: var(--text-secondary);
    font-weight: 700;
}

.context-template-field-list {
    display: grid;
}

.context-template-field-row {
    align-items: center;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 1rem;
    grid-template-columns: 2.1rem 1.55fr 0.75fr 2.15fr 1.85fr 1.4rem;
    min-height: 4rem;
    padding: 0.85rem 0;
}

.context-template-field-row:first-child {
    border-top: 0;
}

.context-template-field-row__icon {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.38rem;
    color: var(--text-secondary);
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.context-template-field-row__label strong,
.context-template-detail-section strong {
    color: var(--text);
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.context-template-field-row__badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 600;
    justify-self: start;
    padding: 0.25rem 0.55rem;
    white-space: nowrap;
}

.context-template-field-row p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
    margin: 0;
}

.context-template-field-row em {
    color: var(--text-light);
    font-size: 0.92rem;
    font-style: italic;
    line-height: 1.45;
}

.context-template-field-row a {
    align-items: center;
    border-radius: 0.35rem;
    color: var(--text-secondary);
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    text-decoration: none;
    width: 2rem;
}

.context-template-field-row a:hover,
.context-template-field-row a:focus {
    background: var(--bg);
    color: var(--primary);
    text-decoration: none;
}

.context-template-detail-grid {
    display: grid;
    gap: 1.35rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.context-template-persona-card,
.context-template-contract-card {
    min-height: 18rem;
}

.context-template-detail-section {
    border-top: 1px solid var(--border);
    padding: 1.15rem 0;
}

.context-template-detail-card h2 + .context-template-detail-section {
    border-top: 0;
    padding-top: 0;
}

.context-template-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.95rem;
}

.context-template-chip {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.38rem;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 700;
    gap: 0.5rem;
    min-height: 2.05rem;
    padding: 0 0.85rem;
}

.context-template-chip--delivery {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.24);
    color: var(--primary);
}

.context-template-chip--operations {
    background: var(--warning-soft);
    border-color: var(--warning-soft);
    color: var(--warning);
}

.context-template-rule-list {
    display: grid;
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-template-rule-list li {
    align-items: center;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    font-size: 0.94rem;
    font-weight: 600;
    gap: 0.65rem;
    min-height: 2.55rem;
}

.context-template-rule-list li svg {
    color: var(--success);
}

.context-template-raw-contract {
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    margin-top: 1.25rem;
    overflow: hidden;
}

.context-template-raw-contract summary {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.93rem;
    font-weight: 700;
    padding: 0.85rem 1rem;
}

.context-template-raw-contract pre {
    background: var(--bg);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0;
    max-height: 18rem;
    overflow: auto;
    padding: 1rem;
}

.context-template-detail-footer {
    justify-content: space-between;
    padding: 0 1.15rem;
}

.context-template-detail-footer .btn-primary {
    min-width: 10.5rem;
}

@media (max-width: 1320px) {
    .context-template-detail-summary__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        row-gap: 1.15rem;
    }

    .context-template-detail-summary__grid div {
        border-right: 0;
        padding-left: 0 !important;
    }

    .context-template-field-row {
        grid-template-columns: 2.1rem 1fr 0.75fr;
    }

    .context-template-field-row p,
    .context-template-field-row em {
        grid-column: 2 / -1;
    }

    .context-template-field-row a {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }
}

@media (max-width: 900px) {
    .app-content:has(> .context-template-detail-page) {
        padding: 1.25rem 1rem 2rem;
    }

    .context-template-detail-hero,
    .context-template-detail-hero__actions,
    .context-template-detail-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .context-template-detail-hero__actions .btn,
    .context-template-detail-hero__actions form,
    .context-template-detail-footer .btn,
    .context-template-detail-footer form {
        width: 100%;
    }

    .context-template-detail-summary__grid,
    .context-template-detail-grid {
        grid-template-columns: 1fr;
    }

    .context-template-field-row {
        align-items: flex-start;
        grid-template-columns: 2.1rem 1fr;
    }

    .context-template-field-row__badge,
    .context-template-field-row p,
    .context-template-field-row em {
        grid-column: 2;
    }

    .context-template-field-row a {
        grid-column: 2;
        grid-row: auto;
        justify-self: start;
    }
}

.context-template-detail-hero .page-title {
    display: flex;
    width: fit-content;
}

/* Project and Work Item Modal Overhaul */
.project-create-modal {
    border-radius: 12px;
    max-width: min(920px, calc(100vw - 48px));
}

.project-edit-modal,
.prioritisation-framework-modal {
    border-radius: 12px;
    max-width: min(760px, calc(100vw - 48px));
}

.project-create-modal__header,
.project-edit-modal__header {
    padding: 24px 28px 16px;
}

.project-create-modal .modal-header__icon,
.project-edit-modal .modal-header__icon {
    border-radius: 8px;
    height: 44px;
    width: 44px;
}

.project-create-modal__body,
.project-edit-modal__body {
    display: grid;
    gap: 16px;
    padding: 16px 28px 24px;
}

.project-create-modal .form-group,
.project-edit-modal .form-group {
    margin-bottom: 0;
}

.project-create-modal .form-label span,
.project-edit-modal .form-label span,
.wi-modal label span {
    color: rgb(220, 38, 38);
}

.project-create-modal__helper,
.project-edit-modal__helper,
.wi-modal-helper {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 8px 0 0;
}

.project-create-modal__section-title {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 8px;
}

.project-create-modal__members .member-picker-wrap,
.project-edit-modal__members .member-picker-wrap {
    margin-top: 16px;
}
.project-create-modal__context {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.project-create-modal__context-options {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-create-modal__context-option {
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: 20px minmax(0, 1fr);
    min-height: 100%;
    padding: 12px;
}

.project-create-modal__context-option:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.project-create-modal__context-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.62;
}

.project-create-modal__context-option input {
    margin-top: 2px;
}

.project-create-modal__context-option strong {
    color: var(--text);
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.project-create-modal__context-option small {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    line-height: 1.45;
    margin-top: 4px;
}

.project-create-modal__context-template {
    margin-top: 14px;
}

.project-create-modal .member-picker-wrap > .text-muted:first-of-type,
.project-edit-modal .member-picker-wrap > .text-muted:first-of-type {
    margin: 0 0 16px;
}

.project-create-modal .member-search-input,
.project-edit-modal .member-search-input {
    min-height: 44px;
    padding-left: 12px;
}

.project-create-modal__footer,
.project-edit-modal__footer {
    padding: 16px 28px;
}

.wi-modal {
    max-width: 1220px;
}

.wi-modal .modal-header {
    padding: 1.45rem 1.75rem 0.9rem;
}

.wi-modal-body {
    gap: 1rem 1.35rem;
    padding: 1rem 1.75rem 1.45rem;
}

.wi-modal .form-group {
    margin-bottom: 0;
}

.wi-modal .modal-field-wrap[data-field="title"],
.wi-modal .modal-field-wrap[data-field="description"],
.wi-modal .modal-field-wrap[data-field="key_results"],
.wi-modal .modal-field-wrap[data-field="git_links"] {
    grid-column: 1 / -1;
}

.wi-modal .modal-field-wrap[data-field="acceptance_criteria"],
.wi-modal .modal-field-wrap[data-field="kr_hypothesis"] {
    grid-column: span 1;
}

.wi-modal .modal-field-wrap[data-field="estimated_sprints"] {
    max-width: 180px;
}

.wi-modal-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.wi-modal-ai-actions .btn {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
}

.wi-modal-ai-actions svg {
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 1rem;
}

.wi-modal-detail-panel .modal-detail {
    height: 100%;
}

.wi-modal-kr-results:empty,
.wi-modal-kr-mount:empty {
    display: none;
}

.wi-modal .kr-editor {
    border-top: 1px solid var(--border);
    margin-top: 0.15rem;
    padding-top: 1rem;
}

.wi-modal .kr-editor-title {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.wi-modal .kr-editor-table {
    border-collapse: collapse;
    width: 100%;
}

.wi-modal .kr-editor-head {
    background: rgb(248, 250, 252);
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    padding: 0.55rem 0.6rem;
    text-align: left;
    text-transform: uppercase;
}

.wi-modal .kr-editor-cell {
    border-bottom: 1px solid rgb(226, 232, 240);
    padding: 0.55rem 0.45rem;
}

.wi-modal .kr-editor-input,
.wi-modal .kr-editor-select {
    min-height: 2.4rem;
    padding: 0.45rem 0.55rem;
}

.wi-modal .kr-editor-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.7rem;
}

.wi-modal .kr-editor-add,
.wi-modal .kr-editor-save {
    border-radius: 8px;
    border: 1px solid rgb(199, 210, 254);
    cursor: pointer;
    font-weight: 700;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
}

.wi-modal .kr-editor-add {
    background: var(--surface);
    color: var(--primary);
}

.wi-modal .kr-editor-save {
    background: var(--primary);
    color: white;
}

.wi-modal .git-links-section {
    border-top: 1px solid var(--border);
    margin-top: 0.15rem;
    padding-top: 1rem;
}

.wi-modal .git-links-section__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.wi-modal .modal-footer {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

@media (max-width: 980px) {
    .wi-modal .modal-field-wrap[data-field="acceptance_criteria"],
    .wi-modal .modal-field-wrap[data-field="kr_hypothesis"] {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .project-create-modal__context-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-create-modal__header,
    .project-create-modal__body,
    .project-create-modal__footer,
    .project-edit-modal__header,
    .project-edit-modal__body,
    .project-edit-modal__footer,
    .wi-modal .modal-header,
    .wi-modal-body,
    .wi-modal .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wi-modal .git-links-section__form {
        grid-template-columns: 1fr;
    }
}
/* === UI Overhaul Batch 2: Admin Billing, Invoices, Audit Logs =========== */
.app-content:has(> .admin-billing-page),
.app-content:has(> .admin-audit-page),
.app-content:has(> .invoice-admin-page) {
    max-width: none;
    padding: 28px 32px 32px;
}

.admin-billing-page,
.admin-audit-page,
.invoice-admin-page {
    color: var(--text);
    gap: 20px;
    margin: 0 auto;
    max-width: 1532px;
    padding: 0;
}

.admin-billing-header,
.admin-audit-header,
.invoice-admin-page-header {
    align-items: flex-start;
    gap: 16px;
}

.admin-billing-header__copy h1,
.admin-audit-header h1,
.invoice-admin-page-header h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 8px;
}

.admin-billing-header__copy p,
.admin-billing-panel p,
.admin-billing-muted,
.admin-audit-total,
.admin-audit-empty,
.admin-audit-pagination > span,
.invoice-admin-page-header p,
.invoice-admin-metric span,
.invoice-admin-table span,
.invoice-admin-xero-meta dt,
.invoice-admin-activity small {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.admin-billing-primary-button,
.admin-billing-secondary-button,
.admin-billing-danger-button,
.admin-audit-primary-button,
.admin-audit-secondary-button,
.invoice-admin-button {
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
}

.admin-billing-secondary-button--small,
.admin-audit-secondary-button--compact {
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    min-height: 34px;
    padding: 0 14px;
}

.admin-billing-primary-button,
.admin-audit-primary-button,
.invoice-admin-button--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
}

.admin-billing-primary-button:hover,
.admin-billing-primary-button:focus-visible,
.admin-audit-primary-button:hover,
.admin-audit-primary-button:focus-visible,
.invoice-admin-button--primary:hover,
.invoice-admin-button--primary:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--surface);
}

.admin-billing-secondary-button,
.admin-audit-secondary-button,
.invoice-admin-button--secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.admin-billing-danger-button {
    background: var(--surface);
    border-color: rgb(248 113 113);
    color: rgb(220 38 38);
}

.admin-billing-kpi,
.admin-billing-panel,
.admin-audit-filter-panel,
.admin-audit-table-panel,
.invoice-admin-alert,
.invoice-admin-metric,
.invoice-admin-ledger,
.invoice-admin-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.admin-billing-kpi,
.invoice-admin-metric {
    min-height: 148px;
    padding: 20px;
}

.admin-billing-kpi__icon,
.invoice-admin-metric__icon {
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    height: 40px;
    width: 40px;
}

.admin-billing-kpi__label,
.invoice-admin-metric span:first-of-type {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-transform: uppercase;
}

.admin-billing-kpi strong,
.invoice-admin-metric strong {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.admin-billing-kpi strong small,
.admin-billing-kpi__note,
.invoice-admin-metric small {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.admin-billing-panel,
.invoice-admin-panel {
    padding: 20px;
}

.admin-billing-panel h2,
.invoice-admin-panel h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
}

.admin-billing-status,
.admin-billing-chip,
.admin-audit-badge,
.invoice-admin-status,
.invoice-admin-connection {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    min-height: 22px;
    padding: 0 8px;
}

.admin-audit-filter-form,
.invoice-admin-filters {
    align-items: end;
    gap: 12px;
    padding: 16px 20px;
}

.admin-audit-filter-form {
    grid-template-columns: auto minmax(220px, 260px) auto minmax(96px, 120px) auto 1fr;
}

.admin-audit-per-page-select {
    min-width: 72px;
    text-align: right;
    text-align-last: right;
}

.admin-audit-filter-form label,
.invoice-admin-filters label,
.invoice-admin-create-form label,
.admin-billing-seat-form label,
.admin-billing-contact-form span {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.admin-audit-filter-form .form-control,
.invoice-admin-filters input,
.invoice-admin-filters select,
.invoice-admin-create-form input,
.invoice-admin-create-form select,
.admin-billing-seat-form input,
.admin-billing-contact-form input,
.admin-billing-contact-form select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    min-height: 40px;
    padding: 0 12px;
}

.admin-audit-table,
.admin-billing-table,
.invoice-admin-table {
    border-collapse: collapse;
    width: 100%;
}

.admin-audit-table th,
.admin-audit-table td,
.admin-billing-table th,
.admin-billing-table td,
.invoice-admin-table th,
.invoice-admin-table td {
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    padding: 14px 16px;
    text-align: left;
}

.admin-audit-table th,
.admin-billing-table th,
.invoice-admin-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.admin-audit-sort-link {
    align-items: center;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 4px;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-decoration: none;
    text-transform: uppercase;
}

.admin-audit-sort-link:hover,
.admin-audit-sort-link:focus-visible {
    color: var(--primary);
    text-decoration: none;
}

.admin-audit-time,
.admin-audit-ip,
.admin-audit-details,
.admin-audit-user strong,
.admin-billing-definition-grid dd,
.admin-billing-mini-list dd,
.admin-billing-xero__meta dd,
.invoice-admin-table td,
.invoice-admin-xero-meta dd {
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.admin-audit-user strong,
.admin-billing-definition-grid dd,
.admin-billing-mini-list dd,
.admin-billing-xero__meta dd,
.invoice-admin-table td strong,
.invoice-admin-xero-meta dd {
    font-weight: 600;
}

.admin-audit-user span,
.admin-billing-definition-grid dt,
.admin-billing-mini-list dt,
.admin-billing-xero__meta dt,
.invoice-admin-table td > span,
.invoice-admin-table td strong + span,
.invoice-admin-xero-meta dt {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.admin-billing-menu-button,
.invoice-admin-menu-button {
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    height: 28px;
    width: 28px;
}

.admin-audit-pages a,
.admin-audit-pages span,
.admin-billing-pagination a,
.invoice-admin-pagination a,
.invoice-admin-pagination nav span {
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    height: 34px;
    min-width: 34px;
}

.admin-audit-pages a.is-active,
.admin-billing-pagination a.is-active,
.invoice-admin-pagination a.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
}

@media (max-width: 760px) {
    .app-content:has(> .admin-billing-page),
    .app-content:has(> .admin-audit-page),
    .app-content:has(> .invoice-admin-page) {
        padding: 20px 16px 32px;
    }

    .admin-billing-header,
    .admin-audit-header,
    .invoice-admin-page-header {
        align-items: stretch;
        flex-direction: column;
    }
}
/* === UI Overhaul Batch 3: Superadmin AI Logs And Subscriptions ========== */
.app-content:has(> .superadmin-ai-page),
.app-content:has(> .superadmin-subscriptions-page) {
    max-width: none;
    padding: 28px 32px 32px;
}

.superadmin-ai-page,
.superadmin-subscriptions-page {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1668px;
    padding: 0;
}

.superadmin-ai-header,
.superadmin-subscriptions-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.superadmin-ai-header h1,
.superadmin-subscriptions-header h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 8px;
}

.superadmin-ai-header p,
.superadmin-subscriptions-header p,
.superadmin-ai-empty,
.superadmin-ai-pagination > span,
.superadmin-subscriptions-empty,
.superadmin-subscriptions-pagination > span,
.superadmin-subscriptions-tip,
.superadmin-subscriptions-table small {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    margin: 0;
}

.superadmin-ai-button,
.superadmin-subscriptions-filter-button,
.superadmin-subscriptions-export,
.superadmin-subscriptions-edit-form button {
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    text-decoration: none;
    white-space: nowrap;
}

.superadmin-ai-button--primary,
.superadmin-subscriptions-edit-form button {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--surface);
}

.superadmin-ai-button--primary:hover,
.superadmin-ai-button--primary:focus-visible,
.superadmin-subscriptions-edit-form button:hover,
.superadmin-subscriptions-edit-form button:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--surface);
}

.superadmin-ai-button--secondary,
.superadmin-subscriptions-filter-button,
.superadmin-subscriptions-export {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.superadmin-ai-actions,
.superadmin-ai-filter-actions,
.superadmin-subscriptions-filter-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.superadmin-ai-actions form {
    margin: 0;
}

.superadmin-ai-filters,
.superadmin-ai-table-panel,
.superadmin-ai-stats article,
.superadmin-subscriptions-filter-card,
.superadmin-subscriptions-table-card,
.superadmin-subscriptions-tip,
.superadmin-subscriptions-detail-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.superadmin-ai-filter-form,
.superadmin-subscriptions-filter-card {
    align-items: end;
    display: grid;
    gap: 12px;
    padding: 20px;
}

.superadmin-ai-filter-form {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.superadmin-subscriptions-filter-card {
    grid-template-columns: minmax(280px, 1.35fr) repeat(4, minmax(140px, 1fr)) auto auto;
}

.superadmin-ai-filter-form label,
.superadmin-ai-show-form label,
.superadmin-subscriptions-filter-card label,
.superadmin-subscriptions-page-size,
.superadmin-subscriptions-edit-form label {
    color: var(--text);
    display: grid;
    font-size: 12px;
    font-weight: 600;
    gap: 8px;
    line-height: 1.35;
    min-width: 0;
}

.superadmin-ai-filter-form .form-control,
.superadmin-ai-show-form .form-control,
.superadmin-ai-date-control,
.superadmin-ai-search-control,
.superadmin-subscriptions-filter-card input,
.superadmin-subscriptions-filter-card select,
.superadmin-subscriptions-page-size select,
.superadmin-subscriptions-edit-form input,
.superadmin-subscriptions-edit-form select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    width: 100%;
}

.superadmin-ai-date,
.superadmin-ai-request {
    grid-column: span 2;
}

.superadmin-ai-date-control,
.superadmin-ai-search-control,
.superadmin-subscriptions-search {
    align-items: center;
    display: grid;
    gap: 8px;
}

.superadmin-ai-date-control {
    grid-template-columns: 16px minmax(0, 1fr) auto minmax(0, 1fr);
}

.superadmin-ai-search-control,
.superadmin-subscriptions-search {
    grid-template-columns: 16px minmax(0, 1fr);
}

.superadmin-ai-date-control input,
.superadmin-ai-search-control input,
.superadmin-subscriptions-search input {
    background: transparent;
    border: 0;
    color: var(--text);
    font: inherit;
    min-width: 0;
    padding: 0;
}

.superadmin-ai-date-control svg,
.superadmin-ai-search-control svg,
.superadmin-subscriptions-search svg,
.superadmin-subscriptions-filter-button svg,
.superadmin-subscriptions-export svg {
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.superadmin-ai-stats,
.superadmin-subscriptions-more-filters {
    display: grid;
    gap: 16px;
}

.superadmin-ai-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.superadmin-ai-stats article {
    align-items: center;
    display: flex;
    gap: 16px;
    min-height: 104px;
    padding: 20px;
}

.superadmin-ai-stat-icon {
    align-items: center;
    border-radius: var(--radius);
    display: inline-flex;
    flex: 0 0 auto;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.superadmin-ai-stats small {
    color: var(--text-secondary);
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.superadmin-ai-stats strong {
    color: var(--text);
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
}

.superadmin-ai-table-header,
.superadmin-subscriptions-card-title {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 20px;
}

.superadmin-ai-table-header h2,
.superadmin-subscriptions-card-title h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0;
}

.superadmin-ai-table-header h2 span,
.superadmin-subscriptions-card-title h2 span {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.superadmin-ai-table,
.superadmin-subscriptions-table {
    border-collapse: collapse;
    min-width: 1320px;
    width: 100%;
}

.superadmin-ai-table th,
.superadmin-ai-table td,
.superadmin-subscriptions-table th,
.superadmin-subscriptions-table td {
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

.superadmin-ai-table th,
.superadmin-subscriptions-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-transform: uppercase;
}

.superadmin-ai-status,
.superadmin-subscriptions-plan,
.superadmin-subscriptions-status,
.superadmin-subscriptions-payment {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    min-height: 22px;
    padding: 0 8px;
    white-space: nowrap;
}

.superadmin-subscriptions-plan {
    background: var(--primary-light);
    color: var(--primary);
}

.superadmin-subscriptions-status--active {
    background: var(--success-soft);
    color: var(--success);
}

.superadmin-subscriptions-status--paused,
.superadmin-subscriptions-status--past_due,
.superadmin-subscriptions-status--trialing {
    background: var(--warning-soft);
    color: var(--warning);
}

.superadmin-subscriptions-status--cancelled,
.superadmin-subscriptions-status--canceled,
.superadmin-subscriptions-status--inactive {
    background: var(--danger-soft);
    color: var(--danger);
}

.superadmin-subscriptions-payment {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.superadmin-subscriptions-org-link,
.superadmin-ai-stats a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.superadmin-subscriptions-table-wrap,
.superadmin-ai-table-wrap {
    overflow-x: auto;
}

.superadmin-ai-expand-cell,
.superadmin-subscriptions-table td:last-child {
    width: 56px;
}

.superadmin-ai-expand-cell details summary,
.superadmin-ai-actions-menu summary,
.superadmin-subscriptions-actions .row-actions-toggle {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    list-style: none;
    width: 28px;
}

.superadmin-ai-expand-cell details summary::-webkit-details-marker,
.superadmin-ai-actions-menu summary::-webkit-details-marker {
    display: none;
}

.superadmin-ai-expand-cell details > div,
.superadmin-ai-actions-menu > div,
.superadmin-subscriptions-actions .row-actions-dropdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 8px;
}

.superadmin-ai-pagination,
.superadmin-subscriptions-pagination {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px 20px;
}

.superadmin-ai-pagination nav,
.superadmin-subscriptions-pagination div {
    display: flex;
    gap: 8px;
}

.superadmin-ai-pagination nav a,
.superadmin-ai-pagination nav span,
.superadmin-subscriptions-pagination button {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    padding: 0 10px;
    text-decoration: none;
}

.superadmin-ai-pagination nav a.is-active,
.superadmin-subscriptions-pagination button.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
}

.superadmin-subscriptions-more-filters {
    border-top: 1px solid var(--border);
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    padding-top: 16px;
}

.superadmin-subscriptions-detail-panel {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 20px;
}

.superadmin-subscriptions-detail-panel h3 {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
}

.superadmin-subscriptions-detail-panel dl,
.superadmin-subscriptions-detail-panel p {
    display: grid;
    gap: 10px;
    margin: 0;
}

.superadmin-subscriptions-detail-panel dt {
    color: var(--text-secondary);
    font-size: 12px;
}

.superadmin-subscriptions-detail-panel dd {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.superadmin-subscriptions-edit-form {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.superadmin-subscriptions-edit-form button {
    grid-column: 1 / -1;
    justify-self: start;
}

.superadmin-subscriptions-tip {
    align-items: center;
    display: flex;
    gap: 12px;
    padding: 16px 20px;
}

.superadmin-subscriptions-tip svg {
    height: 16px;
    stroke: currentColor;
    width: 16px;
}

@media (max-width: 1180px) {
    .superadmin-ai-filter-form,
    .superadmin-ai-stats,
    .superadmin-subscriptions-filter-card,
    .superadmin-subscriptions-detail-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .superadmin-ai-date,
    .superadmin-ai-request,
    .superadmin-ai-filter-actions,
    .superadmin-subscriptions-filter-actions {
        grid-column: span 1;
    }
}

@media (max-width: 760px) {
    .app-content:has(> .superadmin-ai-page),
    .app-content:has(> .superadmin-subscriptions-page) {
        padding: 20px 16px 32px;
    }

    .superadmin-ai-header,
    .superadmin-ai-table-header,
    .superadmin-ai-pagination,
    .superadmin-subscriptions-header,
    .superadmin-subscriptions-card-title,
    .superadmin-subscriptions-pagination,
    .superadmin-subscriptions-tip {
        align-items: stretch;
        flex-direction: column;
    }

    .superadmin-ai-actions,
    .superadmin-ai-filter-actions,
    .superadmin-subscriptions-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .superadmin-ai-filter-form,
    .superadmin-ai-stats,
    .superadmin-subscriptions-filter-card,
    .superadmin-subscriptions-more-filters,
    .superadmin-subscriptions-detail-panel,
    .superadmin-subscriptions-edit-form {
        grid-template-columns: 1fr;
    }

    .superadmin-ai-button,
    .superadmin-ai-actions form,
    .superadmin-ai-show-form,
    .superadmin-ai-show-form .form-control,
    .superadmin-subscriptions-filter-button,
    .superadmin-subscriptions-export {
        width: 100%;
    }

    .superadmin-ai-date-control {
        grid-template-columns: 16px 1fr;
    }

    .superadmin-ai-date-control > span {
        display: none;
    }
}

.superadmin-theme .superadmin-subscriptions-page .superadmin-subscriptions-header h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.superadmin-theme .superadmin-subscriptions-page .superadmin-subscriptions-card-title h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.superadmin-theme .superadmin-subscriptions-page .superadmin-subscriptions-table th {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.superadmin-theme .superadmin-subscriptions-page .superadmin-subscriptions-actions .row-actions-toggle {
    height: 28px;
    min-height: 28px;
    padding: 0;
    width: 28px;
}

/* === Dark Mode Scheme Alignment ============================================ */
html[data-theme="dark"] .btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

html[data-theme="dark"] .btn-secondary:hover:not(:disabled),
html[data-theme="dark"] .btn-secondary:focus-visible {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--primary);
}

html[data-theme="dark"] .accordion-item--open {
    background: var(--surface);
}

html[data-theme="dark"] .accordion-item--complete {
    background: rgba(52, 211, 153, 0.14);
    border-color: rgba(52, 211, 153, 0.34);
}

html[data-theme="dark"] .accordion-header:hover {
    background: var(--surface-hover);
}

html[data-theme="dark"] .topbar-threepoints-logo {
    filter: invert(1) grayscale(1) brightness(1.55) contrast(0.95);
    opacity: 0.92;
}

html[data-theme="dark"] .work-items-page {
    --wi-blue: rgb(147 197 253);
    --wi-blue-bg: rgba(96, 165, 250, 0.16);
    --wi-border: var(--border);
    --wi-border-strong: var(--border);
    --wi-border-soft: var(--border);
    --wi-control-border: var(--border);
    --wi-green-bg: rgba(52, 211, 153, 0.16);
    --wi-ink: var(--text);
    --wi-muted: var(--text-muted);
    --wi-orange-bg: rgba(251, 191, 36, 0.16);
    --wi-primary-dark: rgb(199 210 254);
    --wi-secondary-bg: rgba(148, 163, 184, 0.16);
    --wi-slate: var(--text);
    --wi-surface-soft: var(--bg-secondary);
    --wi-warning-bg: rgba(251, 191, 36, 0.14);
    --wi-warning-border: rgba(251, 191, 36, 0.34);
}

html[data-theme="dark"] .work-items-panel,
html[data-theme="dark"] .work-items-generation-panel,
html[data-theme="dark"] .work-items-table-panel,
html[data-theme="dark"] .work-items-okr-link,
html[data-theme="dark"] .work-items-coverage-metric,
html[data-theme="dark"] .work-items-filter-select,
html[data-theme="dark"] .work-items-show-select,
html[data-theme="dark"] .work-items-search,
html[data-theme="dark"] .work-items-filter-button,
html[data-theme="dark"] .work-items-page-arrow,
html[data-theme="dark"] .work-items-page-number {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: none;
}

html[data-theme="dark"] .work-items-okr-link:hover,
html[data-theme="dark"] .work-items-table-row:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

html[data-theme="dark"] .work-items-table__head {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-muted);
}

html[data-theme="dark"] .work-items-table-row-details,
html[data-theme="dark"] .work-items-table-toolbar,
html[data-theme="dark"] .work-items-table-footer,
html[data-theme="dark"] .work-items-okr-links,
html[data-theme="dark"] .work-items-okr-link .roadmap-coverage__node-details {
    border-color: var(--border);
}

html[data-theme="dark"] .work-items-search input {
    background: transparent;
    color: var(--text);
}

html[data-theme="dark"] .work-items-search input::placeholder {
    color: var(--text-muted);
}

html[data-theme="dark"] .work-items-coverage-metric .roadmap-coverage__metric-value,
html[data-theme="dark"] .work-items-okr-link__title,
html[data-theme="dark"] .work-items-row-main strong,
html[data-theme="dark"] .work-items-table-row .row-actions-toggle {
    color: var(--text);
}

html[data-theme="dark"] .work-items-coverage-metric .roadmap-coverage__metric-label,
html[data-theme="dark"] .work-items-okr-link__subtitle,
html[data-theme="dark"] .work-items-okr-link__linked-count,
html[data-theme="dark"] .work-items-row-main .work-item-desc-preview,
html[data-theme="dark"] .work-items-row-owner,
html[data-theme="dark"] .work-items-row-updated,
html[data-theme="dark"] .work-items-table-footer,
html[data-theme="dark"] .work-items-table-toolbar__right {
    color: var(--text-muted);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .app-content {
    background: var(--bg);
    color: var(--text);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .success-card,
html[data-theme="dark"] .alert-card,
html[data-theme="dark"] .governance-item,
html[data-theme="dark"] .baseline-table {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: none;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] thead th,
html[data-theme="dark"] .baseline-table th {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-muted);
}

html[data-theme="dark"] tbody td,
html[data-theme="dark"] .baseline-table td,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .dropdown-divider {
    border-color: var(--border);
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .project-card:hover,
html[data-theme="dark"] .dropdown-menu a:hover,
html[data-theme="dark"] .dropdown-menu button:hover {
    background: var(--surface-hover);
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input:not([type]),
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-control {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted);
}

html[data-theme="dark"] .badge-primary,
html[data-theme="dark"] .badge-info {
    background: var(--primary-light);
    color: rgb(199 210 254);
}

html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .status-active,
html[data-theme="dark"] .status-completed,
html[data-theme="dark"] .flash-message--success,
html[data-theme="dark"] .flash-message.success,
html[data-theme="dark"] .flash-message:not(.error):not(.success) {
    background: var(--success-light);
    border-color: rgba(52, 211, 153, 0.34);
    color: var(--success-dark);
}

html[data-theme="dark"] .badge-warning,
html[data-theme="dark"] .status-draft {
    background: var(--warning-light);
    color: var(--warning-dark);
}

html[data-theme="dark"] .badge-danger,
html[data-theme="dark"] .badge-critical,
html[data-theme="dark"] .flash-message--error,
html[data-theme="dark"] .flash-message.error {
    background: var(--danger-light);
    border-color: rgba(248, 113, 113, 0.34);
    color: var(--danger-dark);
}

html[data-theme="dark"] .badge-secondary {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
}

html[data-theme="dark"] .success-next-steps,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .project-date,
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .text-muted {
    color: var(--text-muted);
}
/* === Modal Spec Pass 2: AI review and token modals ======================= */
.sounding-board-modal__shell,
.board-review-modal__shell {
    border-radius: 12px;
    max-height: calc(100dvh - 48px);
    max-width: min(920px, calc(100vw - 48px));
    width: 100%;
}

.sounding-board-modal__shell .modal-header,
.board-review-modal__shell .modal-header,
.developer-token-modal .modal-header {
    padding: 24px 28px 16px;
}

.sounding-board-modal__shell .modal-body,
.board-review-modal__shell .modal-body,
.developer-token-modal .modal-body {
    padding: 16px 28px 24px;
}

.sounding-board-modal__shell .modal-footer,
.board-review-modal__shell .modal-footer,
.developer-token-modal .modal-footer {
    padding: 16px 28px;
}

.sb-config,
.br-config {
    flex: 1;
    min-height: 0;
}

.sb-config-grid {
    gap: 16px 24px;
}

.sb-config .form-group,
.br-config .form-group {
    margin-bottom: 0;
}

.sb-config .form-group label,
.br-config .form-group label {
    color: var(--text);
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 8px;
}

.sb-modal-footer,
.br-modal-footer {
    padding-inline: 28px;
}

.developer-token-modal {
    border-radius: 12px;
    max-width: min(760px, calc(100vw - 48px));
    width: 100%;
}

.developer-token-modal .modal-body {
    display: grid;
    gap: 8px;
}

@media (max-width: 720px) {
    .sounding-board-modal__shell,
    .board-review-modal__shell,
    .developer-token-modal {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
    }

    .sounding-board-modal__shell .modal-header,
    .sounding-board-modal__shell .modal-body,
    .sounding-board-modal__shell .modal-footer,
    .board-review-modal__shell .modal-header,
    .board-review-modal__shell .modal-body,
    .board-review-modal__shell .modal-footer,
    .developer-token-modal .modal-header,
    .developer-token-modal .modal-body,
    .developer-token-modal .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* === Modal Spec Pass 3: Billing and persona prompt modals =============== */
.billing-topup-modal,
.default-personas-level-modal {
    border-radius: 12px;
    max-height: calc(100dvh - 48px);
    width: 100%;
}

.billing-topup-modal {
    max-width: min(760px, calc(100vw - 48px));
}

.billing-confirmation-modal {
    border-radius: 8px;
    max-height: calc(100dvh - 48px);
    max-width: min(560px, calc(100vw - 48px));
    width: 100%;
}

.default-personas-level-modal {
    max-width: min(920px, calc(100vw - 48px));
}

.billing-topup-modal .modal-header,
.billing-confirmation-modal .modal-header,
.default-personas-level-modal .modal-header {
    padding: 24px 28px 16px;
}

.billing-topup-modal .modal-body,
.billing-confirmation-modal .modal-body,
.default-personas-level-modal .modal-body {
    padding: 16px 28px 24px;
}

.billing-topup-modal .modal-footer,
.billing-confirmation-modal .modal-footer,
.default-personas-level-modal .modal-footer {
    padding: 16px 28px;
}

.default-personas-level-modal .modal-body {
    display: grid;
    gap: 16px;
}

.default-personas-level-modal .default-personas-field--modal {
    margin: 0;
}

.default-personas-level-modal .persona-level-help {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.default-personas-level-modal .modal-footer {
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .billing-topup-modal,
    .billing-confirmation-modal,
    .default-personas-level-modal {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
    }

    .billing-topup-modal .modal-header,
    .billing-topup-modal .modal-body,
    .billing-topup-modal .modal-footer,
    .billing-confirmation-modal .modal-header,
    .billing-confirmation-modal .modal-body,
    .billing-confirmation-modal .modal-footer,
    .default-personas-level-modal .modal-header,
    .default-personas-level-modal .modal-body,
    .default-personas-level-modal .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* === Modal Spec Pass 4: Roadmap and risk modals ========================= */
.mermaid-editor-modal,
.roadmap-okr-modal,
.risk-modal {
    border-radius: 12px;
    max-height: calc(100dvh - 48px);
    width: 100%;
}

.mermaid-editor-modal {
    max-width: min(1180px, calc(100vw - 48px));
}

.roadmap-okr-modal,
.risk-modal {
    max-width: min(920px, calc(100vw - 48px));
}

.mermaid-editor-modal .modal-header {
    padding: 24px 32px 16px;
}

.mermaid-editor-modal .modal-body {
    gap: 16px;
    padding: 16px 32px 24px;
}

.mermaid-editor-modal .modal-footer {
    padding: 16px 32px;
}

.roadmap-okr-modal .modal-header,
.risk-modal .modal-header {
    padding: 24px 28px 16px;
}

.roadmap-okr-modal .modal-body,
.risk-modal .modal-body {
    padding: 16px 28px 24px;
}

.roadmap-okr-modal .modal-footer,
.risk-modal .modal-footer {
    padding: 16px 28px;
}

.roadmap-code-editor {
    border-color: var(--border);
}

.roadmap-code-line-numbers,
.mermaid-editor-modal__textarea {
    font-size: 13px;
    line-height: 1.5;
}

.roadmap-field-hint,
.risk-modal .form-helper {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 8px 0 0;
}

@media (max-width: 720px) {
    .mermaid-editor-modal,
    .roadmap-okr-modal,
    .risk-modal {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
    }

    .mermaid-editor-modal .modal-header,
    .mermaid-editor-modal .modal-body,
    .mermaid-editor-modal .modal-footer,
    .roadmap-okr-modal .modal-header,
    .roadmap-okr-modal .modal-body,
    .roadmap-okr-modal .modal-footer,
    .risk-modal .modal-header,
    .risk-modal .modal-body,
    .risk-modal .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
.mermaid-editor-modal .modal-footer .btn,
.roadmap-okr-modal .modal-footer .btn,
.risk-modal .modal-footer .btn {
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
}

/* === Modal Spec Pass 5: Delivery workflow modals ======================== */
.wi-modal,
.story-modal,
.sprints-story-details-card {
    border-radius: 12px;
    max-height: calc(100dvh - 48px);
    width: 100%;
}

.wi-modal {
    max-width: min(1200px, calc(100vw - 48px));
}

.story-modal {
    max-width: min(1120px, calc(100vw - 48px));
}

.sprints-story-details-card {
    max-width: min(760px, calc(100vw - 48px));
}

.wi-modal .modal-header,
.story-modal .modal-header {
    padding: 24px 32px 16px;
}

.wi-modal-body,
.story-modal-body {
    gap: 16px 24px;
    padding: 16px 32px 24px;
}

.wi-modal .modal-footer,
.story-modal .modal-footer {
    padding: 16px 32px;
}

.sprints-story-details-card .modal-header {
    padding: 24px 28px 16px;
}

.sprints-story-details-card .modal-body {
    padding: 16px 28px 24px;
}

.wi-modal .modal-footer .btn,
.story-modal .modal-footer .btn {
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
}

.wi-modal-helper,
.story-modal-helper {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 8px 0 0;
}

.sprints-story-details-description,
.sprints-story-details-meta,
.sprints-story-details-section {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .wi-modal,
    .story-modal,
    .sprints-story-details-card {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
    }

    .wi-modal .modal-header,
    .wi-modal-body,
    .wi-modal .modal-footer,
    .story-modal .modal-header,
    .story-modal-body,
    .story-modal .modal-footer,
    .sprints-story-details-card .modal-header,
    .sprints-story-details-card .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* === Modal Spec Pass 6: Team and report scheduling modals ============== */
.report-schedule-modal,
.team-management-dialog__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 48px);
    max-width: min(760px, calc(100vw - 48px));
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.report-schedule-modal .modal-header,
.team-management-dialog__header {
    align-items: flex-start;
    border-bottom: 0;
    display: flex;
    gap: 16px;
    padding: 24px 28px 16px;
}

.report-schedule-modal .modal-header__icon,
.team-management-dialog__icon {
    align-items: center;
    background: var(--primary-light);
    border-radius: 8px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 44px;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.report-schedule-modal .modal-header__icon svg,
.team-management-dialog__icon svg {
    height: 20px;
    width: 20px;
}

.report-schedule-modal .modal-title,
.team-management-dialog__header h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.report-schedule-modal .modal-subtitle,
.team-management-dialog__header p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    margin: 4px 0 0;
}

.report-schedule-modal .modal-close,
.team-management-dialog__close {
    border-radius: 6px;
    flex: 0 0 32px;
    height: 32px;
    width: 32px;
}

.report-schedule-modal .modal-body,
.team-management-dialog__body {
    display: grid;
    flex: 1;
    gap: 16px 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    overflow-y: auto;
    padding: 16px 28px 24px;
}

.team-management-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.team-management-form label {
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
}

.report-schedule-modal .modal-footer,
.team-management-dialog__footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin: 0;
    padding: 16px 28px;
    position: sticky;
}

.report-schedule-modal .modal-footer .btn,
.team-management-dialog__footer .team-management-button {
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
}

.report-schedule-modal .form-group {
    margin: 0;
}

.report-schedule-modal label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.report-schedule-modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.report-schedule-modal select,
.team-management-form input,
.team-management-form select {
    min-height: 40px;
    padding: 0 12px;
}

.report-schedule-modal textarea,
.team-management-form textarea {
    min-height: 112px;
    padding: 12px;
}

html[data-theme="dark"] .report-schedule-modal,
html[data-theme="dark"] .team-management-dialog__card,
html[data-theme="dark"] .report-schedule-modal .modal-footer,
html[data-theme="dark"] .team-management-dialog__footer {
    background: var(--surface);
}

@media (max-width: 720px) {
    .report-schedule-modal,
    .team-management-dialog__card {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
    }

    .report-schedule-modal .modal-header,
    .report-schedule-modal .modal-body,
    .report-schedule-modal .modal-footer,
    .team-management-dialog__header,
    .team-management-dialog__body,
    .team-management-dialog__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .report-schedule-modal .modal-body,
    .team-management-dialog__body {
        grid-template-columns: 1fr;
    }
}

/* === Modal Spec Pass 7: Wizard, sync preview, and sprint close modals ==== */
.onboarding-card,
.jira-sync-preview-card,
.sprint-close-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 48px);
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.onboarding-card,
.jira-sync-preview-card,
.sprint-close-modal {
    max-width: min(760px, calc(100vw - 48px));
}

.onboarding-card-body,
.jira-sync-preview-card .modal-body,
.sprint-close-modal .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 28px 24px;
}

.jira-sync-preview-card .modal-header,
.sprint-close-modal .modal-header {
    padding: 24px 28px 16px;
}

.jira-sync-preview-card .modal-title,
.sprint-close-modal .modal-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.jira-sync-preview-card .modal-subtitle,
.sprint-close-modal .modal-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.jira-sync-preview-card .modal-header__icon,
.sprint-close-modal .modal-header__icon {
    border-radius: 8px;
    flex-basis: 44px;
    height: 44px;
    width: 44px;
}

.jira-sync-preview-card .modal-header__icon svg,
.sprint-close-modal .modal-header__icon svg {
    height: 20px;
    width: 20px;
}

.jira-sync-preview-card .modal-close {
    border-radius: 6px;
    height: 32px;
    width: 32px;
}

.onboarding-nav,
.jira-sync-preview-card .modal-footer,
.sprint-close-modal .modal-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 28px;
    position: sticky;
}

.onboarding-nav {
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.onboarding-nav .btn,
.jira-sync-preview-card .modal-footer .btn,
.sprint-close-modal .modal-footer .btn {
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
}

.onboarding-title {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.onboarding-copy,
.onboarding-role-copy,
.jira-sync-preview-intro,
.jira-sync-preview-loading-text,
.sprint-close-modal .close-dialog-title {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.onboarding-list,
.onboarding-jira-list {
    gap: 8px;
}

.onboarding-list-item,
.jira-sync-preview-summary-card,
.sprint-close-modal .close-dialog-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.jira-sync-preview-card {
    margin: 0;
}

.jira-sync-preview-summary-grid {
    gap: 12px;
    margin-bottom: 16px;
}

.jira-sync-preview-summary-card {
    padding: 16px;
}

.jira-sync-preview-summary-card--push,
.jira-sync-preview-summary-card--pull {
    background: var(--bg-secondary);
}

.jira-sync-preview-summary-count {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.jira-sync-preview-summary-label,
.jira-sync-preview-section-summary {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.jira-sync-preview-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
}

.jira-sync-preview-list {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    max-height: 220px;
}

.sprint-close-modal .close-dialog-stories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sprint-close-modal .close-dialog-row {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    padding: 12px;
}

.sprint-close-modal select {
    min-height: 40px;
}

@media (max-width: 720px) {
    .onboarding-card,
    .jira-sync-preview-card,
    .sprint-close-modal {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
    }

    .onboarding-card-body,
    .onboarding-nav,
    .jira-sync-preview-card .modal-header,
    .jira-sync-preview-card .modal-body,
    .jira-sync-preview-card .modal-footer,
    .sprint-close-modal .modal-header,
    .sprint-close-modal .modal-body,
    .sprint-close-modal .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .onboarding-nav,
    .sprint-close-modal .close-dialog-row {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
}
/* === Dark Mode Surface Pass: executive, workflow pages, and modal footers === */
html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-content {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-xl);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-body {
    background: var(--surface);
}

html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .sounding-board-modal__shell .modal-footer,
html[data-theme="dark"] .board-review-modal__shell .modal-footer,
html[data-theme="dark"] .developer-token-modal .modal-footer,
html[data-theme="dark"] .billing-topup-modal .modal-footer,
html[data-theme="dark"] .billing-confirmation-modal .modal-footer,
html[data-theme="dark"] .default-personas-level-modal .modal-footer,
html[data-theme="dark"] .mermaid-editor-modal .modal-footer,
html[data-theme="dark"] .roadmap-okr-modal .modal-footer,
html[data-theme="dark"] .risk-modal .modal-footer,
html[data-theme="dark"] .wi-modal .modal-footer,
html[data-theme="dark"] .story-modal .modal-footer,
html[data-theme="dark"] .report-schedule-modal .modal-footer,
html[data-theme="dark"] .team-management-dialog__footer,
html[data-theme="dark"] .jira-sync-preview-card .modal-footer,
html[data-theme="dark"] .sprint-close-modal .modal-footer {
    background: var(--surface-2);
    border-top-color: var(--border);
}

html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .modal-header h2,
html[data-theme="dark"] .modal-header h3,
html[data-theme="dark"] .modal label {
    color: var(--text);
}

html[data-theme="dark"] .modal-subtitle,
html[data-theme="dark"] .modal-helper,
html[data-theme="dark"] .form-helper,
html[data-theme="dark"] .modal-detail,
html[data-theme="dark"] .modal-summary-note {
    color: var(--text-muted);
}

html[data-theme="dark"] .modal-header__icon {
    background: var(--primary-light);
    color: var(--primary);
}

html[data-theme="dark"] .modal-close {
    color: var(--text-muted);
}

html[data-theme="dark"] .modal-close:hover {
    background: var(--surface-hover);
    color: var(--text);
}

html[data-theme="dark"] .modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .modal select,
html[data-theme="dark"] .modal textarea,
html[data-theme="dark"] .modal-content input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .modal-content select,
html[data-theme="dark"] .modal-content textarea {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .modal input::placeholder,
html[data-theme="dark"] .modal textarea::placeholder,
html[data-theme="dark"] .modal-content input::placeholder,
html[data-theme="dark"] .modal-content textarea::placeholder {
    color: var(--text-muted);
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .executive-action-button--secondary,
html[data-theme="dark"] .executive-small-button--secondary,
html[data-theme="dark"] .governance-button--secondary,
html[data-theme="dark"] .governance-small-button--secondary,
html[data-theme="dark"] .governance-footer-button--secondary,
html[data-theme="dark"] .sprints-page__actions .btn-sm,
html[data-theme="dark"] .sprints-action:not(.sprints-action--primary) {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .btn-secondary:hover:not(:disabled),
html[data-theme="dark"] .btn-secondary:focus-visible,
html[data-theme="dark"] .executive-action-button--secondary:hover,
html[data-theme="dark"] .executive-small-button--secondary:hover,
html[data-theme="dark"] .governance-button--secondary:hover,
html[data-theme="dark"] .governance-small-button--secondary:hover,
html[data-theme="dark"] .governance-footer-button--secondary:hover,
html[data-theme="dark"] .sprints-page__actions .btn-sm:hover,
html[data-theme="dark"] .sprints-action:not(.sprints-action--primary):hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--text);
}

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] .governance-button[aria-disabled="true"] {
    opacity: 0.58;
}

html[data-theme="dark"] .executive-dashboard-page,
html[data-theme="dark"] .executive-dashboard-title,
html[data-theme="dark"] .executive-metric-value,
html[data-theme="dark"] .executive-panel-title,
html[data-theme="dark"] .executive-review-copy,
html[data-theme="dark"] .executive-review-title,
html[data-theme="dark"] .executive-okr-title,
html[data-theme="dark"] .executive-risk-title,
html[data-theme="dark"] .executive-highlight h3,
html[data-theme="dark"] .executive-percent,
html[data-theme="dark"] .executive-okr-kr strong,
html[data-theme="dark"] .executive-sprint-title-block h3,
html[data-theme="dark"] .executive-sprint-stats dd,
html[data-theme="dark"] .executive-sprint-stats dd strong {
    color: var(--text);
}

html[data-theme="dark"] .executive-dashboard-subtitle,
html[data-theme="dark"] .executive-as-of,
html[data-theme="dark"] .executive-metric-label,
html[data-theme="dark"] .executive-metric-copy,
html[data-theme="dark"] .executive-metric-note,
html[data-theme="dark"] .executive-panel-meta,
html[data-theme="dark"] .executive-empty-state,
html[data-theme="dark"] .executive-review-meta,
html[data-theme="dark"] .executive-review-project,
html[data-theme="dark"] .executive-risk-context,
html[data-theme="dark"] .executive-highlight p,
html[data-theme="dark"] .executive-okr-description,
html[data-theme="dark"] .executive-sprint-title-block p,
html[data-theme="dark"] .executive-sprint-stats dt,
html[data-theme="dark"] .executive-sprint-axis,
html[data-theme="dark"] .executive-sprint-team-empty {
    color: var(--text-muted);
}

html[data-theme="dark"] .executive-info-dot .page-info-btn,
html[data-theme="dark"] .executive-okr-expand,
html[data-theme="dark"] .executive-sprint-filter select {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-muted);
}

html[data-theme="dark"] .executive-metric-card,
html[data-theme="dark"] .executive-panel {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: none;
}

html[data-theme="dark"] .executive-review-card,
html[data-theme="dark"] .executive-okr-row,
html[data-theme="dark"] .executive-risk-row,
html[data-theme="dark"] .executive-okr-kr {
    background: var(--surface-2);
    border-color: var(--border);
}

html[data-theme="dark"] .executive-review-card {
    border-color: rgba(248, 113, 113, 0.36);
    border-left-color: var(--danger);
}

html[data-theme="dark"] .executive-okr-list,
html[data-theme="dark"] .executive-risk-list,
html[data-theme="dark"] .executive-okr-details,
html[data-theme="dark"] .executive-sprint-stats {
    border-color: var(--border);
}

html[data-theme="dark"] .executive-sprint-avatar {
    border-color: var(--surface);
}

html[data-theme="dark"] .executive-sprint-area {
    fill: rgba(129, 140, 248, 0.22);
}

html[data-theme="dark"] .executive-sprint-actual,
html[data-theme="dark"] .executive-sprint-point {
    stroke: rgb(129, 140, 248);
    fill: rgb(129, 140, 248);
}

html[data-theme="dark"] .executive-sprint-ideal,
html[data-theme="dark"] .executive-sprint-gridline {
    stroke: var(--text-muted);
}
html[data-theme="dark"] .executive-meter-progress,
html[data-theme="dark"] .executive-bar-progress,
html[data-theme="dark"] .executive-meter-progress::-webkit-progress-bar,
html[data-theme="dark"] .executive-bar-progress::-webkit-progress-bar {
    background: var(--border);
}

html[data-theme="dark"] .executive-risk-ref,
html[data-theme="dark"] .executive-okr-detail-summary span {
    background: var(--primary-light);
    color: var(--primary-hover);
}

html[data-theme="dark"] .executive-status-pill--amber,
html[data-theme="dark"] .executive-risk-badge--medium {
    background: rgba(251, 191, 36, 0.16);
    color: rgb(253 224 71);
}

html[data-theme="dark"] .executive-risk-badge--high {
    background: rgba(248, 113, 113, 0.16);
    color: rgb(252 165 165);
}

html[data-theme="dark"] .executive-risk-badge--low {
    background: rgba(52, 211, 153, 0.16);
    color: rgb(110 231 183);
}

html[data-theme="dark"] .executive-metric-card--green .executive-metric-icon,
html[data-theme="dark"] .executive-highlight--green > span {
    background: rgba(52, 211, 153, 0.16);
    color: rgb(110 231 183);
}

html[data-theme="dark"] .executive-metric-card--red .executive-metric-icon {
    background: rgba(248, 113, 113, 0.16);
    color: rgb(252 165 165);
}

html[data-theme="dark"] .executive-metric-card--amber .executive-metric-icon,
html[data-theme="dark"] .executive-highlight--amber > span {
    background: rgba(251, 191, 36, 0.16);
    color: rgb(253 224 71);
}

html[data-theme="dark"] .executive-metric-card--blue .executive-metric-icon,
html[data-theme="dark"] .executive-highlight--blue > span {
    background: rgba(96, 165, 250, 0.16);
    color: rgb(147 197 253);
}

html[data-theme="dark"] .executive-highlight--purple > span {
    background: var(--primary-light);
    color: var(--primary-hover);
}

html[data-theme="dark"] .governance-summary-card__label,
html[data-theme="dark"] .governance-history-table th,
html[data-theme="dark"] .governance-icon-button,
html[data-theme="dark"] .governance-reviewer > span,
html[data-theme="dark"] .sprints-field,
html[data-theme="dark"] .sprints-backlog-filter-field,
html[data-theme="dark"] .sprints-select-wrap svg,
html[data-theme="dark"] .sprints-input-icon svg {
    color: var(--text-muted);
}

html[data-theme="dark"] .governance-summary-card a,
html[data-theme="dark"] .governance-section-link,
html[data-theme="dark"] .executive-card-link,
html[data-theme="dark"] .executive-section-link {
    color: var(--primary-hover);
}

html[data-theme="dark"] .sprints-field input,
html[data-theme="dark"] .sprints-field select,
html[data-theme="dark"] .sprints-select-wrap,
html[data-theme="dark"] .sprints-input-icon,
html[data-theme="dark"] .sprints-backlog-filter-field input,
html[data-theme="dark"] .sprints-backlog-filter-field select {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .sprints-field input::placeholder,
html[data-theme="dark"] .sprints-backlog-filter-field input::placeholder {
    color: var(--text-muted);
}

html[data-theme="dark"] .sprints-select-wrap,
html[data-theme="dark"] .sprints-input-icon {
    box-shadow: inset 0 -1px 0 var(--border);
}

html[data-theme="dark"] .sprints-select-wrap:focus-within,
html[data-theme="dark"] .sprints-input-icon:focus-within {
    border-color: var(--primary);
    box-shadow: inset 0 -1px 0 var(--primary), 0 0 0 3px var(--primary-light);
}

html[data-theme="dark"] .sprints-create-submit,
html[data-theme="dark"] .sprints-action--primary,
html[data-theme="dark"] .executive-action-button--primary,
html[data-theme="dark"] .executive-small-button--primary {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: rgb(255 255 255);
}

html[data-theme="dark"] .sprints-create-submit:hover,
html[data-theme="dark"] .sprints-action--primary:hover,
html[data-theme="dark"] .executive-action-button--primary:hover,
html[data-theme="dark"] .executive-small-button--primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

html[data-theme="dark"] .risks-page__actions .btn-sm:not(.btn-primary),
html[data-theme="dark"] .risks-add-button {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .risks-page__actions .btn-sm:not(.btn-primary):hover,
html[data-theme="dark"] .risks-add-button:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--text);
}

.prioritisation-inline-info,
.prioritisation-page-info {
    display: inline-flex;
    position: relative;
}

.prioritisation-inline-info .page-info-btn {
    font-size: 12px;
    height: 16px;
    width: 16px;
}

.prioritisation-inline-info .page-info-popover,
.prioritisation-page-info .page-info-popover {
    white-space: normal;
    z-index: 20;
}

/* Executive dashboard visual summary */
.executive-summary-board {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1.15fr 0.95fr;
    overflow: hidden;
    border: 1px solid rgb(226, 232, 240);
    border-radius: 8px;
    background: rgb(255, 255, 255);
}

.executive-summary-cell {
    min-height: 220px;
    padding: 22px 28px;
}

.executive-summary-cell + .executive-summary-cell {
    border-left: 1px solid rgb(226, 232, 240);
}

.executive-summary-title {
    margin: 0 0 18px;
    color: rgb(15, 23, 42);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.executive-progress-summary,
.executive-risk-summary,
.executive-reviews-summary {
    display: flex;
    align-items: center;
    gap: 22px;
}

.executive-summary-value {
    margin: 0;
    color: rgb(15, 23, 42);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.executive-summary-copy {
    margin: 6px 0 0;
    color: rgb(71, 85, 105);
    font-size: 14px;
    line-height: 1.35;
}

.executive-donut {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 999px;
}

.executive-donut::after {
    position: absolute;
    inset: 18px;
    content: "";
    border-radius: 999px;
    background: rgb(255, 255, 255);
}

.executive-donut > span {
    position: relative;
    z-index: 1;
    color: rgb(71, 85, 105);
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
}

.executive-donut > span strong {
    display: block;
    color: rgb(15, 23, 42);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.executive-donut--progress {
    background: rgb(255, 255, 255);
}

.executive-donut--risk {
    width: 122px;
    height: 122px;
    background: rgb(255, 255, 255);
}

.executive-donut--risk::after {
    inset: 22px;
}

.executive-status-legend {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 18px;
    margin-top: 26px;
}

.executive-status-legend span {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    color: rgb(51, 65, 85);
    font-size: 12px;
    line-height: 1.25;
}

.executive-status-legend strong {
    grid-column: 2;
    color: rgb(15, 23, 42);
    font-weight: 700;
}

.executive-dot--muted {
    background: rgb(226, 232, 240);
}

.executive-status-chart {
    display: grid;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    align-items: end;
    gap: 18px;
    min-height: 150px;
    padding: 8px 6px 0;
    background: rgb(255, 255, 255);
}

.executive-status-bar {
    display: grid;
    grid-template-rows: 20px 92px 22px;
    justify-items: center;
    gap: 6px;
    min-width: 0;
}

.executive-status-count,
.executive-status-label {
    color: rgb(71, 85, 105);
    font-size: 12px;
    line-height: 1.25;
}

.executive-status-track {
    display: flex;
    align-items: end;
    justify-content: center;
    width: 58px;
    height: 92px;
}

.executive-status-track i {
    display: block;
    width: 100%;
    min-height: 2px;
    border-radius: 6px;
    background: rgb(91, 82, 240);
}

.executive-risk-breakdown {
    display: grid;
    gap: 16px;
    min-width: 180px;
    margin: 0;
}

.executive-risk-breakdown div {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.executive-risk-breakdown dt,
.executive-risk-breakdown dd {
    margin: 0;
    color: rgb(51, 65, 85);
    font-size: 14px;
    line-height: 1.25;
}

.executive-risk-breakdown dt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.executive-risk-breakdown dd {
    color: rgb(15, 23, 42);
    font-weight: 700;
    text-align: right;
}

.executive-reviews-summary {
    min-height: 132px;
    justify-content: center;
}

.executive-reviews-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgb(199, 210, 254);
    border-radius: 999px;
    color: rgb(79, 70, 229);
    background: rgb(238, 242, 255);
}

.executive-reviews-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.executive-attention-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    margin-top: 18px;
    padding: 0 18px;
    border-radius: 999px;
    color: rgb(180, 83, 9);
    background: rgb(254, 243, 199);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 1280px) {
    .executive-summary-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .executive-summary-cell:nth-child(3) {
        border-left: 0;
        border-top: 1px solid rgb(226, 232, 240);
    }

    .executive-summary-cell:nth-child(4) {
        border-top: 1px solid rgb(226, 232, 240);
    }
}

@media (max-width: 900px) {
    .executive-summary-board {
        grid-template-columns: 1fr;
    }

    .executive-summary-cell + .executive-summary-cell,
    .executive-summary-cell:nth-child(3),
    .executive-summary-cell:nth-child(4) {
        border-left: 0;
        border-top: 1px solid rgb(226, 232, 240);
    }

    .executive-progress-summary,
    .executive-risk-summary,
    .executive-reviews-summary {
        align-items: flex-start;
        justify-content: flex-start;
    }
}


.executive-donut svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.executive-donut circle {
    fill: none;
    stroke-width: 7;
}

.executive-donut-track {
    stroke: rgb(148, 163, 184);
}

.executive-donut-value {
    stroke: rgb(79, 70, 229);
}

.executive-donut-risk-high {
    stroke: rgb(244, 63, 94);
}

.executive-donut-risk-medium {
    stroke: rgb(245, 158, 11);
}

.executive-donut-risk-low {
    stroke: rgb(16, 185, 129);
}

.executive-status-track progress {
    display: block;
    width: 58px;
    height: 92px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
}

.executive-status-track progress::-webkit-progress-bar {
    border-radius: 6px;
    background: transparent;
}

.executive-status-track progress::-webkit-progress-value {
    border-radius: 6px;
    background: rgb(91, 82, 240);
}

.executive-status-track progress::-moz-progress-bar {
    border-radius: 6px;
    background: rgb(91, 82, 240);
}


html[data-theme="dark"] .executive-summary-board,
html[data-theme="dark"] .executive-summary-cell,
html[data-theme="dark"] .executive-donut::after {
    background: var(--surface);
}

html[data-theme="dark"] .executive-summary-board,
html[data-theme="dark"] .executive-summary-cell + .executive-summary-cell,
html[data-theme="dark"] .executive-summary-cell:nth-child(3),
html[data-theme="dark"] .executive-summary-cell:nth-child(4) {
    border-color: var(--border);
}

html[data-theme="dark"] .executive-summary-title,
html[data-theme="dark"] .executive-summary-value,
html[data-theme="dark"] .executive-donut > span strong,
html[data-theme="dark"] .executive-status-legend strong,
html[data-theme="dark"] .executive-risk-breakdown dd {
    color: var(--text);
}

html[data-theme="dark"] .executive-summary-copy,
html[data-theme="dark"] .executive-status-legend span,
html[data-theme="dark"] .executive-status-count,
html[data-theme="dark"] .executive-status-label,
html[data-theme="dark"] .executive-donut > span,
html[data-theme="dark"] .executive-risk-breakdown dt {
    color: var(--text-secondary);
}

html[data-theme="dark"] .executive-donut-track {
    stroke: var(--border);
}

html[data-theme="dark"] .executive-reviews-icon {
    border-color: rgba(129, 140, 248, 0.32);
    color: var(--primary);
    background: var(--primary-light);
}
