/* ============================================================
   Orbital V2 Theme — Override Stylesheet
   ============================================================
   Loaded after styles.css. Only active when html.theme-v2 is set.
   All selectors prefixed with .theme-v2 for higher specificity.
   V1 (styles.css) remains 100% intact — switch back anytime.

   Color palette: Forest green brand (#1B5E42) + cool gray system.
   DM Sans typography, merged with Atlassian Design System layout tokens.
   ============================================================ */


/* ============================================================
   V2-ONLY / V1-ONLY VISIBILITY TOGGLES
   ============================================================
   .v2-only — hidden by default, shown when .theme-v2 is active
   .v1-only — shown by default, hidden when .theme-v2 is active
   ============================================================ */
.v2-only { display: none !important; }
.theme-v2 .v2-only { display: block !important; }
.theme-v2 .v2-only-flex { display: flex !important; }
.theme-v2 .v2-only-grid { display: grid !important; }
.theme-v2 .v2-only-inline { display: inline !important; }
.theme-v2 .v2-only-inline-flex { display: inline-flex !important; }
.theme-v2 .v1-only { display: none !important; }


/* ============================================================
   V2 CSS CUSTOM PROPERTIES
   ============================================================ */
.theme-v2 {
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   V2 BREADCRUMB COMPONENT
   ============================================================ */
.theme-v2 .v2-breadcrumb {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 32px;
    font-size: 13px;
    color: var(--text-tertiary, #9CA3AF);
    margin: 0;
    background: var(--surface-default, #fff);
    border-bottom: 1px solid var(--border-default, #E5E7EB);
    position: sticky;
    top: 0;
    z-index: 50;
}

.theme-v2 .v2-breadcrumb a {
    color: var(--text-secondary, #6B7280);
    text-decoration: none;
    transition: color 0.15s;
    cursor: pointer;
}

.theme-v2 .v2-breadcrumb a:hover {
    color: var(--brand-primary, #1B5E42);
    text-decoration: underline;
}

.theme-v2 .v2-breadcrumb .separator {
    color: var(--text-tertiary, #9CA3AF);
    font-size: 12px;
    user-select: none;
}

.theme-v2 .v2-breadcrumb .current {
    color: var(--text-primary, #111827);
    font-weight: 500;
}

/* ============================================================
   V2 GLOBAL TOPBAR
   ============================================================ */
.theme-v2 .v2-topbar {
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 0;
    height: 44px;
    background: var(--surface-default, #FFFFFF);
    border-bottom: 1px solid var(--border-default, #E5E7EB);
    position: sticky;
    top: 0;
    z-index: 60;
    gap: 16px;
    flex-shrink: 0;
}

.theme-v2 .v2-topbar-left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* Breadcrumb inside topbar: reset its own sticky/border */
.theme-v2 .v2-topbar .v2-breadcrumb {
    position: static;
    border-bottom: none;
    background: transparent;
    z-index: auto;
    margin-bottom: 0;
}

.theme-v2 .v2-topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.theme-v2 .v2-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: none;
    border-radius: var(--radius-medium, 8px);
    background: transparent;
    color: var(--text-secondary, #6B7280);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.theme-v2 .v2-topbar-btn:hover {
    background: var(--surface-sunken, #F9FAFB);
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-topbar-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.theme-v2 .v2-topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary, #9CA3AF);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.theme-v2 .v2-topbar-icon-btn:hover {
    background: var(--surface-sunken, #F9FAFB);
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-topbar-icon-btn svg {
    width: 16px;
    height: 16px;
}

.theme-v2 .v2-topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-default, #E5E7EB);
    margin: 0 4px;
    flex-shrink: 0;
}

.theme-v2 .v2-topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-primary, #1B5E42);
    color: var(--text-inverse, #FFFFFF);
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
    font-family: inherit;
}

.theme-v2 .v2-topbar-avatar:hover {
    opacity: 0.85;
}

/* Topbar dropdown menus */
.theme-v2 .v2-topbar-dropdown {
    position: relative;
}

.theme-v2 .v2-topbar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.10);
    z-index: 300;
    padding: 4px 0;
    display: none;
}

.theme-v2 .v2-topbar-menu.open {
    display: block;
}

.theme-v2 .v2-topbar-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary, #111827);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
}

.theme-v2 .v2-topbar-menu-item:hover {
    background: var(--surface-sunken, #F9FAFB);
}

.theme-v2 .v2-topbar-menu-danger {
    color: var(--danger-text, #DC2626);
}

.theme-v2 .v2-topbar-menu-danger:hover {
    background: var(--danger-bg, #FEF2F2);
}

.theme-v2 .v2-topbar-menu-divider {
    height: 1px;
    background: var(--border-default, #E5E7EB);
    margin: 4px 0;
}

.theme-v2 .v2-topbar-menu-header {
    padding: 10px 14px 8px;
}

.theme-v2 .v2-topbar-menu-user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-topbar-menu-user-role {
    font-size: 11px;
    color: var(--text-tertiary, #9CA3AF);
    margin-top: 2px;
}

.theme-v2 .v2-topbar-menu-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary, #9CA3AF);
    flex-shrink: 0;
}

.theme-v2 .v2-topbar-menu-label {
    font-weight: 500;
    font-size: 13px;
}

/* Topbar responsive */
@media (max-width: 768px) {
    .theme-v2 .v2-topbar { padding: 0 12px 0 0; }
    .theme-v2 .v2-topbar-btn-label { display: none; }
}


/* ============================================================
   V2 ACTIONS MENU
   ============================================================ */
.theme-v2 .v2-actions-hamburger {
    position: relative;
    display: inline-flex;
}

.theme-v2 .v2-actions-trigger {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--brand-primary, #1B5E42);
    color: var(--text-inverse, #FFFFFF);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s;
}

.theme-v2 .v2-actions-trigger:hover {
    background: var(--brand-hover, #155237);
}

.theme-v2 .v2-actions-trigger svg {
    width: 16px;
    height: 16px;
}

.theme-v2 .v2-actions-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.10);
    z-index: 200;
    padding: 4px 0;
    display: none;
}

.theme-v2 .v2-actions-dropdown.open {
    display: block;
}

.theme-v2 .v2-actions-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: var(--text-primary, #111827);
    text-decoration: none;
}

.theme-v2 .v2-actions-item:hover {
    background: var(--surface-sunken, #F9FAFB);
}

.theme-v2 .v2-actions-item-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary, #9CA3AF);
    margin-top: 1px;
    flex-shrink: 0;
}

.theme-v2 .v2-actions-item:hover .v2-actions-item-icon {
    color: var(--brand-primary, #1B5E42);
}

.theme-v2 .v2-actions-item-text {
    flex: 1;
    min-width: 0;
}

.theme-v2 .v2-actions-item-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-actions-item-sublabel {
    font-size: 11px;
    color: var(--text-tertiary, #9CA3AF);
    margin-top: 1px;
}

.theme-v2 .v2-actions-item.danger .v2-actions-item-label,
.theme-v2 .v2-actions-item.danger .v2-actions-item-icon {
    color: var(--danger-text, #DC2626);
}

.theme-v2 .v2-actions-item.danger:hover {
    background: var(--danger-bg, #FEF2F2);
}

.theme-v2 .v2-actions-divider {
    height: 1px;
    background: var(--border-default, #E5E7EB);
    margin: 4px 0;
}


/* ============================================================
   V2 SUMMARY TILES — REDESIGNED (top-accent)
   Add .v2-tile-new to existing .v2-summary-card
   ============================================================ */
.theme-v2 .v2-summary-card.v2-tile-new {
    border-left: none;
    border-top: 2px solid;
    background: var(--surface-default, #FFFFFF) !important;
    padding: 16px 20px;
    border-radius: var(--radius-xlarge, 16px);
    box-shadow: var(--shadow-raised);
}

.theme-v2 .v2-tile-new .v2-summary-label {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-tertiary, #9CA3AF);
    margin-bottom: 10px;
}

.theme-v2 .v2-tile-new .v2-summary-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Accent dot + top border colors */
.theme-v2 .v2-tile-new.positive { border-top-color: #10b981; }
.theme-v2 .v2-tile-new.positive .v2-summary-label::before { background: #10b981; }
.theme-v2 .v2-tile-new.info { border-top-color: var(--brand-primary, #1B5E42); }
.theme-v2 .v2-tile-new.info .v2-summary-label::before { background: var(--brand-primary, #1B5E42); }
.theme-v2 .v2-tile-new.warning { border-top-color: #f59e0b; }
.theme-v2 .v2-tile-new.warning .v2-summary-label::before { background: #f59e0b; }
.theme-v2 .v2-tile-new.negative { border-top-color: #ef4444; }
.theme-v2 .v2-tile-new.negative .v2-summary-label::before { background: #ef4444; }
.theme-v2 .v2-tile-new.neutral { border-top-color: #d1d5db; }
.theme-v2 .v2-tile-new.neutral .v2-summary-label::before { background: #d1d5db; }
.theme-v2 .v2-tile-new.purple { border-top-color: #8b5cf6; }
.theme-v2 .v2-tile-new.purple .v2-summary-label::before { background: #8b5cf6; }

.theme-v2 .v2-tile-new .v2-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.theme-v2 .v2-tile-new .v2-summary-detail {
    font-size: 11px;
    color: var(--text-tertiary, #9CA3AF);
    margin-top: 6px;
    font-weight: 500;
}

/* ============================================================
   V2 BTW TOGGLE
   ============================================================ */
.theme-v2 .v2-btw-toggle {
    display: inline-flex;
    background: var(--surface-sunken, #F9FAFB);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.theme-v2 .v2-btw-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary, #64748b);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.theme-v2 .v2-btw-btn:hover {
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-btw-btn.active {
    background: white;
    color: var(--text-primary, #111827);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}


/* ============================================================
   V2 PAGE HEADER (with subtitle)
   ============================================================ */
.theme-v2 .v2-page-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.theme-v2 .v2-page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    line-height: 1.3;
}

.theme-v2 .v2-page-header .v2-subtitle {
    font-size: 14px;
    color: var(--text-secondary, #6B7280);
    margin-top: 4px;
}

.theme-v2 .v2-page-header .v2-btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}


/* ============================================================
   V2 FILTER BAR (Sticky)
   ============================================================ */
.theme-v2 .v2-filter-bar {
    display: block !important;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.theme-v2 .v2-filter-bar-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.theme-v2 .v2-filter-bar .v2-filter-group {
    flex: 1;
    min-width: 0;
}

.theme-v2 .v2-filter-bar .v2-filter-group.search-wide {
    flex: 1.5;
}

.theme-v2 .v2-filter-bar .v2-filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary, #9CA3AF);
    margin-bottom: 4px;
}

.theme-v2 .v2-filter-bar .v2-filter-group input,
.theme-v2 .v2-filter-bar .v2-filter-group select {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    background: var(--surface-default, #FFFFFF);
    color: var(--text-primary, #111827);
    box-sizing: border-box;
}

.theme-v2 .v2-filter-bar .v2-filter-group input:focus,
.theme-v2 .v2-filter-bar .v2-filter-group select:focus {
    outline: none;
    border-color: var(--brand-primary, #1B5E42);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

/* Search input with icon */
.theme-v2 .v2-search-wrap {
    position: relative;
}

.theme-v2 .v2-search-wrap svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-tertiary, #9CA3AF);
    pointer-events: none;
    z-index: 1;
}

.theme-v2 .v2-search-wrap input {
    padding-left: 32px !important;
}


/* ============================================================
   V2 DATE RANGE PICKER
   ============================================================ */
/* Wrapper — relative positioning for dropdown */
.theme-v2 .v2-dr-wrap {
    position: relative;
    display: inline-block;
}
/* Trigger button */
.theme-v2 .v2-dr-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    background: var(--surface-default, #FFFFFF);
    color: var(--text-primary, #111827);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}
.theme-v2 .v2-dr-trigger:hover {
    background: var(--surface-sunken, #F9FAFB);
    border-color: var(--text-tertiary, #9CA3AF);
}
.theme-v2 .v2-dr-trigger.open {
    border-color: var(--brand-primary, #1B5E42);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}
.theme-v2 .v2-dr-icon {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary, #9CA3AF);
    flex-shrink: 0;
}
.theme-v2 .v2-dr-label {
    color: var(--text-primary, #111827);
}
.theme-v2 .v2-dr-badge {
    background: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.4;
}
.theme-v2 .v2-dr-chevron {
    width: 10px;
    height: 10px;
    color: var(--text-tertiary, #9CA3AF);
    flex-shrink: 0;
    transition: transform 0.15s;
}
.theme-v2 .v2-dr-trigger.open .v2-dr-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel */
.theme-v2 .v2-dr-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 200;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 560px;
}
.theme-v2 .v2-dr-dropdown.open {
    display: flex;
}
.theme-v2 .v2-dr-dropdown.align-right {
    left: auto;
    right: 0;
}

/* Left: quick filters */
.theme-v2 .v2-dr-filters {
    width: 170px;
    border-right: 1px solid var(--border-default, #E5E7EB);
    padding: 6px 0;
    flex-shrink: 0;
}
.theme-v2 .v2-dr-filter-item {
    display: block;
    width: 100%;
    padding: 7px 16px;
    border: none;
    background: none;
    color: var(--text-secondary, #6B7280);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.1s;
    font-family: inherit;
}
.theme-v2 .v2-dr-filter-item:hover:not(.active) {
    background: var(--surface-sunken, #F9FAFB);
}
.theme-v2 .v2-dr-filter-item.active {
    background: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
    font-weight: 600;
}
.theme-v2 .v2-dr-filter-divider {
    height: 1px;
    background: var(--border-default, #E5E7EB);
    margin: 4px 0;
}

/* Right: calendars */
.theme-v2 .v2-dr-calendars {
    flex: 1;
    padding: 12px 16px;
    min-width: 0;
}
.theme-v2 .v2-dr-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.theme-v2 .v2-dr-cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: none;
    color: var(--text-secondary, #6B7280);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s;
}
.theme-v2 .v2-dr-cal-nav:hover {
    background: var(--surface-sunken, #F9FAFB);
    color: var(--brand-primary, #1B5E42);
}
.theme-v2 .v2-dr-cal-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}
.theme-v2 .v2-dr-cal-months {
    display: flex;
    gap: 20px;
}
.theme-v2 .v2-dr-cal-month {
    flex: 1;
    min-width: 0;
}
.theme-v2 .v2-dr-cal-month-title {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 6px;
}
.theme-v2 .v2-dr-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}
.theme-v2 .v2-dr-cal-dow {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary, #9CA3AF);
    padding: 4px 0;
    text-transform: uppercase;
}
.theme-v2 .v2-dr-cal-day {
    text-align: center;
    font-size: 11px;
    padding: 5px 2px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-primary, #111827);
    transition: all 0.1s;
    position: relative;
    border: none;
    background: none;
    font-family: inherit;
}
.theme-v2 .v2-dr-cal-day:hover:not(.disabled):not(.other-month) {
    background: var(--surface-sunken, #F9FAFB);
}
.theme-v2 .v2-dr-cal-day.today::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-primary, #1B5E42);
}
.theme-v2 .v2-dr-cal-day.selected {
    background: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
    font-weight: 600;
}
.theme-v2 .v2-dr-cal-day.in-range {
    background: rgba(27, 94, 66, 0.08);
    border-radius: 0;
}
.theme-v2 .v2-dr-cal-day.range-start {
    border-radius: 4px 0 0 4px;
}
.theme-v2 .v2-dr-cal-day.range-end {
    border-radius: 0 4px 4px 0;
}
.theme-v2 .v2-dr-cal-day.disabled {
    color: var(--text-disabled, rgba(26, 26, 26, 0.3));
    cursor: default;
}
.theme-v2 .v2-dr-cal-day.other-month {
    color: var(--text-tertiary, #9CA3AF);
    opacity: 0.5;
}

/* Footer */
.theme-v2 .v2-dr-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border-default, #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.theme-v2 .v2-dr-range-preview {
    font-size: 12px;
    color: var(--text-secondary, #6B7280);
}
.theme-v2 .v2-dr-apply {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.theme-v2 .v2-dr-apply:hover {
    background: var(--brand-hover, #155237);
}

/* ============================================================
   V2 SORT TRIGGER & DROPDOWN
   ============================================================ */
.theme-v2 .v2-sort-wrap {
    position: relative;
}
.theme-v2 .v2-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    background: var(--surface-default, #FFFFFF);
    color: var(--text-primary, #111827);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 160px;
    justify-content: space-between;
    white-space: nowrap;
}
.theme-v2 .v2-sort-trigger:hover {
    border-color: var(--border-bold, #A8A29E);
}
.theme-v2 .v2-sort-trigger .v2-sort-chevron {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.theme-v2 .v2-sort-trigger.open .v2-sort-chevron {
    transform: rotate(180deg);
}
.theme-v2 .v2-sort-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 200;
    padding: 6px 0;
    display: none;
}
.theme-v2 .v2-sort-dropdown.open {
    display: block;
}

/* ============================================================
   V2 ACTION SPLIT BUTTON & MENU
   ============================================================ */
.theme-v2 .v2-action-wrap {
    position: relative;
    display: inline-flex;
}
.theme-v2 .v2-action-primary {
    background: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
    border: none;
    padding: 7px 14px;
    border-radius: 6px 0 0 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.theme-v2 .v2-action-primary:hover {
    background: var(--brand-hover, #155237);
}
.theme-v2 .v2-action-toggle {
    background: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding: 7px 8px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
}
.theme-v2 .v2-action-toggle:hover {
    background: var(--brand-hover, #155237);
}
.theme-v2 .v2-action-toggle .v2-action-chevron {
    width: 10px;
    height: 10px;
}
.theme-v2 .v2-action-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 200;
    padding: 6px 0;
    display: none;
}
.theme-v2 .v2-action-menu.open {
    display: block;
}


/* ============================================================
   V2 QUICK FILTER CHIPS
   ============================================================ */
.theme-v2 .v2-quick-filters {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default, #E5E7EB);
    flex-wrap: wrap;
}

.theme-v2 .v2-quick-filters-label {
    font-size: 12px;
    color: var(--text-tertiary, #9CA3AF);
    font-weight: 500;
    margin-right: 4px;
    white-space: nowrap;
}

.theme-v2 .v2-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-default, #E5E7EB);
    background: var(--surface-default, #FFFFFF);
    color: var(--text-secondary, #6B7280);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.theme-v2 .v2-chip:hover {
    background: var(--surface-sunken, #F9FAFB);
    border-color: var(--border-bold, #D1D5DB);
}

.theme-v2 .v2-chip.active {
    background: var(--brand-primary, #1B5E42);
    border-color: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
}

.theme-v2 .v2-chip .v2-chip-count {
    background: rgba(0,0,0,0.08);
    padding: 0 5px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}

.theme-v2 .v2-chip.active .v2-chip-count {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Chip color variants (match status badge colors in tables) ---
   Inactive: colored border + text (subtle).  Active: solid fill.  */

/* Success (green) — Actief, Betaald, Klant */
.theme-v2 .v2-chip.chip-success {
    border-color: var(--success-border, #6EE7B7);
    color: var(--success-text, #047857);
}
.theme-v2 .v2-chip.chip-success .v2-chip-count {
    background: var(--success-bg, #ECFDF5);
    color: var(--success-text, #047857);
}
.theme-v2 .v2-chip.chip-success.active {
    background: var(--success-text, #047857);
    border-color: var(--success-text, #047857);
    color: #FFFFFF;
}
.theme-v2 .v2-chip.chip-success.active .v2-chip-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}

/* Warning (amber) — Verloopt binnenkort, Verlopen PO */
.theme-v2 .v2-chip.chip-warning {
    border-color: var(--warning-border, #FCD34D);
    color: var(--warning-text, #B45309);
}
.theme-v2 .v2-chip.chip-warning .v2-chip-count {
    background: var(--warning-bg, #FFF7D6);
    color: var(--warning-text, #B45309);
}
.theme-v2 .v2-chip.chip-warning.active {
    background: var(--warning-text, #B45309);
    border-color: var(--warning-text, #B45309);
    color: #FFFFFF;
}
.theme-v2 .v2-chip.chip-warning.active .v2-chip-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}

/* Danger (red) — Verlopen contracten, Geannuleerd */
.theme-v2 .v2-chip.chip-danger {
    border-color: var(--danger-border, #FCA5A5);
    color: var(--danger-text, #DC2626);
}
.theme-v2 .v2-chip.chip-danger .v2-chip-count {
    background: var(--danger-bg, #FEF2F2);
    color: var(--danger-text, #DC2626);
}
.theme-v2 .v2-chip.chip-danger.active {
    background: var(--danger-text, #DC2626);
    border-color: var(--danger-text, #DC2626);
    color: #FFFFFF;
}
.theme-v2 .v2-chip.chip-danger.active .v2-chip-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}

/* Neutral (gray) — Concept, Gepland, Inactief */
.theme-v2 .v2-chip.chip-neutral {
    border-color: #A8A29E;
    color: var(--text-tertiary, #9CA3AF);
}
.theme-v2 .v2-chip.chip-neutral .v2-chip-count {
    background: #F9FAFB;
    color: var(--text-tertiary, #9CA3AF);
}
.theme-v2 .v2-chip.chip-neutral.active {
    background: var(--text-tertiary, #9CA3AF);
    border-color: var(--text-tertiary, #9CA3AF);
    color: #FFFFFF;
}
.theme-v2 .v2-chip.chip-neutral.active .v2-chip-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}

/* Info (brand green) — Gefactureerd, Prospect, Eenmalig */
.theme-v2 .v2-chip.chip-info {
    border-color: rgba(27, 94, 66, 0.4);
    color: var(--brand-primary, #1B5E42);
}
.theme-v2 .v2-chip.chip-info .v2-chip-count {
    background: rgba(27, 94, 66, 0.08);
    color: var(--brand-primary, #1B5E42);
}
.theme-v2 .v2-chip.chip-info.active {
    background: var(--brand-primary, #1B5E42);
    border-color: var(--brand-primary, #1B5E42);
    color: #FFFFFF;
}
.theme-v2 .v2-chip.chip-info.active .v2-chip-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}

/* Purple — ARR */
.theme-v2 .v2-chip.chip-purple {
    border-color: var(--purple-border, #A78BFA);
    color: var(--purple-text, #7C3AED);
}
.theme-v2 .v2-chip.chip-purple .v2-chip-count {
    background: var(--purple-bg, #F3E8FF);
    color: var(--purple-text, #7C3AED);
}
.theme-v2 .v2-chip.chip-purple.active {
    background: var(--purple-text, #7C3AED);
    border-color: var(--purple-text, #7C3AED);
    color: #FFFFFF;
}
.theme-v2 .v2-chip.chip-purple.active .v2-chip-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}

/* Orange — Suspect */
.theme-v2 .v2-chip.chip-orange {
    border-color: #FBBF24;
    color: #D97706;
}
.theme-v2 .v2-chip.chip-orange .v2-chip-count {
    background: #FEF3C7;
    color: #D97706;
}
.theme-v2 .v2-chip.chip-orange.active {
    background: #D97706;
    border-color: #D97706;
    color: #FFFFFF;
}
.theme-v2 .v2-chip.chip-orange.active .v2-chip-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}


/* ============================================================
   V2 SUMMARY CARDS (replaces summary-bar)
   ============================================================ */
.theme-v2 .v2-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.theme-v2 .v2-summary-grid.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.theme-v2 .v2-summary-card {
    background: var(--surface-default, #FFFFFF);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-left: 4px solid;
    box-shadow: 0px 1px 1px rgba(30,31,33,0.08);
}

.theme-v2 .v2-summary-card.positive { border-left-color: #6EE7B7; background: #ECFDF5; }
.theme-v2 .v2-summary-card.warning { border-left-color: #FCD34D; background: #FFFBEB; }
.theme-v2 .v2-summary-card.negative { border-left-color: #FCA5A5; background: #FEF2F2; }
.theme-v2 .v2-summary-card.neutral { border-left-color: #B3B9C4; background: var(--surface-sunken, #F9FAFB); }
.theme-v2 .v2-summary-card.info { border-left-color: var(--brand-primary, #1B5E42); background: rgba(27, 94, 66, 0.06); }
.theme-v2 .v2-summary-card.purple { border-left-color: #A78BFA; background: #FAF5FF; }

.theme-v2 .v2-summary-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, #6B7280);
    margin-bottom: 6px;
}

.theme-v2 .v2-summary-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    line-height: 1.2;
}

.theme-v2 .v2-summary-detail {
    font-size: 13px;
    color: var(--text-tertiary, #9CA3AF);
    margin-top: 4px;
}


/* ============================================================
   V2 STATUS WORKFLOW BAR
   ============================================================ */
.theme-v2 .v2-status-workflow {
    display: flex !important;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 8px;
}

.theme-v2 .v2-workflow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary, #9CA3AF);
    border-radius: 6px;
    position: relative;
    white-space: nowrap;
}

.theme-v2 .v2-workflow-step.completed {
    color: #047857;
    background: #ECFDF5;
}

.theme-v2 .v2-workflow-step.current {
    color: var(--brand-primary, #1B5E42);
    background: rgba(27, 94, 66, 0.08);
    font-weight: 600;
}

.theme-v2 .v2-workflow-connector {
    width: 32px;
    height: 2px;
    background: var(--border-default, #E5E7EB);
    flex-shrink: 0;
}

.theme-v2 .v2-workflow-connector.done {
    background: #6EE7B7;
}

.theme-v2 .v2-workflow-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    font-weight: 600;
}

.theme-v2 .v2-workflow-step.completed .v2-workflow-icon {
    background: #047857;
    color: white;
}

.theme-v2 .v2-workflow-step.current .v2-workflow-icon {
    background: var(--brand-primary, #1B5E42);
    color: white;
}

.theme-v2 .v2-workflow-step .v2-workflow-icon {
    background: var(--border-default, #E5E7EB);
    color: var(--text-tertiary, #9CA3AF);
}


/* ============================================================
   V2 INLINE SEARCH (detail page sections)
   ============================================================ */
.theme-v2 .v2-inline-search {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-default, #E5E7EB);
}

.theme-v2 .v2-inline-search .v2-search-wrap {
    flex: 1;
    max-width: 320px;
}

.theme-v2 .v2-inline-search .v2-search-wrap input {
    padding: 6px 10px 6px 32px !important;
    font-size: 13px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    width: 100%;
    background: var(--surface-default, #FFFFFF);
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-inline-search select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    background: var(--surface-default, #FFFFFF);
    color: var(--text-secondary, #6B7280);
}


/* ============================================================
   V2 LINE CARDS (contract detail)
   ============================================================ */
.theme-v2 .v2-line-card {
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 10px;
    background: var(--surface-default, #FFFFFF);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    transition: border-color 0.15s;
}

.theme-v2 .v2-line-card:hover {
    border-color: rgba(0,0,0,0.25);
}

.theme-v2 .v2-line-card-main {
    flex: 1;
    min-width: 0;
}

.theme-v2 .v2-line-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-v2 .v2-line-card-meta {
    font-size: 13px;
    color: var(--text-tertiary, #9CA3AF);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-v2 .v2-line-card-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    white-space: nowrap;
    text-align: right;
}

.theme-v2 .v2-line-card-amount-sub {
    font-size: 12px;
    color: var(--text-tertiary, #9CA3AF);
    font-weight: 400;
}


/* ============================================================
   V2 TIMELINE HEATMAP (billing)
   ============================================================ */
.theme-v2 .v2-timeline-table {
    font-size: 13px;
}

.theme-v2 .v2-timeline-table th {
    padding: 8px 6px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
}

.theme-v2 .v2-timeline-table th:first-child {
    text-align: left;
    padding-left: 16px;
    min-width: 200px;
}

.theme-v2 .v2-timeline-table td {
    padding: 4px 6px;
    text-align: center;
    vertical-align: middle;
}

.theme-v2 .v2-timeline-table td:first-child {
    text-align: left;
    padding-left: 16px;
    font-weight: 500;
    font-size: 13px;
}

.theme-v2 .v2-timeline-table td:last-child {
    font-weight: 600;
    text-align: right;
    padding-right: 16px;
}

.theme-v2 .v2-timeline-table th:last-child {
    text-align: right;
    padding-right: 16px;
}

.theme-v2 .v2-timeline-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-tertiary, #9CA3AF);
    border-top: 1px solid var(--border-default, #E5E7EB);
    margin-top: 8px;
}

.theme-v2 .v2-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-v2 .v2-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}


/* ============================================================
   V2 NOTE THREAD
   ============================================================ */
.theme-v2 .v2-note-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-v2 .v2-note-bubble {
    background: var(--surface-sunken, #F9FAFB);
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 85%;
}

.theme-v2 .v2-note-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #6B7280);
    margin-bottom: 4px;
}

.theme-v2 .v2-note-time {
    font-size: 11px;
    color: var(--text-tertiary, #9CA3AF);
    font-weight: 400;
    margin-left: 8px;
}

.theme-v2 .v2-note-text {
    font-size: 14px;
    color: var(--text-primary, #111827);
}


/* ============================================================
   V2 AUDIT ENTRIES
   ============================================================ */
.theme-v2 .v2-audit-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-default, #E5E7EB);
    font-size: 13px;
}

.theme-v2 .v2-audit-time {
    color: var(--text-tertiary, #9CA3AF);
    white-space: nowrap;
    min-width: 120px;
    font-size: 12px;
}

.theme-v2 .v2-audit-text {
    color: var(--text-secondary, #6B7280);
    flex: 1;
}


/* ============================================================
   V2 BADGE STYLES
   ============================================================ */
.theme-v2 .v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    line-height: 1.4;
}

.theme-v2 .v2-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Dot colors per variant */
.theme-v2 .v2-badge-success { color: var(--text-primary); }
.theme-v2 .v2-badge-success::before { background: var(--success-text); }

.theme-v2 .v2-badge-warning { color: var(--text-primary); }
.theme-v2 .v2-badge-warning::before { background: var(--warning-text); }

.theme-v2 .v2-badge-danger { color: var(--text-primary); }
.theme-v2 .v2-badge-danger::before { background: var(--danger-text); }

.theme-v2 .v2-badge-info { color: var(--text-primary); }
.theme-v2 .v2-badge-info::before { background: var(--brand-primary); }

.theme-v2 .v2-badge-neutral { color: var(--text-secondary); }
.theme-v2 .v2-badge-neutral::before { background: var(--border-bold); }

.theme-v2 .v2-badge-purple { color: var(--text-primary); }
.theme-v2 .v2-badge-purple::before { background: #7C3AED; }

.theme-v2 .v2-badge-id {
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-small, 6px);
    letter-spacing: -0.01em;
}


/* ============================================================
   V2 SECTION TITLE
   ============================================================ */
.theme-v2 .v2-section-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #111827);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   V2 CARD COMPONENT
   ============================================================ */
.theme-v2 .v2-card {
    background: var(--surface-default, #FFFFFF);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0px 1px 1px rgba(30,31,33,0.08);
    border: 1px solid var(--border-default, #E5E7EB);
    margin-bottom: 20px;
}


/* ============================================================
   V2 TABS
   ============================================================ */
.theme-v2 .v2-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-default, #E5E7EB);
    margin-bottom: 20px;
}

.theme-v2 .v2-tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary, #6B7280);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    border-radius: 6px 6px 0 0;
}

.theme-v2 .v2-tab:hover {
    background: var(--surface-sunken, #F9FAFB);
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-tab.active {
    color: var(--brand-primary, #1B5E42);
    border-bottom-color: var(--brand-primary, #1B5E42);
    font-weight: 500;
}


/* ============================================================
   V2 FORM GRID
   ============================================================ */
.theme-v2 .v2-form-grid {
    display: grid;
    gap: 16px;
}

.theme-v2 .v2-form-grid-2 { grid-template-columns: 1fr 1fr; }
.theme-v2 .v2-form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.theme-v2 .v2-form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.theme-v2 .v2-form-full { grid-column: 1 / -1; }

.theme-v2 .v2-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #6B7280);
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: normal;
}

.theme-v2 .v2-form-group input,
.theme-v2 .v2-form-group select,
.theme-v2 .v2-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary, #111827);
    background: var(--surface-default, #FFFFFF);
    transition: border-color 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}

.theme-v2 .v2-form-group input:focus,
.theme-v2 .v2-form-group select:focus,
.theme-v2 .v2-form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary, #1B5E42);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

.theme-v2 .v2-form-value {
    font-size: 14px;
    color: var(--text-primary, #111827);
    padding: 8px 0;
}


/* ============================================================
   V2 INFO BOX
   ============================================================ */
.theme-v2 .v2-info-box {
    padding: 16px 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    border-left: 3px solid;
    margin-bottom: 20px;
}

.theme-v2 .v2-info-box.blue {
    background: rgba(27, 94, 66, 0.06);
    border-left-color: var(--brand-primary, #1B5E42);
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-info-box.green {
    background: #ECFDF5;
    border-left-color: #6EE7B7;
}

.theme-v2 .v2-info-box.yellow {
    background: #FFFBEB;
    border-left-color: #FCD34D;
}


/* ============================================================
   V2 BUTTONS
   ============================================================ */
.theme-v2 .v2-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-medium, 8px);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.theme-v2 .v2-btn-primary { background: var(--brand-primary, #1B5E42); color: white; }
.theme-v2 .v2-btn-primary:hover { background: var(--brand-hover, #155237); }

.theme-v2 .v2-btn-secondary {
    background: var(--surface-sunken, #F9FAFB);
    color: var(--text-secondary, #6B7280);
    border: 1px solid var(--border-default, #E5E7EB);
}
.theme-v2 .v2-btn-secondary:hover { background: var(--surface-sidebar-hover, #F3F4F6); }

.theme-v2 .v2-btn-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.theme-v2 .v2-btn-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.theme-v2 .v2-btn-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
.theme-v2 .v2-btn-purple { background: var(--purple-bg); color: var(--purple-text); border: 1px solid var(--purple-border); }

.theme-v2 .v2-btn-small { padding: 6px 12px; font-size: 13px; }


/* ============================================================
   V2 RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .theme-v2 .v2-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .theme-v2 .v2-summary-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .theme-v2 .v2-filter-bar-row { flex-direction: column; align-items: stretch; }
    .theme-v2 .v2-summary-grid { grid-template-columns: 1fr; }
    .theme-v2 .v2-page-header { flex-direction: column; gap: 12px; }
    .theme-v2 .v2-form-grid-3,
    .theme-v2 .v2-form-grid-4 { grid-template-columns: 1fr; }
}


/* ============================================================
   V2 FLAT TABLE (contracts list, billing invoices)
   ============================================================ */
.theme-v2 .v2-flat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.theme-v2 .v2-flat-table thead th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary, #9CA3AF);
    border-bottom: 1px solid var(--border-default, #E5E7EB);
    background: transparent;
    white-space: nowrap;
}

.theme-v2 .v2-flat-table thead th.right { text-align: right; }
.theme-v2 .v2-flat-table thead th.center { text-align: center; }

.theme-v2 .v2-flat-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-default, #E5E7EB);
    color: var(--text-primary, #111827);
    vertical-align: middle;
}

.theme-v2 .v2-flat-table tbody td.right { text-align: right; }
.theme-v2 .v2-flat-table tbody td.center { text-align: center; }

.theme-v2 .v2-flat-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.theme-v2 .v2-flat-table tbody tr:hover td {
    background: var(--surface-sunken, #F9FAFB);
}

.theme-v2 .v2-cell-id {
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
}

.theme-v2 .v2-flat-table .v2-cell-amount {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.theme-v2 .v2-flat-table .v2-cell-link {
    color: var(--brand-primary, #1B5E42);
    cursor: pointer;
}

.theme-v2 .v2-flat-table .v2-cell-link:hover {
    text-decoration: underline;
}

.theme-v2 .v2-flat-table .v2-cell-muted {
    color: var(--text-tertiary, #9CA3AF);
    font-style: italic;
}


/* ============================================================
   V2 COLUMN FILTERS (Jira-style sort + filter dropdowns)
   ============================================================ */
.theme-v2 .v2-flat-table thead th.v2-col-header {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.theme-v2 .v2-col-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    padding: 6px 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-primary, #111827);
    display: none;
}
.theme-v2 .v2-col-dropdown.open { display: block; }
.theme-v2 .v2-col-dropdown.align-right { left: auto; right: 0; }

.theme-v2 .v2-col-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s;
}
.theme-v2 .v2-col-dd-item:hover { background: var(--surface-sunken, #F9FAFB); }
.theme-v2 .v2-col-dd-item.active { background: rgba(27, 94, 66, 0.06); color: var(--brand-primary, #1B5E42); font-weight: 600; }
.theme-v2 .v2-col-dd-item .dd-icon { width: 16px; text-align: center; font-size: 12px; flex-shrink: 0; }

.theme-v2 .v2-col-dd-divider { height: 1px; background: var(--border-default, #E5E7EB); margin: 4px 0; }
.theme-v2 .v2-col-dd-label { padding: 6px 14px; font-size: 11px; color: var(--text-tertiary, #9CA3AF); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

.theme-v2 .v2-col-dd-search {
    margin: 4px 10px;
    padding: 6px 8px 6px 28px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 4px;
    font-size: 12px;
    background: var(--surface-default, #FFFFFF) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 8px center;
    width: calc(100% - 20px);
    box-sizing: border-box;
}
.theme-v2 .v2-col-dd-search:focus { border-color: var(--brand-primary, #1B5E42); outline: none; box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15); }

.theme-v2 .v2-col-dd-input {
    margin: 4px 10px 6px;
    padding: 6px 8px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 4px;
    font-size: 12px;
    background: var(--surface-default, #FFFFFF);
    width: calc(100% - 20px);
    box-sizing: border-box;
}
.theme-v2 .v2-col-dd-input:focus { border-color: var(--brand-primary, #1B5E42); outline: none; box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15); }

.theme-v2 .v2-col-dd-checklist {
    max-height: 200px;
    overflow-y: auto;
    margin: 2px 0;
}
.theme-v2 .v2-col-dd-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
    white-space: nowrap;
}
.theme-v2 .v2-col-dd-check-item:hover { background: var(--surface-sunken, #F9FAFB); }
.theme-v2 .v2-col-dd-check-item input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--brand-primary, #1B5E42); cursor: pointer; flex-shrink: 0; }
.theme-v2 .v2-col-dd-check-item.hidden { display: none; }

.theme-v2 .v2-col-dd-clear {
    padding: 6px 14px;
    font-size: 12px;
    color: #dc2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.theme-v2 .v2-col-dd-clear:hover { background: #fef2f2; }

.theme-v2 .v2-th-label { display: inline-flex; align-items: center; gap: 4px; }
.theme-v2 .v2-sort-icon { font-size: 10px; color: var(--text-tertiary, #9CA3AF); }
.theme-v2 .v2-th-filter-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand-primary, #1B5E42);
    margin-left: 4px;
    vertical-align: middle;
}
.theme-v2 .v2-col-dd-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--brand-primary, #1B5E42);
    color: white;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

/* V2 FILTER CHIPS (active filter pills below table header) */
.theme-v2 .v2-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    min-height: 0;
    transition: min-height 0.15s;
}
.theme-v2 .v2-filter-chips:not(:empty) { padding: 8px 0 0; }
.theme-v2 .v2-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: rgba(27, 94, 66, 0.08);
    color: var(--brand-primary, #1B5E42);
    border: 1px solid rgba(27, 94, 66, 0.15);
    white-space: nowrap;
}
.theme-v2 .v2-filter-chip-x {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    margin-left: 2px;
}
.theme-v2 .v2-filter-chip-x:hover { opacity: 1; }
.theme-v2 .v2-filter-chip-clear {
    cursor: pointer;
    font-size: 12px;
    color: #dc2626;
    padding: 3px 8px;
}
.theme-v2 .v2-filter-chip-clear:hover { text-decoration: underline; }


/* V2 OPERATOR FILTER ROW (in column dropdown) */
.theme-v2 .v2-col-dd-operator-row {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
}
.theme-v2 .v2-col-dd-op-btn {
    flex: 1;
    padding: 4px 0;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    color: #64748b;
    transition: all 0.1s;
}
.theme-v2 .v2-col-dd-op-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.theme-v2 .v2-col-dd-op-btn.active {
    background: var(--brand-primary, #1B5E42);
    color: #fff;
    border-color: var(--brand-primary, #1B5E42);
}


/* V2 PAGINATION */
.theme-v2 .v2-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 13px;
}
.theme-v2 .v2-pagination-info {
    color: #64748b;
}
.theme-v2 .v2-pagination-btns {
    display: flex;
    gap: 4px;
}
.theme-v2 .v2-pagination-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: all 0.1s;
}
.theme-v2 .v2-pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.theme-v2 .v2-pagination-btn.active {
    background: var(--brand-primary, #1B5E42);
    color: #fff;
    border-color: var(--brand-primary, #1B5E42);
}
.theme-v2 .v2-pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
}


/* V2 FOOTER TOTALS ROW */
.theme-v2 .v2-flat-table tfoot td {
    font-weight: 600;
    border-top: 2px solid #e2e8f0;
    background: #f8fafc;
    padding: 8px 12px;
    font-size: 13px;
}


/* V2 STACKED CELL (name + sub info) */
.theme-v2 .v2-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.theme-v2 .v2-cell-stack-main {
    font-weight: 500;
}
.theme-v2 .v2-cell-stack-sub {
    font-size: 11px;
    color: #94a3b8;
}


/* ============================================================
   V2 CHECKBOX COLUMN (bulk select)
   ============================================================ */
.theme-v2 .v2-checkbox-col {
    width: 32px;
    text-align: center;
    padding-left: 12px !important;
    padding-right: 4px !important;
}

.theme-v2 .v2-checkbox-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary, #1B5E42);
    cursor: pointer;
}


/* ============================================================
   V2 AGING BADGE (invoice age indicator)
   ============================================================ */
.theme-v2 .v2-aging-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}

.theme-v2 .v2-aging-ok {
    background: #ECFDF5;
    color: #047857;
}

.theme-v2 .v2-aging-warning {
    background: #FFFBEB;
    color: #B45309;
}

.theme-v2 .v2-aging-danger {
    background: #FEF2F2;
    color: #DC2626;
}

.theme-v2 .v2-aging-neutral {
    background: #F9FAFB;
    color: var(--text-secondary, #6B7280);
}


/* ============================================================
   V2 ROW TINTING (status-based table row backgrounds)
   ============================================================ */
.theme-v2 .v2-flat-table tr.v2-row-planned td { background: #FFFDF5; }
.theme-v2 .v2-flat-table tr.v2-row-invoiced td { background: rgba(27, 94, 66, 0.03); }
.theme-v2 .v2-flat-table tr.v2-row-paid td { background: #F5FDF9; }
.theme-v2 .v2-flat-table tr.v2-row-draft td { background: #FFFDF5; }
.theme-v2 .v2-flat-table tr.v2-row-overdue td { background: #FFF5F5; }

.theme-v2 .v2-flat-table tr.v2-row-planned:hover td { background: #FFF9E6; }
.theme-v2 .v2-flat-table tr.v2-row-invoiced:hover td { background: rgba(27, 94, 66, 0.06); }
.theme-v2 .v2-flat-table tr.v2-row-paid:hover td { background: #EDFCF3; }
.theme-v2 .v2-flat-table tr.v2-row-draft:hover td { background: #FFF9E6; }
.theme-v2 .v2-flat-table tr.v2-row-overdue:hover td { background: #FFEDED; }


/* ============================================================
   V2 NOTE COMPOSE (add note area)
   ============================================================ */
.theme-v2 .v2-note-compose {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-default, #E5E7EB);
}

.theme-v2 .v2-note-compose textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    min-height: 60px;
    resize: vertical;
    color: var(--text-primary, #111827);
    background: var(--surface-default, #FFFFFF);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.theme-v2 .v2-note-compose textarea:focus {
    outline: none;
    border-color: var(--brand-primary, #1B5E42);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

.theme-v2 .v2-note-compose .v2-note-compose-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}


/* ============================================================
   V2 MONTH GROUP (billing schema grouped by month)
   ============================================================ */
.theme-v2 .v2-month-group {
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.theme-v2 .v2-month-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface-sunken, #F9FAFB);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.theme-v2 .v2-month-group-header:hover {
    background: #F3F4F6;
}

.theme-v2 .v2-month-group-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-v2 .v2-month-group-meta {
    font-size: 13px;
    color: var(--text-tertiary, #9CA3AF);
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-v2 .v2-month-group-total {
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.theme-v2 .v2-month-group-body {
    padding: 0;
}

.theme-v2 .v2-month-group-body .v2-flat-table thead { display: none; }

.theme-v2 .v2-month-group-body .v2-flat-table tbody td {
    padding: 10px 16px;
}


/* ============================================================
   V2 TAB PANELS (show/hide content with tabs)
   ============================================================ */
.theme-v2 .v2-tab-panel {
    display: none;
}

.theme-v2 .v2-tab-panel.active {
    display: block;
}


/* ============================================================
   V2 EDITABLE TABLE (invoice lines)
   ============================================================ */
.theme-v2 .v2-editable-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.theme-v2 .v2-editable-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, #6B7280);
    border-bottom: 2px solid var(--border-bold, #D1D5DB);
    background: transparent;
}

.theme-v2 .v2-editable-table thead th.right { text-align: right; }
.theme-v2 .v2-editable-table thead th.center { text-align: center; }

.theme-v2 .v2-editable-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-default, #E5E7EB);
    vertical-align: middle;
}

.theme-v2 .v2-editable-table tbody td.right { text-align: right; }

.theme-v2 .v2-editable-table tbody td input,
.theme-v2 .v2-editable-table tbody td select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary, #111827);
    background: var(--surface-default, #FFFFFF);
    box-sizing: border-box;
    font-family: inherit;
}

.theme-v2 .v2-editable-table tbody td input:focus,
.theme-v2 .v2-editable-table tbody td select:focus {
    outline: none;
    border-color: var(--brand-primary, #1B5E42);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

.theme-v2 .v2-editable-table .v2-row-total td {
    border-top: 2px solid var(--border-bold, #D1D5DB);
    border-bottom: none;
    font-weight: 600;
    padding-top: 12px;
}

.theme-v2 .v2-editable-table .v2-btn-delete {
    background: none;
    border: none;
    color: var(--text-tertiary, #9CA3AF);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
    font-size: 16px;
    line-height: 1;
}

.theme-v2 .v2-editable-table .v2-btn-delete:hover {
    background: #FEF2F2;
    color: #DC2626;
}


/* ============================================================
   PHASE 0: THEME TOGGLE BUTTON (always visible, both themes)
   ============================================================ */
.theme-toggle-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: #94a3b8;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    margin-left: auto;
    line-height: 1.4;
}

.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.3);
}

.theme-toggle-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Ensure sidebar-footer is flex for toggle alignment */
.sidebar-footer {
    display: flex !important;
    align-items: center;
    gap: 8px;
}


/* ============================================================
   PHASE 1: DESIGN TOKENS
   Orbital green/cream/warm palette merged with mockup tokens
   ============================================================ */
.theme-v2 {
    /* ---- Surfaces (cool gray) ---- */
    --surface-default: #FFFFFF;
    --surface-sunken: #F9FAFB;
    --surface-raised: #FFFFFF;
    --surface-sidebar: #F9FAFB;
    --surface-sidebar-hover: #F3F4F6;
    --surface-sidebar-active: rgba(27, 94, 66, 0.10);

    /* ---- Text (cool gray) ---- */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-disabled: rgba(17, 24, 39, 0.3);
    --text-inverse: #FFFFFF;
    --text-sidebar: #6B7280;
    --text-sidebar-hover: #111827;

    /* ---- Brand / Interactive (forest green — unchanged) ---- */
    --brand-primary: #1B5E42;
    --brand-hover: #155237;
    --brand-subtle: rgba(27, 94, 66, 0.08);
    --brand-selected: rgba(27, 94, 66, 0.15);

    /* ---- Semantic ---- */
    --success-bg: #ECFDF5;
    --success-text: #047857;
    --success-border: #6EE7B7;
    --warning-bg: #FFFBEB;
    --warning-text: #B45309;
    --warning-border: #FCD34D;
    --danger-bg: #FEF2F2;
    --danger-text: #DC2626;
    --danger-border: #FCA5A5;
    --info-bg: rgba(27, 94, 66, 0.06);
    --info-text: #1B5E42;
    --purple-bg: #F3E8FF;
    --purple-text: #7C3AED;
    --purple-border: #A78BFA;

    /* ---- Borders (cool gray) ---- */
    --border-default: #E5E7EB;
    --border-bold: #D1D5DB;
    --border-input: #D1D5DB;
    --border-focus: #1B5E42;

    /* ---- Shadows (neutral) ---- */
    --shadow-raised: 0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-overlay: 0px 10px 15px rgba(0, 0, 0, 0.08), 0px 4px 6px rgba(0, 0, 0, 0.04);

    /* ---- Spacing (8px grid) ---- */
    --space-025: 2px;
    --space-050: 4px;
    --space-075: 6px;
    --space-100: 8px;
    --space-150: 12px;
    --space-200: 16px;
    --space-300: 24px;
    --space-400: 32px;
    --space-500: 40px;
    --space-600: 48px;

    /* ---- Border Radius (rounded-2xl) ---- */
    --radius-small: 6px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-xlarge: 16px;
    --radius-full: 9999px;
}

/* ---- DM Sans font + form element defaults ---- */
.theme-v2 body,
.theme-v2 input,
.theme-v2 select,
.theme-v2 textarea,
.theme-v2 button {
    font-family: var(--font-sans);
}

.theme-v2 input[type="text"],
.theme-v2 input[type="number"],
.theme-v2 input[type="email"],
.theme-v2 input[type="password"],
.theme-v2 input[type="search"],
.theme-v2 input[type="date"],
.theme-v2 input[type="url"],
.theme-v2 select,
.theme-v2 textarea {
    border-radius: var(--radius-medium, 8px);
}


/* ============================================================
   PHASE 2: SIDEBAR RESTYLE
   Dark (#0f172a) → Light cool gray (#F9FAFB) with green accents
   ============================================================ */

/* --- Main sidebar container --- */
.theme-v2 .sidebar {
    background: var(--surface-sidebar);
    color: var(--text-sidebar);
    border-right: 1px solid var(--border-default);
    width: var(--sidebar-width, 240px);
    min-width: var(--sidebar-width, 240px);
}

/* --- Brand area --- */
.theme-v2 .sidebar-brand {
    border-bottom: 1px solid var(--border-default);
    padding: 16px 20px 14px;
}

.theme-v2 .sidebar-brand a {
    color: var(--text-primary);
}

.theme-v2 .sidebar-brand-org {
    color: var(--text-tertiary);
}

.theme-v2 .sidebar-brand-top {
    color: var(--text-primary);
}

.theme-v2 .sidebar-brand-for {
    color: var(--text-tertiary);
}

/* --- Logo SVG filter: adjust for dark-on-light context --- */
.theme-v2 .sidebar-logo,
.theme-v2 .sidebar-logo-large {
    /* No filter needed if logo is already dark-compatible */
}

/* --- Nav scrollbar --- */
.theme-v2 .sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-default);
}

.theme-v2 .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--border-bold);
}

/* --- Top-level links --- */
.theme-v2 .sidebar-link {
    color: var(--text-sidebar);
    font-size: 14px;
    padding: 8px 12px;
    gap: 10px;
}

.theme-v2 .sidebar-link:hover {
    background: var(--surface-sidebar-hover);
    color: var(--text-sidebar-hover);
}

.theme-v2 .sidebar-link.active {
    background: var(--surface-sidebar-active);
    color: var(--brand-primary);
    border-left: none;
    position: relative;
}

.theme-v2 .sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary);
}

.theme-v2 .sidebar-link svg {
    opacity: 0.7;
}

.theme-v2 .sidebar-link.active svg {
    opacity: 1;
    color: var(--brand-primary);
}

.theme-v2 .sidebar-link:hover svg {
    opacity: 1;
}

/* --- Group headers (accordion) --- */
.theme-v2 .sidebar-group-header {
    color: var(--text-sidebar);
    font-size: 14px;
    padding: 8px 12px;
}

.theme-v2 .sidebar-group-header:hover {
    background: var(--surface-sidebar-hover);
    color: var(--text-sidebar-hover);
}

.theme-v2 .sidebar-group-header.active {
    color: var(--text-primary);
    background: var(--surface-sidebar-hover);
}

.theme-v2 .sidebar-group-header svg {
    opacity: 0.6;
}

.theme-v2 .sidebar-group-header:hover svg,
.theme-v2 .sidebar-group-header.active svg {
    opacity: 1;
}

/* --- Nesting indicator line --- */
.theme-v2 .sidebar-group-items-inner {
    border-left: 2px solid var(--border-default);
}

/* --- Section labels (Cashflow, Strategisch, etc.) --- */
.theme-v2 .sidebar-section-label {
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* --- Sub-links (within accordion groups) --- */
.theme-v2 .sidebar-sublink {
    color: var(--text-secondary);
}

.theme-v2 .sidebar-sublink:hover {
    background: var(--surface-sidebar-hover);
    color: var(--text-sidebar-hover);
}

.theme-v2 .sidebar-sublink.active {
    background: var(--surface-sidebar-active);
    color: var(--brand-primary);
    border-left: none;
    position: relative;
}

.theme-v2 .sidebar-sublink.active::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary);
}

.theme-v2 .sidebar-sublink-desc {
    color: var(--text-tertiary);
}

.theme-v2 .sidebar-sublink.active .sidebar-sublink-desc {
    color: var(--brand-primary);
    opacity: 0.7;
}

/* --- Resize handle --- */
.theme-v2 .sidebar-resize-handle:hover,
.theme-v2 .sidebar-resize-handle.dragging {
    background: var(--brand-primary);
}

/* --- User area --- */
.theme-v2 .sidebar-user {
    border-top: 1px solid var(--border-default);
}

.theme-v2 .sidebar-user-avatar {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.theme-v2 .sidebar-user-name {
    color: var(--text-primary);
}

.theme-v2 .sidebar-user-role {
    color: var(--text-tertiary);
}

.theme-v2 .sidebar-user-actions a {
    color: var(--text-tertiary);
}

.theme-v2 .sidebar-user-actions a:hover {
    color: var(--text-primary);
}

/* --- Footer --- */
.theme-v2 .sidebar-footer {
    border-top: 1px solid var(--border-default);
    color: var(--text-tertiary);
}

/* V2 theme toggle button styling (light sidebar context) */
.theme-v2 .theme-toggle-btn {
    border-color: var(--border-default);
    color: var(--text-tertiary);
}

.theme-v2 .theme-toggle-btn:hover {
    background: var(--brand-subtle);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* --- Mobile toggle --- */
.theme-v2 .sidebar-mobile-toggle {
    background: var(--surface-sidebar);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

/* --- Main content margin for wider sidebar --- */
.theme-v2 .main-content {
    margin-left: var(--sidebar-width, 240px);
}

/* --- V2 Sidebar Responsive: always visible on desktop, hamburger on mobile --- */
@media (min-width: 769px) {
    .theme-v2 .sidebar {
        display: flex !important;
        transform: translateX(0) !important;
    }
    .theme-v2 .sidebar-mobile-toggle {
        display: none !important;
    }
}
@media (max-width: 768px) {
    .theme-v2 .main-content {
        margin-left: 0;
    }
}


/* ============================================================
   PHASE 3: BASE STYLES
   Body, headings, container, page-header, breadcrumbs, links
   ============================================================ */

/* --- Body --- */
.theme-v2,
.theme-v2 body {
    background: var(--surface-sunken);
    color: var(--text-primary);
}

/* --- Typography --- */
.theme-v2 h1, .theme-v2 h2, .theme-v2 h3,
.theme-v2 h4, .theme-v2 h5, .theme-v2 h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.theme-v2 h2, .theme-v2 h3 {
    font-weight: 500;
}

/* --- Container --- */
.theme-v2 .container {
    padding: 32px;
    max-width: 1440px;
}

/* --- Page Header --- */
.theme-v2 .page-header h1 {
    color: var(--text-primary);
    font-weight: 600;
}

.theme-v2 .page-header .subtitle,
.theme-v2 .subtitle {
    color: var(--text-secondary);
}

.theme-v2 .page-header {
    margin-bottom: 32px;
}

/* --- Section titles --- */
.theme-v2 .section-title {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- Breadcrumb bar --- */
.theme-v2 .breadcrumb-bar {
    background: rgba(250, 249, 247, 0.92);
    border-bottom: 1px solid var(--border-default);
}

.theme-v2 .breadcrumb-bar nav {
    color: var(--text-tertiary);
}

.theme-v2 .breadcrumb-bar .bc-sep {
    color: var(--border-default);
}

.theme-v2 .breadcrumb-bar a {
    color: var(--text-secondary);
}

.theme-v2 .breadcrumb-bar a:hover {
    color: var(--brand-primary);
}

.theme-v2 .breadcrumb-bar .bc-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- Back link --- */
.theme-v2 .back-link {
    color: var(--text-tertiary);
}

.theme-v2 .back-link:hover {
    color: var(--brand-primary);
}

/* --- Generic links --- */
.theme-v2 a {
    color: var(--brand-primary);
}

.theme-v2 a:hover {
    color: var(--brand-hover);
}

/* --- Loading & error states --- */
.theme-v2 .loading {
    color: var(--text-tertiary);
}

.theme-v2 .error {
    color: var(--danger-text);
    background: var(--danger-bg);
}

/* --- Text utilities --- */
.theme-v2 .text-muted {
    color: var(--text-tertiary);
}

.theme-v2 .text-green {
    color: var(--success-text);
}

.theme-v2 .text-red {
    color: var(--danger-text);
}

.theme-v2 .text-yellow {
    color: var(--warning-text);
}


/* ============================================================
   PHASE 4: TABLES
   14px body, 12px normal-case headers, wider padding
   ============================================================ */

.theme-v2 table {
    font-size: 14px;
}

.theme-v2 th {
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 2px solid var(--border-bold);
    padding: 10px 16px;
}

.theme-v2 td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-primary);
}

.theme-v2 tr:hover td {
    background: var(--surface-sunken);
}

/* Tinted rows */
.theme-v2 tr.row-planned td {
    background: #FFFDF5;
}

.theme-v2 tr.row-invoiced td {
    background: rgba(27, 94, 66, 0.04);
}

.theme-v2 tr.row-paid td {
    background: #F5FDF9;
}

.theme-v2 tr.row-draft td {
    background: #FFFDF5;
}

.theme-v2 tr.total td {
    background: var(--surface-sunken);
    font-weight: 700;
    border-top: 2px solid var(--border-bold);
}

.theme-v2 tr.negative td {
    background: var(--danger-bg);
}


/* ============================================================
   PHASE 5: CARDS & SUMMARY CARDS
   Flat pastels, 8px radius, lighter weights
   ============================================================ */

/* --- Base card --- */
.theme-v2 .card {
    background: var(--surface-default);
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-large);
}

/* --- Summary cards (KPIs) --- */
.theme-v2 .summary-card {
    background: var(--surface-default);
    border: 1px solid var(--border-default);
    border-left: 4px solid;
    box-shadow: var(--shadow-raised);
    border-radius: var(--radius-large);
}

.theme-v2 .summary-card.positive {
    border-left-color: var(--success-border);
    background: var(--success-bg);
    border-color: var(--success-border);
    border-left-width: 4px;
}

.theme-v2 .summary-card.warning {
    border-left-color: var(--warning-border);
    background: var(--warning-bg);
    border-color: var(--warning-border);
    border-left-width: 4px;
}

.theme-v2 .summary-card.negative {
    border-left-color: var(--danger-border);
    background: var(--danger-bg);
    border-color: var(--danger-border);
    border-left-width: 4px;
}

.theme-v2 .summary-card.neutral {
    border-left-color: var(--border-bold);
    background: var(--surface-sunken);
    border-color: var(--border-default);
    border-left-width: 4px;
}

.theme-v2 .summary-card.info {
    border-left-color: var(--brand-primary);
    background: var(--brand-subtle);
    border-color: rgba(27, 94, 66, 0.2);
    border-left-width: 4px;
}

.theme-v2 .summary-card.purple {
    border-left-color: var(--purple-border);
    background: var(--purple-bg);
    border-color: var(--purple-border);
    border-left-width: 4px;
}

.theme-v2 .summary-label {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: none;
    font-weight: 500;
}

.theme-v2 .summary-value {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
}

.theme-v2 .summary-detail {
    color: var(--text-tertiary);
    font-size: 13px;
}


/* ============================================================
   PHASE 6: BUTTONS & FORMS
   Green primary, 6px radius, weight 500
   ============================================================ */

/* --- Buttons --- */
.theme-v2 .btn {
    border-radius: var(--radius-medium);
    font-weight: 500;
}

.theme-v2 .btn-primary {
    background: var(--brand-primary);
    color: var(--text-inverse);
    border-color: var(--brand-primary);
}

.theme-v2 .btn-primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.theme-v2 .btn-primary:disabled {
    background: var(--text-tertiary);
    border-color: var(--text-tertiary);
}

.theme-v2 .btn-secondary {
    background: var(--surface-sunken);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.theme-v2 .btn-secondary:hover {
    background: var(--surface-sidebar-hover);
    border-color: var(--border-bold);
}

.theme-v2 .btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.theme-v2 .btn-danger:hover {
    background: #FFD8D3;
}

.theme-v2 .btn-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.theme-v2 .btn-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.theme-v2 .btn-purple {
    background: var(--purple-bg);
    color: var(--purple-text);
    border: 1px solid var(--purple-border);
}

.theme-v2 .btn-icon {
    background: transparent;
    color: var(--text-tertiary);
}

.theme-v2 .btn-icon:hover {
    background: var(--surface-sunken);
    color: var(--danger-text);
}

.theme-v2 .link-btn {
    color: var(--brand-primary);
}

.theme-v2 .link-btn:hover {
    color: var(--brand-hover);
}

.theme-v2 .btn-small {
    border-radius: var(--radius-small);
    font-size: 13px;
}

/* --- Forms --- */
.theme-v2 .form-group label {
    color: var(--text-secondary);
    font-size: 14px;
}

.theme-v2 .form-group input,
.theme-v2 .form-group select,
.theme-v2 .form-group textarea {
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    background: var(--surface-default);
    border-radius: var(--radius-medium);
    font-size: 14px;
}

.theme-v2 .form-group input:focus,
.theme-v2 .form-group select:focus,
.theme-v2 .form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

.theme-v2 .form-value {
    color: var(--text-primary);
}


/* ============================================================
   PHASE 7A: TABS
   Active = bottom-border green, no bg fill
   ============================================================ */

.theme-v2 .tabs {
    border-bottom: 2px solid var(--border-default);
}

.theme-v2 .tab {
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    font-size: 14px;
    padding: 10px 16px;
}

.theme-v2 .tab:hover {
    background: var(--surface-sunken);
    color: var(--text-primary);
}

.theme-v2 .tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    font-weight: 500;
    background: transparent;
}

/* Admin tabs */
.theme-v2 .admin-tabs {
    border-bottom: 2px solid var(--border-default);
}

.theme-v2 .admin-tab {
    color: var(--text-tertiary);
}

.theme-v2 .admin-tab:hover {
    color: var(--text-primary);
}

.theme-v2 .admin-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

/* KPI tabs */
.theme-v2 .kpi-tabs {
    border-bottom: 2px solid var(--border-default);
}

.theme-v2 .kpi-tab {
    color: var(--text-tertiary);
}

.theme-v2 .kpi-tab:hover {
    color: var(--text-primary);
}

.theme-v2 .kpi-tab.active {
    border-bottom-color: var(--brand-primary);
    color: var(--brand-primary);
}


/* ============================================================
   PHASE 7B: BADGES & STATUS LABELS
   Minimum 11px, consistent padding, green-adjusted where needed
   ============================================================ */

.theme-v2 .badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-small);
    font-weight: 600;
}

.theme-v2 .badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .badge-info {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .badge-neutral {
    background: var(--surface-sunken);
    color: var(--text-secondary);
}

.theme-v2 .badge-purple {
    background: var(--purple-bg);
    color: var(--purple-text);
}

/* Status badges */
.theme-v2 .status-badge {
    font-size: 11px;
    padding: 2px 8px;
    font-weight: 600;
}

.theme-v2 .status-badge.complete,
.theme-v2 .status-badge.active,
.theme-v2 .status-badge.paid,
.theme-v2 .status-badge.completed {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .status-badge.draft,
.theme-v2 .status-badge.planned,
.theme-v2 .status-badge.archived,
.theme-v2 .status-badge.ARCHIVED {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .status-badge.approved,
.theme-v2 .status-badge.invoiced,
.theme-v2 .status-badge.APPROVED {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .status-badge.sent_to_exact,
.theme-v2 .status-badge.expired,
.theme-v2 .status-badge.DRAFT {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .status-badge.cancelled {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .status-badge.credited {
    background: var(--purple-bg);
    color: var(--purple-text);
}

.theme-v2 .status-badge.LOCKED {
    background: #FCE7F3;
    color: #BE185D;
}

.theme-v2 .status-badge.paused {
    background: #E0E7FF;
    color: #3730A3;
}


/* ============================================================
   PHASE 7C: INFO BOXES & ALERTS
   ============================================================ */

.theme-v2 .info-box {
    border-radius: var(--radius-medium);
    font-size: 14px;
    padding: 16px 20px;
    border-left-width: 3px;
}

.theme-v2 .info-box.blue {
    background: var(--brand-subtle);
    border-left-color: var(--brand-primary);
    color: var(--text-primary);
}

.theme-v2 .info-box.green {
    background: var(--success-bg);
    border-left-color: var(--success-border);
}

.theme-v2 .info-box.yellow {
    background: var(--warning-bg);
    border-left-color: var(--warning-border);
}

.theme-v2 .info-box.red {
    background: var(--danger-bg);
    border-left-color: var(--danger-border);
}

.theme-v2 .info-box.orange {
    background: #FFF7ED;
    border-left-color: #F97316;
}

.theme-v2 .info-box strong {
    color: var(--text-primary);
}


/* ============================================================
   PHASE 7D: MODALS & OVERLAYS
   ============================================================ */

.theme-v2 .modal-overlay {
    background: rgba(28, 25, 23, 0.5);
}

.theme-v2 .modal {
    background: var(--surface-default);
    border-radius: var(--radius-xlarge);
    box-shadow: var(--shadow-overlay);
}

.theme-v2 .modal-header h2 {
    color: var(--text-primary);
}

.theme-v2 .modal-close {
    color: var(--text-tertiary);
}

.theme-v2 .modal-close:hover {
    color: var(--text-primary);
}

/* App-wide modal (Sessie 92) */
.theme-v2 .app-modal-overlay {
    background: rgba(28, 25, 23, 0.5);
}

.theme-v2 .app-modal {
    background: var(--surface-default);
    border-radius: var(--radius-xlarge);
    box-shadow: var(--shadow-overlay);
}

.theme-v2 .app-modal h3.modal-title-info {
    color: var(--brand-primary);
}

.theme-v2 .app-modal h3.modal-title-warn {
    color: var(--warning-text);
}

.theme-v2 .app-modal h3.modal-title-error {
    color: var(--danger-text);
}

.theme-v2 .app-modal h3.modal-title-success {
    color: var(--success-text);
}

.theme-v2 .app-modal .modal-body {
    color: var(--text-secondary);
}

.theme-v2 .app-modal .btn-modal-primary {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.theme-v2 .app-modal .btn-modal-primary:hover {
    background: var(--brand-hover);
}

.theme-v2 .app-modal .btn-modal-danger {
    background: var(--danger-text);
    color: var(--text-inverse);
}

.theme-v2 .app-modal .btn-modal-danger:hover {
    background: #AE2D1A;
}

.theme-v2 .app-modal .btn-modal-warn {
    background: #D97706;
    color: var(--text-inverse);
}

.theme-v2 .app-modal .btn-modal-warn:hover {
    background: #B45309;
}

.theme-v2 .app-modal .btn-modal-cancel {
    background: var(--surface-sunken);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.theme-v2 .app-modal .btn-modal-cancel:hover {
    background: var(--surface-sidebar-hover);
}

.theme-v2 .app-modal input[type="text"],
.theme-v2 .app-modal input[type="number"],
.theme-v2 .app-modal textarea {
    border: 1px solid var(--border-default);
}

.theme-v2 .app-modal input:focus,
.theme-v2 .app-modal textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

/* Admin modals */
.theme-v2 .admin-modal-overlay {
    background: rgba(28, 25, 23, 0.4);
}

.theme-v2 .admin-modal {
    background: var(--surface-default);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-overlay);
}

.theme-v2 .admin-modal-header {
    border-bottom: 1px solid var(--border-default);
}

.theme-v2 .admin-modal-header h3 {
    color: var(--text-primary);
}

.theme-v2 .admin-modal-close {
    color: var(--text-tertiary);
}

.theme-v2 .admin-modal-close:hover {
    color: var(--text-primary);
}

.theme-v2 .admin-modal-footer {
    border-top: 1px solid var(--border-default);
}

/* Modal body tables */
.theme-v2 .modal-body table th {
    color: var(--text-tertiary);
    border-bottom: 2px solid var(--border-default);
}

.theme-v2 .modal-body table td {
    border-bottom: 1px solid var(--surface-sunken);
}

.theme-v2 .modal-body table tr.total td {
    border-top: 2px solid var(--border-default);
}

.theme-v2 .modal-section {
    border-top: 1px solid var(--border-default);
}

.theme-v2 .modal-section-title {
    color: var(--text-secondary);
}


/* ============================================================
   PHASE 7E: NOTIFICATIONS & TOOLTIPS
   ============================================================ */

.theme-v2 .notification {
    box-shadow: var(--shadow-overlay);
    border-radius: var(--radius-large);
}

.theme-v2 .notification-info {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .notification-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .notification-error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .tooltip {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-small);
}


/* ============================================================
   PHASE 7F: FILTER BAR, SEARCH & CHIPS
   ============================================================ */

.theme-v2 .filter-bar {
    background: var(--surface-default);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-large);
    box-shadow: 0 2px 4px rgba(28, 25, 23, 0.04);
}

.theme-v2 .filter-bar .form-group label {
    color: var(--text-tertiary);
}

.theme-v2 .search-input-inner svg {
    color: var(--text-tertiary);
}

.theme-v2 .quick-filters {
    border-top: 1px solid var(--border-default);
}

.theme-v2 .quick-filters-label {
    color: var(--text-tertiary);
}

.theme-v2 .chip {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
}

.theme-v2 .chip:hover {
    background: var(--surface-sunken);
    border-color: var(--border-bold);
}

.theme-v2 .chip.active {
    background: var(--brand-subtle);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.theme-v2 .chip .chip-count {
    background: rgba(28, 25, 23, 0.08);
}

.theme-v2 .chip.active .chip-count {
    background: rgba(27, 94, 66, 0.15);
}

/* Inline search */
.theme-v2 .inline-search {
    border-bottom: 1px solid var(--border-default);
}

.theme-v2 .inline-search .search-input-inner input {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    color: var(--text-primary);
}

.theme-v2 .inline-search .search-input-inner input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

.theme-v2 .inline-search select {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    color: var(--text-secondary);
}


/* ============================================================
   PHASE 7G: STATUS WORKFLOW
   ============================================================ */

.theme-v2 .status-workflow {
    background: var(--surface-default);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-large);
}

.theme-v2 .workflow-step {
    color: var(--text-tertiary);
}

.theme-v2 .workflow-step.completed {
    color: var(--success-text);
    background: var(--success-bg);
}

.theme-v2 .workflow-step.current {
    color: var(--brand-primary);
    background: var(--brand-subtle);
}

.theme-v2 .workflow-connector {
    background: var(--border-default);
}

.theme-v2 .workflow-connector.done {
    background: var(--success-border);
}

.theme-v2 .workflow-step.completed .workflow-icon {
    background: var(--success-text);
    color: var(--text-inverse);
}

.theme-v2 .workflow-step.current .workflow-icon {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.theme-v2 .workflow-step .workflow-icon {
    background: var(--border-default);
    color: var(--text-tertiary);
}


/* ============================================================
   PHASE 7H: MONTH GROUPS & LINE CARDS & NOTES
   ============================================================ */

/* Month groups (billing) */
.theme-v2 .month-group {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-large);
}

.theme-v2 .month-group-header {
    background: var(--surface-sunken);
}

.theme-v2 .month-group-header:hover {
    background: var(--surface-sidebar-hover);
}

.theme-v2 .month-group-title {
    color: var(--text-primary);
}

.theme-v2 .month-group-meta {
    color: var(--text-tertiary);
}

.theme-v2 .month-group-total {
    color: var(--text-primary);
}

/* Line cards */
.theme-v2 .line-card {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    border-radius: var(--radius-large);
}

.theme-v2 .line-card:hover {
    border-color: var(--border-bold);
}

.theme-v2 .line-card-title {
    color: var(--text-primary);
}

.theme-v2 .line-card-meta {
    color: var(--text-tertiary);
}

.theme-v2 .line-card-amount {
    color: var(--text-primary);
}

.theme-v2 .line-card-amount-sub {
    color: var(--text-tertiary);
}

/* Notes */
.theme-v2 .note-bubble {
    background: var(--surface-sunken);
    border-radius: var(--radius-large);
}

.theme-v2 .note-author {
    color: var(--text-secondary);
}

.theme-v2 .note-time {
    color: var(--text-tertiary);
}

.theme-v2 .note-text {
    color: var(--text-primary);
}

/* Audit entries */
.theme-v2 .audit-entry {
    border-bottom: 1px solid var(--border-default);
}

.theme-v2 .audit-time {
    color: var(--text-tertiary);
}

.theme-v2 .audit-text {
    color: var(--text-secondary);
}


/* ============================================================
   PHASE 7I: TIMELINE HEATMAP
   ============================================================ */

.theme-v2 .tl-paid {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .tl-invoiced {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .tl-planned {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .tl-overdue {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .timeline-legend {
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-default);
}


/* ============================================================
   PHASE 7J: UPLOAD PAGE
   ============================================================ */

.theme-v2 .upload-section h2 {
    color: var(--text-secondary);
}

.theme-v2 .upload-card {
    background: var(--surface-default);
    box-shadow: var(--shadow-raised);
}

.theme-v2 .upload-icon {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .upload-icon.optional {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .upload-info h3 {
    color: var(--text-primary);
}

.theme-v2 .upload-info p {
    color: var(--text-tertiary);
}

.theme-v2 .status-indicator.pending {
    background: var(--border-default);
}

.theme-v2 .status-indicator.valid {
    background: var(--success-text);
}

.theme-v2 .status-indicator.invalid {
    background: var(--danger-text);
}

.theme-v2 .status-indicator.uploading {
    background: var(--brand-primary);
}

.theme-v2 .status-indicator.optional {
    background: var(--surface-sunken);
    border: 2px dashed var(--border-default);
}

.theme-v2 .upload-dropzone {
    border: 2px dashed var(--border-default);
    color: var(--text-tertiary);
    border-radius: var(--radius-large);
}

.theme-v2 .upload-dropzone:hover,
.theme-v2 .upload-dropzone.dragover {
    border-color: var(--brand-primary);
    background: var(--brand-subtle);
}

.theme-v2 .file-result.valid {
    background: var(--success-bg);
}

.theme-v2 .file-result.invalid {
    background: var(--danger-bg);
}

.theme-v2 .row-count {
    color: var(--success-text);
}

.theme-v2 .error-list,
.theme-v2 .error-text {
    color: var(--danger-text);
}

.theme-v2 .uploading-text {
    color: var(--brand-primary);
}

.theme-v2 .upload-footer {
    background: var(--surface-default);
    border-top: 1px solid var(--border-default);
}

.theme-v2 .upload-summary {
    color: var(--text-tertiary);
}


/* ============================================================
   PHASE 7K: ADMIN STYLES
   ============================================================ */

.theme-v2 .admin-section-title {
    color: var(--text-primary);
}

.theme-v2 .admin-panel-header h4,
.theme-v2 .admin-panel-header h3 {
    color: var(--text-primary);
}

.theme-v2 .admin-table th {
    background: var(--surface-sunken);
    border-bottom: 2px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: none;
    font-weight: 500;
}

.theme-v2 .admin-table td {
    border-bottom: 1px solid var(--surface-sunken);
    color: var(--text-primary);
}

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

.theme-v2 .btn-icon-sm {
    border: 1px solid var(--border-default);
    color: var(--text-tertiary);
}

.theme-v2 .btn-icon-sm:hover {
    background: var(--surface-sunken);
    color: var(--text-primary);
}

.theme-v2 .btn-danger-sm {
    color: var(--danger-text);
}

.theme-v2 .btn-danger-sm:hover {
    background: var(--danger-bg);
}

.theme-v2 .btn-success-sm {
    color: var(--success-text);
}

.theme-v2 .btn-success-sm:hover {
    background: var(--success-bg);
}

.theme-v2 .role-badge {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .system-badge {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .perm-badge {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .status-active {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .status-inactive {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

/* RBAC matrix */
.theme-v2 .rbac-matrix-table thead th {
    background: var(--surface-sunken);
    border-bottom: 2px solid var(--border-default);
    color: var(--text-tertiary);
}

.theme-v2 .rbac-matrix-table tbody td {
    border-bottom: 1px solid var(--surface-sunken);
}

.theme-v2 .rbac-matrix-table input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

.theme-v2 .rbac-matrix-table .rbac-module-toggle {
    accent-color: #6366F1;
}

.theme-v2 .rbac-matrix-table .rbac-row-toggle {
    accent-color: var(--success-text);
}

.theme-v2 .perm-badge-partial {
    background: var(--warning-bg) !important;
    color: var(--warning-text) !important;
}

.theme-v2 .permission-item {
    color: var(--text-primary);
}

.theme-v2 .permission-item:hover {
    background: var(--surface-sunken);
}

.theme-v2 .permission-item input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

/* Admin: Exact/Instellingen section inline-style overrides */
.theme-v2 #section-exact p[style*="color:#64748b"],
.theme-v2 #section-instellingen p[style*="color:#64748b"],
.theme-v2 #section-exact span[style*="color:#64748b"],
.theme-v2 #section-instellingen span[style*="color:#64748b"] {
    color: var(--text-secondary) !important;
}

.theme-v2 #section-exact div[style*="color:#64748b"],
.theme-v2 #section-instellingen div[style*="color:#64748b"] {
    color: var(--text-secondary) !important;
}

/* Admin: info/notice boxes with blue tint → brand */
.theme-v2 #inviteNotice,
.theme-v2 div[style*="background:#eff6ff"] {
    background: var(--brand-subtle) !important;
    border-color: rgba(27, 94, 66, 0.2) !important;
    color: var(--brand-primary) !important;
}

/* Admin: form input focus rings */
.theme-v2 .admin-panel input:focus,
.theme-v2 .admin-panel select:focus,
.theme-v2 .admin-panel textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
    outline: none !important;
}

/* Admin: inline checkboxes */
.theme-v2 .admin-panel input[type="checkbox"] {
    accent-color: var(--brand-primary) !important;
}

/* Admin: GL type colors (asset blue → brand) */
.theme-v2 .gl-type-badge[style*="background:#2563eb"],
.theme-v2 .gl-type-badge[style*="background: #2563eb"] {
    background: var(--brand-primary) !important;
}

/* Admin: linked status text (blue → brand) */
.theme-v2 span[style*="color:#2563eb"] {
    color: var(--brand-primary) !important;
}

/* Admin: help section in admin (blue top border → brand) */
.theme-v2 .help-section[style*="border-top:2px solid #2563eb"] {
    border-top-color: var(--brand-primary) !important;
}


/* ============================================================
   PHASE 7L: MISC BADGES & INDICATORS
   ============================================================ */

/* Date/year badges */
.theme-v2 .date-badge {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .year-badge {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

/* Source tag */
.theme-v2 .source-tag {
    background: #E0E7FF;
    color: #4338CA;
}

/* Safe zone */
.theme-v2 .safe-zone-ok {
    color: var(--success-text);
}

.theme-v2 .safe-zone-warning {
    color: var(--danger-text);
}

.theme-v2 .safe-zone-legend {
    color: var(--text-tertiary);
}

/* BTW indicator */
.theme-v2 .btw-indicator {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

/* Formula box */
.theme-v2 .formula {
    background: var(--surface-sunken);
}

.theme-v2 .formula-box {
    background: var(--surface-sunken);
    border: 1px solid var(--border-default);
}

.theme-v2 .formula-box .highlight {
    color: var(--brand-primary);
}

.theme-v2 .formula-box .green {
    color: var(--success-text);
}

.theme-v2 .formula-box .red {
    color: var(--danger-text);
}

.theme-v2 .formula-box .orange {
    color: #EA580C;
}

/* ID badges */
.theme-v2 .id-badge,
.theme-v2 .id-badge-lg,
.theme-v2 .id-badge-contract {
    font-family: inherit;
    background: var(--surface-sunken);
    color: var(--text-secondary);
}

.theme-v2 .id-badge-line {
    background: var(--purple-bg);
    color: var(--purple-text);
}

.theme-v2 .id-badge-billing {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .id-badge-invoice {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .id-badge-po {
    background: rgba(27, 94, 66, 0.08);
    color: var(--brand-primary);
}

.theme-v2 .gl-ref-badge {
    background: var(--surface-sunken);
    color: var(--text-secondary);
}

.theme-v2 .article-badge {
    background: var(--brand-subtle, rgba(27, 94, 66, 0.08));
    color: var(--brand-primary, #1B5E42);
}

.theme-v2 .gl-code-badge {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

/* Activity op badges */
.theme-v2 .activity-op.op-create,
.theme-v2 .history-op-badge.op-create,
.theme-v2 .history-op-badge.op-from_billings {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .activity-op.op-update,
.theme-v2 .history-op-badge.op-update,
.theme-v2 .activity-op.op-password_change {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .activity-op.op-delete,
.theme-v2 .history-op-badge.op-delete {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .activity-op.op-login,
.theme-v2 .activity-op.op-password_reset {
    background: var(--purple-bg);
    color: var(--purple-text);
}

.theme-v2 .activity-op.op-logout {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .activity-op.op-login_failed {
    background: var(--warning-bg);
    color: var(--warning-text);
}

/* Currency badges */
.theme-v2 .currency-badge.usd {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .currency-badge.eur {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .currency-select {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
}

.theme-v2 .non-eur-info-box {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}


/* ============================================================
   PHASE 7M: DETAIL PANEL (slide-in)
   ============================================================ */

.theme-v2 .detail-panel-overlay {
    background: rgba(28, 25, 23, 0.15);
}

.theme-v2 .detail-panel {
    background: var(--surface-default);
    box-shadow: -8px 0 24px rgba(28, 25, 23, 0.12);
}

.theme-v2 .detail-panel-header {
    border-bottom: 1px solid var(--border-default);
    background: var(--surface-sunken);
}

.theme-v2 .detail-panel-header h2 {
    color: var(--text-primary);
}

.theme-v2 .detail-panel-header .subtitle {
    color: var(--text-tertiary);
}

.theme-v2 .panel-close {
    color: var(--text-tertiary);
}

.theme-v2 .panel-close:hover {
    color: var(--text-primary);
}

.theme-v2 .panel-tabs {
    border-bottom: 1px solid var(--border-default);
    background: var(--surface-default);
}

.theme-v2 .panel-tab {
    color: var(--text-tertiary);
    border-bottom: 2px solid transparent;
}

.theme-v2 .panel-tab:hover {
    color: var(--text-primary);
}

.theme-v2 .panel-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.theme-v2 .field-section h4 {
    color: var(--text-tertiary);
}

.theme-v2 .field-row {
    border-bottom: 1px solid var(--surface-sunken);
}

.theme-v2 .field-row .label {
    color: var(--text-tertiary);
}

.theme-v2 .field-row .value {
    color: var(--text-primary);
}

.theme-v2 .field-row .value.empty {
    color: var(--border-default);
}

/* Mini tables in panels */
.theme-v2 .mini-table th {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default);
}

.theme-v2 .mini-table td {
    border-bottom: 1px solid var(--surface-sunken);
    color: var(--text-primary);
}

.theme-v2 .mini-table tr:hover td {
    background: var(--surface-sunken);
}

.theme-v2 .mini-table .clickable-row:hover td {
    background: var(--brand-subtle);
}

/* Invoice status in panels */
.theme-v2 .inv-status.draft {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .inv-status.approved {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .inv-status.sent_to_exact {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .inv-status.invoiced {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .inv-status.paid {
    background: var(--success-bg);
    color: #065F46;
}


/* ============================================================
   PHASE 7N: MULTI-SELECT & COLUMN FILTER DROPDOWNS
   ============================================================ */

.theme-v2 .ms-trigger {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    color: var(--text-primary);
}

.theme-v2 .ms-trigger:hover {
    border-color: var(--border-bold);
}

.theme-v2 .ms-trigger.active {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

.theme-v2 .ms-trigger-text.placeholder {
    color: var(--text-tertiary);
}

.theme-v2 .ms-badge {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .ms-chevron,
.theme-v2 .ms-clear {
    color: var(--text-tertiary);
}

.theme-v2 .ms-clear:hover {
    color: var(--danger-text);
}

.theme-v2 .ms-dropdown {
    background: var(--surface-default);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-overlay);
}

.theme-v2 .ms-search {
    border-bottom: 1px solid var(--border-default);
}

.theme-v2 .ms-search::placeholder {
    color: var(--text-tertiary);
}

.theme-v2 .ms-option {
    color: var(--text-primary);
}

.theme-v2 .ms-option:hover {
    background: var(--surface-sunken);
}

.theme-v2 .ms-option.selected {
    background: var(--brand-subtle);
}

.theme-v2 .ms-option input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

/* Column filter dropdowns */
.theme-v2 .th-filter-dot {
    background: var(--brand-primary);
}

.theme-v2 .col-dropdown {
    background: var(--surface-default);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-overlay);
}

.theme-v2 .col-dd-item:hover {
    background: var(--surface-sunken);
}

.theme-v2 .col-dd-item.active {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .col-dd-divider {
    background: var(--border-default);
}

.theme-v2 .col-dd-label {
    color: var(--text-tertiary);
}

.theme-v2 .col-dd-input,
.theme-v2 .col-dd-search {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
}

.theme-v2 .col-dd-input:focus,
.theme-v2 .col-dd-search:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
}

.theme-v2 .col-dd-check-item:hover {
    background: var(--surface-sunken);
}

.theme-v2 .col-dd-check-item input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

.theme-v2 .col-dd-count {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.theme-v2 .col-dd-clear {
    color: var(--danger-text);
}

.theme-v2 .col-dd-clear:hover {
    background: var(--danger-bg);
}


/* ============================================================
   PHASE 7O: PAGE HELP PANEL
   ============================================================ */

.theme-v2 .page-help-overlay {
    background: rgba(28, 25, 23, 0.15);
}

.theme-v2 .page-help-panel {
    background: var(--surface-default);
    box-shadow: -4px 0 24px rgba(28, 25, 23, 0.12);
}

.theme-v2 .page-help-header {
    background: var(--brand-subtle);
    border-bottom: 1px solid rgba(27, 94, 66, 0.15);
}

.theme-v2 .page-help-header h3 {
    color: var(--brand-primary);
}

.theme-v2 .page-help-close {
    color: var(--text-tertiary);
}

.theme-v2 .page-help-close:hover {
    background: rgba(27, 94, 66, 0.12);
    color: var(--brand-primary);
}

.theme-v2 .page-help-footer {
    border-top: 1px solid var(--border-default);
    background: var(--surface-sunken);
}

.theme-v2 .page-help-footer a {
    color: var(--brand-primary);
}

.theme-v2 .btn-help {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    color: var(--text-tertiary);
}

.theme-v2 .btn-help:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-subtle);
}


/* ============================================================
   PHASE 7P: HELP PAGE CONTENT
   ============================================================ */

.theme-v2 .help-section {
    background: var(--surface-default);
    box-shadow: var(--shadow-raised);
}

.theme-v2 .help-section h2 {
    color: var(--brand-primary);
    border-bottom: 2px solid var(--border-default);
}

.theme-v2 .help-section h3 {
    color: var(--text-primary);
}

.theme-v2 .help-section p,
.theme-v2 .help-section ul,
.theme-v2 .help-section ol {
    color: var(--text-secondary);
}

.theme-v2 .info-table th {
    background: var(--surface-sunken);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-default);
}

.theme-v2 .info-table td {
    border-bottom: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.theme-v2 .icon-item {
    background: var(--surface-sunken);
}

.theme-v2 .example-box {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.theme-v2 .example-box strong {
    color: var(--warning-text);
}

.theme-v2 .tip-box {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.theme-v2 .tip-box strong {
    color: var(--success-text);
}

.theme-v2 .warning-box {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
}

.theme-v2 .warning-box strong {
    color: var(--danger-text);
}

/* Help page: TOC, header, back-link (V1 blue/slate → V2 tokens) */
.theme-v2 .toc {
    background: var(--surface-sunken) !important;
}

.theme-v2 .toc h3 {
    color: var(--text-secondary) !important;
}

.theme-v2 .toc a {
    color: var(--brand-primary) !important;
}

.theme-v2 .toc a:hover {
    color: var(--brand-hover, #155237) !important;
}

.theme-v2 .help-header h1 {
    color: var(--text-primary) !important;
}

.theme-v2 .help-header p {
    color: var(--text-secondary) !important;
}

.theme-v2 .back-link {
    color: var(--brand-primary) !important;
}

.theme-v2 .back-link:hover {
    color: var(--brand-hover, #155237) !important;
}


/* ============================================================
   PHASE 7Q: KPI PAGE SPECIFIC
   ============================================================ */

.theme-v2 .kpi-grid th {
    background: var(--surface-sunken);
    border-bottom: 2px solid var(--border-default);
    color: var(--text-secondary);
}

.theme-v2 .kpi-grid td {
    border-bottom: 1px solid var(--surface-sunken);
}

.theme-v2 .kpi-cell:hover {
    background: var(--surface-sunken);
}

.theme-v2 .kpi-cell.green {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .kpi-cell.red {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .kpi-cell.empty {
    color: var(--border-default);
}

.theme-v2 .kpi-cell input {
    border: 1px solid rgba(27, 94, 66, 0.3);
}

.theme-v2 .kpi-norm-badge {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .kpi-auto-badge {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .kpi-direction-badge.higher {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .kpi-direction-badge.lower {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .kpi-dept-finance td:first-child {
    border-left-color: var(--brand-primary);
}

.theme-v2 .kpi-dept-sales td:first-child {
    border-left-color: var(--success-text);
}

.theme-v2 .kpi-dept-operations td:first-child {
    border-left-color: var(--purple-text);
}

.theme-v2 .kpi-dept-product td:first-child {
    border-left-color: var(--warning-text);
}

.theme-v2 .kpi-admin-table th {
    background: var(--surface-sunken);
    border-bottom: 2px solid var(--border-default);
}

.theme-v2 .kpi-admin-table td {
    border-bottom: 1px solid var(--surface-sunken);
}

.theme-v2 .kpi-admin-table tr:hover td {
    background: var(--surface-sunken);
}

.theme-v2 .kpi-calc-btn {
    background: var(--brand-subtle);
    color: var(--brand-primary);
    border: 1px solid rgba(27, 94, 66, 0.3);
}

.theme-v2 .kpi-calc-btn:hover {
    background: rgba(27, 94, 66, 0.15);
}


/* ============================================================
   PHASE 7R: AUDIT HISTORY & EXACT SYNC
   ============================================================ */

.theme-v2 .audit-history {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
}

.theme-v2 .audit-history-header {
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border-default);
}

.theme-v2 .audit-history-header:hover {
    background: var(--surface-sidebar-hover);
}

.theme-v2 .audit-history-title {
    color: var(--text-primary);
}

.theme-v2 .audit-history-badge {
    background: var(--border-default);
    color: var(--text-secondary);
}

.theme-v2 .audit-history-chevron {
    color: var(--text-tertiary);
}

.theme-v2 .audit-history-empty {
    color: var(--text-tertiary);
}

.theme-v2 .audit-history-table th {
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border-default);
    color: var(--text-tertiary);
}

.theme-v2 .audit-history-table td {
    border-bottom: 1px solid var(--surface-sunken);
    color: var(--text-primary);
}

.theme-v2 .audit-history-table tr:hover td {
    background: var(--surface-sunken);
}

.theme-v2 .audit-history-table .history-time {
    color: var(--text-tertiary);
}

.theme-v2 .audit-history-table .history-detail {
    color: var(--text-tertiary);
}

.theme-v2 .audit-history-footer {
    background: var(--surface-sunken);
    border-top: 1px solid var(--border-default);
    color: var(--text-tertiary);
}

.theme-v2 .audit-history-footer button {
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    color: var(--text-secondary);
}

.theme-v2 .audit-history-footer button:hover {
    background: var(--surface-sunken);
}

/* Exact Online sync */
.theme-v2 .exact-sync-card {
    background: var(--surface-sunken);
    border: 1px solid var(--border-default);
}

.theme-v2 .exact-sync-card:hover {
    border-color: var(--border-bold);
}

.theme-v2 .exact-sync-count {
    color: var(--text-tertiary);
    background: var(--border-default);
}

.theme-v2 .exact-sync-result {
    background: var(--surface-sunken);
}


/* ============================================================
   PHASE 7S: EMPTY STATE & DEEP LINK & STAGING
   ============================================================ */

.theme-v2 .empty-state {
    background: var(--surface-default);
}

.theme-v2 .empty-state h3 {
    color: var(--text-tertiary);
}

.theme-v2 .empty-state p {
    color: var(--text-tertiary);
}

.theme-v2 .deep-link-banner {
    background: var(--brand-subtle);
    border: 1px solid rgba(27, 94, 66, 0.2);
    color: var(--brand-primary);
}

.theme-v2 .deep-link-banner .deep-link-clear {
    border: 1px solid rgba(27, 94, 66, 0.3);
    color: var(--brand-primary);
}

.theme-v2 .deep-link-banner .deep-link-clear:hover {
    background: rgba(27, 94, 66, 0.15);
}

.theme-v2 .staging-banner {
    background: #D97706;
    color: #FFFFFF;
}


/* ============================================================
   PHASE 7T: CHANGE PASSWORD PAGE
   ============================================================ */

.theme-v2 .change-pw-card {
    background: var(--surface-default);
    border: 1px solid var(--border-default);
}

.theme-v2 .change-pw-card h2 {
    color: var(--text-primary);
}

.theme-v2 .change-pw-notice {
    background: var(--brand-subtle);
    color: var(--brand-primary);
    border: 1px solid rgba(27, 94, 66, 0.2);
}

.theme-v2 .pw-strength {
    background: var(--border-default);
}

.theme-v2 .pw-strength-bar.weak {
    background: var(--danger-text);
}

.theme-v2 .pw-strength-bar.fair {
    background: #D97706;
}

.theme-v2 .pw-strength-bar.good {
    background: var(--brand-primary);
}

.theme-v2 .pw-strength-bar.strong {
    background: var(--success-text);
}

.theme-v2 .pw-req {
    color: var(--text-tertiary);
}

.theme-v2 .pw-req.met {
    color: var(--success-text);
}


/* ============================================================
   PHASE 7U: CREDIT NOTES
   ============================================================ */

.theme-v2 .cd-status-btn.credited {
    background: var(--purple-bg);
    color: var(--purple-text);
    border-color: var(--purple-border);
}

.theme-v2 .cd-status-btn.credited:hover {
    background: #EDD5FF;
}

.theme-v2 .credit-info-banner {
    background: var(--purple-bg);
    border: 1px solid var(--purple-border);
    color: var(--purple-text);
}

.theme-v2 .credit-info-banner a {
    color: var(--purple-text);
}

.theme-v2 .credit-info-banner a:hover {
    color: #6D28D9;
}

.theme-v2 .inv-table tbody tr.row-credit {
    background: var(--purple-bg);
}

.theme-v2 .inv-table tbody tr.row-credit:hover {
    background: #EDD5FF;
}


/* ============================================================
   LOGIN PAGE (standalone — uses html.theme-v2)
   ============================================================ */

.theme-v2 .login-page {
    background: linear-gradient(135deg, #1B5E42 0%, #0f2e20 100%);
}

.theme-v2 .login-card {
    background: var(--surface-default);
    box-shadow: 0 4px 24px rgba(28, 25, 23, 0.15);
    border-radius: var(--radius-xlarge);
}

.theme-v2 .login-brand h1 {
    color: var(--text-primary);
}

.theme-v2 .login-brand p {
    color: var(--text-tertiary);
}

.theme-v2 .login-field label {
    color: var(--text-secondary);
}

.theme-v2 .login-field input,
.theme-v2 .login-field select {
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    background: var(--surface-sunken);
    border-radius: var(--radius-medium);
}

.theme-v2 .login-field input:focus,
.theme-v2 .login-field select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15);
    background: var(--surface-default);
}

.theme-v2 .login-btn {
    background: var(--brand-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-medium);
}

.theme-v2 .login-btn:hover {
    background: var(--brand-hover);
}

.theme-v2 .login-btn-secondary {
    background: var(--text-tertiary);
}

.theme-v2 .login-btn-secondary:hover {
    background: var(--text-secondary);
}

.theme-v2 .login-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-medium);
}

.theme-v2 .login-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-medium);
}

.theme-v2 .login-divider {
    border-top: 1px solid var(--border-default);
}

.theme-v2 .login-divider span {
    background: var(--surface-default);
    color: var(--text-tertiary);
}

.theme-v2 .login-footer a {
    color: var(--brand-primary);
}

.theme-v2 .field-hint {
    color: var(--text-tertiary);
}


/* ============================================================
   PHASE 8: TEMPLATE-SPECIFIC INLINE STYLE OVERRIDES
   These override hardcoded colors in template <style> blocks.
   .theme-v2 prefix gives higher specificity automatically.
   ============================================================ */

/* --- contract_detail.html: Status buttons --- */
.theme-v2 .cd-status-btn.expired {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.theme-v2 .cd-status-btn.cancelled {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.theme-v2 .cd-status-btn.active {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.theme-v2 .cd-status-btn.paused {
    background: #E0E7FF;
    color: #3730A3;
    border-color: #A5B4FC;
}

.theme-v2 .cd-status-btn.approved {
    background: var(--brand-subtle);
    color: var(--brand-primary);
    border-color: rgba(27, 94, 66, 0.3);
}

.theme-v2 .cd-status-btn.draft {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
    border-color: var(--border-default);
}

.theme-v2 .cd-status-btn.sent_to_exact {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.theme-v2 .cd-status-btn.invoiced {
    background: var(--brand-subtle);
    color: var(--brand-primary);
    border-color: rgba(27, 94, 66, 0.3);
}

.theme-v2 .cd-status-btn.paid {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

/* --- contract_detail.html: Action buttons --- */
.theme-v2 .cd-renew-btn {
    background: var(--purple-text);
    color: var(--text-inverse);
}

.theme-v2 .cd-renew-btn:hover {
    background: #6D28D9;
}

.theme-v2 .cd-indexation-btn {
    background: #D97706;
    color: var(--text-inverse);
}

.theme-v2 .cd-indexation-btn:hover {
    background: #B45309;
}

.theme-v2 .renewal-indexation {
    background: var(--purple-bg);
    border: 1px solid var(--purple-border);
}

/* --- contract_detail.html: Line history badges --- */
.theme-v2 .lh-op-badge.CREATE {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .lh-op-badge.UPDATE {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .lh-op-badge.GENERATE {
    background: var(--purple-bg);
    color: var(--purple-text);
}

.theme-v2 .lh-op-badge.PROPAGATE {
    background: #FFF7ED;
    color: #EA580C;
}

.theme-v2 .lh-op-badge.RENEW {
    background: var(--purple-bg);
    color: #9333EA;
}

.theme-v2 .lh-op-badge.DELETE {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .lh-op-badge.STATUS_CHANGE {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .lh-op-badge.ARCHIVE {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .lh-op-badge.INDEXATION {
    background: var(--warning-bg);
    color: #D97706;
}

/* --- contract_detail.html: Type badges & buttons --- */
.theme-v2 .cd-func-check {
    background: var(--purple-bg);
    border: 1px solid var(--purple-border);
}

.theme-v2 .type-badge.hybrid {
    background: var(--purple-bg);
    color: #6B21A8;
}

.theme-v2 .cd-type-btn.recurring.active {
    background: var(--purple-bg);
    color: var(--purple-text);
    border-color: var(--purple-text);
}

.theme-v2 .cd-type-btn.onetime.active {
    background: var(--brand-subtle);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.theme-v2 .cd-type-btn.hybrid.active {
    background: var(--purple-bg);
    color: #581C87;
    border-color: var(--purple-text);
}

.theme-v2 .cd-ms-tag {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .cd-note-legacy {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

/* --- contracts.html: Summary bar --- */
.theme-v2 .summary-bar {
    background: var(--surface-sunken);
    border: 1px solid var(--border-default);
}

/* --- dashboard.html / forecast.html: BTW toggle & sliders --- */
.theme-v2 .btw-btn.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.theme-v2 .effective-balance {
    color: var(--success-text);
}

.theme-v2 .slider-item input[type="range"] {
    accent-color: var(--brand-primary);
}

.theme-v2 .daily-kas-pos {
    color: var(--success-text);
}

.theme-v2 .daily-kas-neg {
    color: var(--danger-text);
}

.theme-v2 .daily-cf-pos {
    color: var(--success-text);
}

.theme-v2 .daily-cf-neg {
    color: var(--danger-text);
}

.theme-v2 .period-tag {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .run-dropdown-item.selected {
    background: var(--brand-subtle);
}

/* --- budget.html: Toggle section --- */
.theme-v2 .toggle-section.open {
    background: var(--success-bg);
}

/* --- forecast_v2.html: Tabs & ratio badges --- */
.theme-v2 .fv2-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.theme-v2 .fv2-kpi-card.positive .kpi-value {
    color: var(--success-text);
}

.theme-v2 .fv2-kpi-card.negative .kpi-value {
    color: var(--danger-text);
}

.theme-v2 .fv2-kpi-card.warning .kpi-value {
    color: var(--warning-text);
}

.theme-v2 .fv2-kpi-card.purple .kpi-value {
    color: var(--purple-text);
}

.theme-v2 .fv2-kpi-card.blue .kpi-value {
    color: var(--brand-primary);
}

.theme-v2 .fv2-kpi-explain:hover {
    color: var(--purple-text);
}

.theme-v2 .fv2-ratio-badge.good {
    background: var(--success-bg);
    color: #065F46;
}

.theme-v2 .fv2-ratio-badge.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .fv2-ratio-badge.bad {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* --- forecast_v2.html: Cost type badges --- */
.theme-v2 .fv2-cost-badge.revenue_pct {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .fv2-cost-badge.fixed {
    background: var(--success-bg);
    color: #065F46;
}

.theme-v2 .fv2-cost-badge.per_customer {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .fv2-cost-badge.per_unit {
    background: #EDE9FE;
    color: #5B21B6;
}

.theme-v2 .fv2-cost-badge.fte_based {
    background: #FCE7F3;
    color: #9D174D;
}

.theme-v2 .fv2-cost-badge.step_function {
    background: #FED7AA;
    color: #9A3412;
}

/* --- forecast_v2.html: FTE grid rows --- */
.theme-v2 .fv2-fte-grid tr.fv2-fte-cat-header td {
    background: var(--surface-sunken);
}

.theme-v2 .fv2-fte-grid tr.fv2-fte-demand-row td {
    background: var(--brand-subtle);
}

.theme-v2 .fv2-fte-grid tr.fv2-fte-supply-row td {
    background: var(--success-bg);
}

.theme-v2 .fv2-fte-gap-ok {
    color: var(--success-text);
}

.theme-v2 .fv2-fte-gap-warn {
    color: var(--danger-text);
}

.theme-v2 .fv2-fte-gap-over {
    color: var(--warning-text);
}

/* --- forecast_v2.html: Timeline events --- */
.theme-v2 .tl-event.milestone {
    background: var(--brand-subtle);
    border-left-color: var(--brand-primary);
    color: var(--brand-primary);
}

.theme-v2 .tl-event.threshold {
    background: var(--success-bg);
    border-left-color: var(--success-border);
    color: #065F46;
}

.theme-v2 .tl-event.hire {
    background: var(--warning-bg);
    border-left-color: var(--warning-border);
    color: var(--warning-text);
}

/* --- customers.html: Status dots --- */
.theme-v2 .dot.yellow,
.theme-v2 .status-dot.suspect::before {
    background: #D97706;
}

.theme-v2 .dot.green,
.theme-v2 .status-dot.active::before {
    background: var(--success-text);
}

.theme-v2 .dot.blue,
.theme-v2 .status-dot.prospect::before {
    background: var(--brand-primary);
}

.theme-v2 .dot.gray,
.theme-v2 .status-dot.inactive::before {
    background: var(--text-tertiary);
}

.theme-v2 .dot.purple {
    background: var(--purple-text);
}

/* --- customers.html: Timeline cells --- */
.theme-v2 .timeline-cell.planned {
    background: var(--border-default);
}

.theme-v2 .timeline-cell.invoiced {
    background: var(--brand-subtle);
}

.theme-v2 .timeline-cell.paid {
    background: var(--success-bg);
}

/* --- invoices.html: Stat values & rows --- */
.theme-v2 .stat-value.green {
    color: var(--success-text);
}

.theme-v2 .stat-value.blue {
    color: var(--brand-primary);
}

.theme-v2 .stat-value.orange {
    color: #EA580C;
}

.theme-v2 .stat-value.purple {
    color: var(--purple-text);
}

.theme-v2 .inv-pill.active {
    background: var(--text-primary);
    color: var(--text-inverse);
}

.theme-v2 .inv-row-draft {
    background: var(--warning-bg);
}

.theme-v2 .inv-row-sent {
    background: var(--brand-subtle);
}

.theme-v2 .inv-row-paid {
    background: var(--success-bg);
}

/* --- invoices.html: Action bar --- */
.theme-v2 .inv-action-bar {
    background: var(--text-primary);
    color: var(--text-inverse);
}

.theme-v2 .inv-action-btn.approve {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .inv-action-btn.exact {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .inv-action-btn.exact-all {
    background: #D97706;
    color: var(--text-inverse);
}

/* --- invoices.html: Aging badges --- */
.theme-v2 .aging-ok {
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-v2 .aging-warn {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .aging-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* --- invoice_detail.html: Source badges --- */
.theme-v2 .source-badge.contract {
    background: var(--purple-bg);
    color: var(--purple-text);
}

.theme-v2 .source-badge.manual {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .source-badge.import {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .source-badge.credit_note {
    background: var(--purple-bg);
    color: #9333EA;
}

/* --- kpis.html: Popover status --- */
.theme-v2 .kpi-popover-current-status.green {
    background: var(--success-text);
}

.theme-v2 .kpi-popover-current-status.red {
    background: var(--danger-text);
}

.theme-v2 .kpi-popover-current-status.empty {
    background: var(--border-default);
}

.theme-v2 .kpi-cell.editable:hover {
    outline: 2px solid rgba(27, 94, 66, 0.3);
}

.theme-v2 .kpi-popover-form input:focus {
    border-color: rgba(27, 94, 66, 0.5);
    box-shadow: 0 0 0 3px rgba(27, 94, 66, 0.1);
}

/* --- forecast_v3.html: Categories & drivers --- */
.theme-v2 .fv3-cat {
    background: var(--brand-subtle);
    border: 1px solid rgba(27, 94, 66, 0.15);
}

.theme-v2 .fv3-cat-header:hover {
    background: rgba(27, 94, 66, 0.12);
}

.theme-v2 .fv3-cat-name {
    color: var(--brand-primary);
}

.theme-v2 .fv3-sec {
    background: var(--surface-default);
    border: 1px solid var(--border-default);
}

.theme-v2 .fv3-item-driver.manual {
    background: var(--surface-sunken);
    color: var(--text-tertiary);
}

.theme-v2 .fv3-item-driver.percentage {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .fv3-item-driver.quantity_price {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .fv3-item-driver.growth {
    background: var(--success-bg);
    color: #065F46;
}

.theme-v2 .fv3-item-driver.seasonal {
    background: #EDE9FE;
    color: #5B21B6;
}

/* --- forecast_v3.html: Summary rows --- */
.theme-v2 .fv3-summary-row.positive {
    background: var(--success-bg);
    color: #065F46;
}

.theme-v2 .fv3-summary-row.negative {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .fv3-summary-row.neutral {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

/* --- forecast_v3.html: Year tabs & view buttons --- */
.theme-v2 .fv3-view-btn.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.theme-v2 .fv3-year-tab.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

/* --- forecast_v3.html: Grid rows --- */
.theme-v2 .fv3-grid th.col-total {
    background: var(--brand-subtle);
}

.theme-v2 .fv3-grid .grid-cat-row td {
    background: rgba(27, 94, 66, 0.12);
    color: var(--brand-primary);
}

.theme-v2 .fv3-grid .grid-sec-row td {
    background: var(--brand-subtle);
}

.theme-v2 .fv3-grid .grid-summary-row td {
    background: var(--success-bg);
    color: #065F46;
}

.theme-v2 .fv3-grid .grid-summary-row.negative td {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* --- pricing_studio.html --- */
.theme-v2 .ps-module-item.selected {
    background: var(--brand-subtle);
    border-color: rgba(27, 94, 66, 0.3);
}

.theme-v2 .ps-badge.active,
.theme-v2 .ps-badge.published,
.theme-v2 .ps-badge.accepted {
    background: var(--success-bg);
    color: #065F46;
}

.theme-v2 .ps-badge.inactive,
.theme-v2 .ps-badge.rejected {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.theme-v2 .ps-badge.draft {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.theme-v2 .ps-badge.sent {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .ps-grand-total {
    background: var(--brand-subtle);
    border: 1px solid rgba(27, 94, 66, 0.2);
}

.theme-v2 .ps-grand-total-item.highlight .gt-value {
    color: var(--brand-primary);
}

.theme-v2 .ps-adjust-group {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.theme-v2 .ps-adjust-row input[type="range"]::-webkit-slider-thumb {
    background: #D97706;
}

/* --- purchase_orders.html --- */
.theme-v2 .linked-count.has-links {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.theme-v2 .active-filters-bar {
    background: var(--brand-subtle);
    border: 1px solid rgba(27, 94, 66, 0.2);
    color: var(--brand-primary);
}

/* ============================================================
   V2 FORECAST & DASHBOARD — Sticky Headers & Scenario Bars
   ============================================================ */

/* Sticky header V2 override */
.theme-v2 .sticky-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom: 1px solid var(--border-default, #E5E7EB) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

.theme-v2 .sticky-header h1 {
    color: var(--text-primary, #111827) !important;
    font-weight: 600 !important;
}

.theme-v2 .run-id-badge {
    background: rgba(27, 94, 66, 0.08) !important;
    color: var(--brand-primary, #1B5E42) !important;
}

.theme-v2 .created-badge {
    color: var(--text-tertiary, #9CA3AF) !important;
    background: var(--surface-sunken, #F9FAFB) !important;
}

/* Scenario bar V2 — replace dark blue gradient with warm green */
.theme-v2 .scenario-bar {
    background: linear-gradient(135deg, #1B5E42 0%, #0f3d2c 100%) !important;
    box-shadow: 0 2px 8px rgba(27, 94, 66, 0.2) !important;
}

.theme-v2 .scenario-bar .btw-btn.active {
    background: #4ade80 !important;
    color: #0f2e20 !important;
    border-color: #4ade80 !important;
}

.theme-v2 .scenario-bar .slider-item input[type="range"] {
    accent-color: #4ade80 !important;
}

.theme-v2 .scenario-bar .effective-balance {
    color: #4ade80 !important;
}

/* Selectors bar V2 */
.theme-v2 .fc-selectors-bar {
    background: var(--surface-sunken, #F9FAFB) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

.theme-v2 .fc-selectors select {
    border-color: var(--border-default, #E5E7EB) !important;
    color: var(--text-primary, #111827) !important;
}

.theme-v2 .fc-selectors select:focus {
    border-color: var(--brand-primary, #1B5E42) !important;
    box-shadow: 0 0 0 3px rgba(27, 94, 66, 0.1) !important;
}

.theme-v2 .fc-sep {
    background: var(--border-default, #E5E7EB) !important;
}

/* Dashboard-specific sticky header */
.theme-v2 .dashboard-header.sticky-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom: 1px solid var(--border-default, #E5E7EB) !important;
}

/* Info tooltip V2 */
.theme-v2 .info-tip {
    background: rgba(27, 94, 66, 0.1) !important;
    color: var(--brand-primary, #1B5E42) !important;
}

/* Table header backgrounds in forecast/dashboard */
.theme-v2 .fc-table th,
.theme-v2 .data-table th {
    background: var(--surface-sunken, #F9FAFB) !important;
    color: var(--text-secondary, #6B7280) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
    text-transform: none !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

/* Cashflow table row tinting V2 */
.theme-v2 .data-table td {
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Expand icon V2 */
.theme-v2 .expand-icon:hover {
    color: var(--brand-primary, #1B5E42) !important;
}

/* Correction column styling V2 */
.theme-v2 .correction-in-header,
.theme-v2 .correction-out-header {
    color: var(--brand-primary, #1B5E42) !important;
}


/* ============================================================
   V2 GENERAL PAGE IMPROVEMENTS
   ============================================================ */

/* Page header inline controls V2 */
.theme-v2 .header-controls select,
.theme-v2 .header-controls input[type="text"] {
    border-color: var(--border-default, #E5E7EB) !important;
    background: var(--surface-default, #FFFFFF) !important;
    color: var(--text-primary, #111827) !important;
}

.theme-v2 .header-controls select:focus,
.theme-v2 .header-controls input:focus {
    border-color: var(--brand-primary, #1B5E42) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

/* BTW toggle V2 — green instead of default */
.theme-v2 .btw-toggle {
    border-color: var(--border-default, #E5E7EB) !important;
}

.theme-v2 .btw-btn {
    color: var(--text-secondary, #6B7280) !important;
    background: var(--surface-default, #FFFFFF) !important;
}

.theme-v2 .btw-btn.active {
    background: var(--brand-primary, #1B5E42) !important;
    color: white !important;
}

/* Tab navigation V2 overrides for inline template tabs */
.theme-v2 .tab-btn.active {
    color: var(--brand-primary, #1B5E42) !important;
    border-bottom-color: var(--brand-primary, #1B5E42) !important;
}

.theme-v2 .tab-nav {
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Summary cards V2 on all pages */
.theme-v2 .stat-card {
    border-color: var(--border-default, #E5E7EB) !important;
}

.theme-v2 .stat-label {
    color: var(--text-secondary, #6B7280) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 12px !important;
}

.theme-v2 .stat-value {
    color: var(--text-primary, #111827) !important;
}

/* Search input V2 */
.theme-v2 .search-input {
    border-color: var(--border-default, #E5E7EB) !important;
}

.theme-v2 .search-input:focus {
    border-color: var(--brand-primary, #1B5E42) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

/* Summary bar V2 override */
.theme-v2 .summary-bar {
    background: var(--surface-sunken, #F9FAFB) !important;
    border-color: var(--border-default, #E5E7EB) !important;
}

/* Card borders V2 — consolidated in V2 DETAIL OVERRIDES section below */

/* Pipeline header V2 */
.theme-v2 .pipeline-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Budget header V2 */
.theme-v2 .budget-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Pipeline/Budget summary V2 */
.theme-v2 .pipeline-summary {
    border-color: var(--border-default, #E5E7EB) !important;
    background: var(--surface-sunken, #F9FAFB) !important;
}

/* Forecast V2 header */
.theme-v2 .fv2-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Forecast V3 header */
.theme-v2 .fv3-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Pricing Studio header */
.theme-v2 .ps-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Help header V2 */
.theme-v2 .help-header {
    background: var(--surface-default, #FFFFFF) !important;
    border-bottom-color: var(--border-default, #E5E7EB) !important;
}

/* Badge overrides for V2 — green instead of blue */
.theme-v2 .status-active,
.theme-v2 .status-approved,
.theme-v2 .status-paid {
    background: #ECFDF5 !important;
    color: #047857 !important;
}

/* Primary button overrides in V1 buttons */
.theme-v2 .btn-primary,
.theme-v2 button.btn-primary,
.theme-v2 .cd-status-btn.approved {
    background: var(--brand-primary, #1B5E42) !important;
    color: white !important;
    border-color: var(--brand-primary, #1B5E42) !important;
}

.theme-v2 .btn-primary:hover,
.theme-v2 button.btn-primary:hover {
    background: var(--brand-hover, #155237) !important;
}


/* ============================================================
   PHASE 9: COMPREHENSIVE INLINE STYLE OVERRIDES
   Overrides hardcoded V1 Slate/Blue colors in template <style> blocks.
   Remapping:
     slate-900/800 → --text-primary
     slate-700/600 → --text-secondary
     slate-500/400 → --text-tertiary
     slate-200     → --border-default
     slate-100/50  → --surface-sunken
     blue-500      → --brand-primary
     green-400     → --success-border (accents)
     dark-blue     → Orbital green gradient
   ============================================================ */


/* --- 9A: DASHBOARD + FORECAST: Sticky Header --- */
.theme-v2 .sticky-header {
    background: var(--surface-default) !important;
    border-bottom-color: var(--border-default) !important;
    box-shadow: 0 2px 4px rgba(28, 25, 23, 0.06) !important;
}

.theme-v2 .sticky-header h1 {
    color: var(--text-primary) !important;
}

.theme-v2 .run-id-badge {
    background: var(--surface-sunken) !important;
    color: var(--text-tertiary) !important;
}

.theme-v2 .created-badge {
    color: var(--text-tertiary) !important;
    background: var(--surface-sunken) !important;
}


/* --- 9B: DASHBOARD + FORECAST: Scenario Bar (dark blue → Orbital green) --- */
.theme-v2 .scenario-bar {
    background: linear-gradient(135deg, #1B5E42 0%, #155237 100%) !important;
    box-shadow: 0 2px 8px rgba(27, 94, 66, 0.25) !important;
}

.theme-v2 .scenario-bar .btw-btn.active {
    background: #FFFFFF !important;
    color: var(--brand-primary) !important;
    border-color: #FFFFFF !important;
}

.theme-v2 .scenario-bar .btw-btn:hover:not(.active) {
    background: rgba(255,255,255,0.2) !important;
}

.theme-v2 .effective-balance {
    color: #6EE7B7 !important;
}

.theme-v2 .slider-item input[type="range"] {
    accent-color: #6EE7B7 !important;
}


/* --- 9C: DASHBOARD + FORECAST: Nav/Selectors Bar --- */
.theme-v2 .nav-sticky {
    background: linear-gradient(135deg, #1B5E42 0%, #155237 100%) !important;
    box-shadow: 0 2px 8px rgba(27, 94, 66, 0.2) !important;
}

.theme-v2 .fc-selectors-bar {
    background: var(--surface-sunken) !important;
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .fc-selectors label {
    color: var(--text-tertiary) !important;
}

.theme-v2 .fc-selectors select {
    border-color: var(--border-default) !important;
    color: var(--text-primary) !important;
    background: var(--surface-default) !important;
}

.theme-v2 .fc-selectors select:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .fc-sep {
    background: var(--border-default) !important;
}


/* --- 9D: DASHBOARD: Run Dropdown --- */
.theme-v2 .run-dropdown-trigger {
    background: var(--surface-default) !important;
    border-color: var(--border-default) !important;
    color: var(--text-primary) !important;
}

.theme-v2 .run-dropdown-trigger:hover {
    border-color: var(--border-bold) !important;
}

.theme-v2 .run-dropdown.open .run-dropdown-trigger {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .run-dropdown-menu {
    background: var(--surface-default) !important;
    border-color: var(--border-default) !important;
    box-shadow: var(--shadow-overlay) !important;
}

.theme-v2 .run-dropdown-search {
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .run-dropdown-search svg {
    color: var(--text-tertiary) !important;
}

.theme-v2 .run-dropdown-search input {
    color: var(--text-primary) !important;
}

.theme-v2 .run-dropdown-item {
    border-bottom-color: var(--surface-sunken) !important;
}

.theme-v2 .run-dropdown-item:hover {
    background: var(--surface-sunken) !important;
}

.theme-v2 .run-dropdown-item.selected {
    background: var(--brand-subtle) !important;
}

.theme-v2 .run-dropdown-item-title {
    color: var(--text-primary) !important;
}

.theme-v2 .run-dropdown-item-title .run-id {
    color: var(--text-tertiary) !important;
    background: var(--surface-sunken) !important;
}

.theme-v2 .run-dropdown-item-meta {
    color: var(--text-tertiary) !important;
}


/* --- 9E: DASHBOARD: KPI Cards (inline styles) --- */
.theme-v2 .kpi-card {
    border-color: var(--border-default) !important;
    background: var(--surface-default) !important;
}

.theme-v2 .kpi-card .kpi-label {
    color: var(--text-tertiary) !important;
}

.theme-v2 .kpi-card .kpi-value {
    color: var(--text-primary) !important;
}

.theme-v2 .expand-icon {
    color: var(--text-tertiary) !important;
}

.theme-v2 .expand-icon:hover {
    color: var(--text-primary) !important;
}

.theme-v2 .info-tip {
    background: var(--surface-sunken) !important;
    color: var(--text-tertiary) !important;
}


/* --- 9F: PIPELINE PAGE --- */
.theme-v2 .page-title h1,
.theme-v2 .page-title {
    color: var(--text-primary) !important;
}

.theme-v2 .year-select {
    border-color: var(--border-default) !important;
    color: var(--text-primary) !important;
    background: var(--surface-default) !important;
}

.theme-v2 .add-year-btn {
    border-color: var(--border-default) !important;
    color: var(--text-tertiary) !important;
}

.theme-v2 .add-year-btn:hover {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .pipeline-stat-label {
    color: var(--text-tertiary) !important;
}

.theme-v2 .pipeline-stat-value {
    color: var(--text-primary) !important;
}

.theme-v2 .pipeline-stat-detail {
    color: var(--text-tertiary) !important;
}

.theme-v2 .pipeline-grid thead th {
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .pipeline-grid tbody td {
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .pipeline-grid tbody td:hover {
    background: var(--surface-sunken) !important;
}

.theme-v2 .pipeline-cell-amount {
    color: var(--text-primary) !important;
}

.theme-v2 .prob-badge {
    color: var(--text-tertiary) !important;
    background: var(--surface-sunken) !important;
}

.theme-v2 .pipeline-cell-tooltip {
    background: var(--surface-default) !important;
    border-color: var(--border-default) !important;
    box-shadow: var(--shadow-overlay) !important;
    color: var(--text-primary) !important;
}

.theme-v2 .pipeline-grid .total-row td {
    background: var(--surface-sunken) !important;
    color: var(--text-primary) !important;
    border-top: 2px solid var(--border-bold) !important;
}

.theme-v2 .customer-total {
    color: var(--text-primary) !important;
    background: var(--surface-sunken) !important;
}

.theme-v2 .entry-type-btn {
    background: var(--surface-default) !important;
    border-color: var(--border-default) !important;
    color: var(--text-secondary) !important;
}

.theme-v2 .entry-type-btn.active,
.theme-v2 .entry-type-btn:hover {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
    background: var(--brand-subtle) !important;
}

.theme-v2 .pipeline-footer {
    background: var(--surface-sunken) !important;
    border-top-color: var(--border-default) !important;
    color: var(--text-tertiary) !important;
}

.theme-v2 .pipeline-empty {
    color: var(--text-tertiary) !important;
}

.theme-v2 .pipeline-btw-btn.active {
    background: var(--brand-primary) !important;
    color: var(--text-inverse) !important;
}

.theme-v2 .customer-popup-header {
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .customer-popup-name {
    color: var(--text-primary) !important;
}

.theme-v2 .customer-popup-id {
    color: var(--text-tertiary) !important;
}

.theme-v2 .customer-edit-icon {
    color: var(--text-tertiary) !important;
}

.theme-v2 .customer-edit-icon:hover {
    color: var(--brand-primary) !important;
}

/* Pipeline popover */
.theme-v2 .popover,
.theme-v2 .pipeline-popover {
    background: var(--surface-default) !important;
    border-color: var(--border-default) !important;
    box-shadow: var(--shadow-overlay) !important;
}

.theme-v2 .popover-header {
    border-bottom-color: var(--border-default) !important;
    color: var(--text-primary) !important;
}

.theme-v2 .popover-body {
    color: var(--text-secondary) !important;
}

.theme-v2 .popover-label {
    color: var(--text-tertiary) !important;
}

.theme-v2 .popover-value {
    color: var(--text-primary) !important;
}

/* Pipeline: icon legend inline-style overrides */
.theme-v2 .icon-legend .icon-item span[style*="color:#64748b"] {
    color: var(--text-secondary) !important;
}

/* Pipeline: modal tabs (blue → brand) */
.theme-v2 .pl-modal-tab.active {
    color: var(--brand-primary) !important;
    border-bottom-color: var(--brand-primary) !important;
}

/* Pipeline: stat value purple stays purple (ARR) — no override needed */

/* Pipeline: customer popup status inactive */
.theme-v2 .customer-popup-status.inactive {
    background: var(--surface-sunken) !important;
    color: var(--text-tertiary) !important;
}


/* --- 9G: BUDGET PAGE --- */
.theme-v2 .budget-header .btn-primary {
    background: var(--brand-primary) !important;
}

.theme-v2 .budget-summary-card .label {
    color: var(--text-tertiary) !important;
}

.theme-v2 .budget-summary-card .value {
    color: var(--text-primary) !important;
}

.theme-v2 .budget-summary-card .value.blue {
    color: var(--brand-primary) !important;
}

.theme-v2 .dept-tab {
    background: var(--surface-sunken) !important;
    color: var(--text-tertiary) !important;
    border-color: var(--border-default) !important;
}

.theme-v2 .dept-tab.active {
    color: var(--text-primary) !important;
    background: var(--surface-default) !important;
    border-bottom-color: var(--brand-primary) !important;
}

.theme-v2 .dept-tab .tab-amount {
    color: var(--text-tertiary) !important;
}

.theme-v2 .dept-tab.add-tab {
    border-color: var(--border-default) !important;
    color: var(--text-tertiary) !important;
}

.theme-v2 .dept-tab.add-tab:hover {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .budget-grid thead th {
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
    border-bottom: 2px solid var(--border-bold) !important;
}

.theme-v2 .budget-grid tbody td {
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .budget-grid tbody td input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .budget-grid .total-row td {
    background: var(--surface-sunken) !important;
    border-top: 2px solid var(--border-bold) !important;
}

/* Budget: Summary grid table header (dark blue #1e293b → Orbital green) */
.theme-v2 .summary-grid th {
    background: #1B5E42 !important;
    color: #fff !important;
    border-bottom: none !important;
}

.theme-v2 .summary-grid th.col-total {
    background: #155237 !important;
}

.theme-v2 .summary-grid td {
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .summary-grid .section-row td:first-child {
    color: var(--text-primary) !important;
}

.theme-v2 .summary-grand-row {
    background: #FEF9E7 !important;
    border-top: 2px solid var(--brand-primary) !important;
}

.theme-v2 .summary-grand-row td {
    color: var(--text-primary) !important;
}

/* Budget: Bottom fixed bar (dark blue → Orbital green) */
.theme-v2 .budget-bottom-bar,
.theme-v2 [style*="background: #1e293b"][style*="bottom: 0"] {
    background: linear-gradient(135deg, #1B5E42 0%, #155237 100%) !important;
}

/* Budget: Expand/collapse bar */
.theme-v2 .expand-collapse-bar button:hover {
    background: var(--surface-sunken) !important;
    color: var(--text-primary) !important;
}

/* Budget: dept tab hover */
.theme-v2 .dept-tab:hover {
    background: var(--surface-sunken) !important;
    color: var(--text-primary) !important;
}

/* Budget: category row (blue → brand), section row (green → success) */
.theme-v2 .bg-cat-row {
    background: var(--brand-subtle) !important;
    border-left-color: var(--brand-primary) !important;
}

.theme-v2 .bg-cat-row td {
    color: var(--brand-primary) !important;
}

.theme-v2 .bg-sec-row {
    background: var(--success-bg) !important;
    border-left-color: var(--success-text) !important;
}

.theme-v2 .bg-sec-row td {
    color: var(--success-text) !important;
}

/* Budget: action buttons */
.theme-v2 .bg-action-btn:hover {
    color: var(--brand-primary) !important;
    background: var(--brand-subtle) !important;
    border-color: var(--brand-primary) !important;
}

/* Budget: expand icons */
.theme-v2 .bg-expand-icon.cat {
    color: var(--brand-primary) !important;
}

.theme-v2 .bg-expand-icon.sec {
    color: var(--success-text) !important;
}

/* Budget: cell input */
.theme-v2 .cell-input {
    border-color: var(--brand-primary) !important;
}

.theme-v2 .cell-input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.2) !important;
}

.theme-v2 .freq-select:focus {
    border-color: var(--brand-primary) !important;
}

/* Budget: workflow buttons */
.theme-v2 .btn-workflow-approve {
    background: var(--success-text) !important;
    color: #fff !important;
}

.theme-v2 .btn-workflow-lock {
    background: var(--brand-primary) !important;
    color: #fff !important;
}

.theme-v2 .btn-workflow-lock:hover {
    background: var(--brand-hover, #155237) !important;
}

/* Budget: add line button */
.theme-v2 .bg-add-line-btn {
    color: var(--success-text) !important;
}

.theme-v2 .bg-add-line-btn:hover {
    background: var(--success-bg) !important;
    border-color: var(--success-text) !important;
}

/* Budget: modal save buttons */
.theme-v2 .budget-modal .modal-actions .btn-save {
    background: var(--brand-primary) !important;
    color: #fff !important;
}

.theme-v2 .budget-modal .modal-actions .btn-save:hover {
    background: var(--brand-hover, #155237) !important;
}

/* Budget: confirm popup buttons */
.theme-v2 .confirm-popup .btn-confirm-ok {
    background: var(--brand-primary) !important;
    color: #fff !important;
}

.theme-v2 .confirm-popup .btn-confirm-ok:hover {
    background: var(--brand-hover, #155237) !important;
}

.theme-v2 .confirm-popup h3.confirm-title-info {
    color: var(--brand-primary) !important;
}

/* Budget: form focus rings */
.theme-v2 .confirm-popup input:focus,
.theme-v2 .confirm-popup select:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(27, 94, 66, 0.1) !important;
}

/* Budget: green btn */
.theme-v2 .budget-header .btn-green {
    background: var(--success-text) !important;
}

/* Budget: dept tab add hover (blue → brand) */
.theme-v2 .dept-tab.add-tab:hover {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

/* Budget: audit badges */
.theme-v2 .audit-op-badge.op-copy {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}


/* --- 9G2: CONTRACTS PAGE — Tree Rows --- */

/* Customer rows: blue-grey #eef2f7 → warm cream */
.theme-v2 tr.row-customer {
    background: #F5F0EB !important;
}

.theme-v2 tr.row-customer:hover {
    background: #EDE8E2 !important;
}

.theme-v2 tr.row-customer td {
    border-left-color: var(--brand-primary) !important;
}

.theme-v2 tr.row-customer .expand-icon {
    color: var(--brand-primary) !important;
}

/* Contract rows */
.theme-v2 tr.row-contract {
    background: var(--surface-default) !important;
}

.theme-v2 tr.row-contract:hover {
    background: #F0FAF5 !important;
}

.theme-v2 tr.row-contract .expand-icon {
    color: #22c55e !important;
}

/* Line rows */
.theme-v2 tr.row-line:hover {
    background: #F9FAFB !important;
}

/* Contract row separators */
.theme-v2 tr.row-customer:not(.row-customer-first) td {
    border-top-color: var(--border-default) !important;
}

/* Contracts: tree table header */
.theme-v2 .tree-table thead th {
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-bold) !important;
}

/* Contracts: general table hover */
.theme-v2 .tree-table tbody tr:hover {
    background: var(--surface-sunken) !important;
}

/* Contracts: timeline cells */
.theme-v2 .timeline-cell.planned {
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
}

.theme-v2 .timeline-cell.empty {
    background: var(--surface-default) !important;
    color: var(--text-disabled) !important;
}

/* Contracts: filter & form elements */
.theme-v2 .view-tab:hover {
    background: var(--surface-sunken) !important;
}

.theme-v2 .btn-secondary {
    color: var(--text-secondary) !important;
    border-color: var(--border-default) !important;
}

.theme-v2 .btn-secondary:hover {
    background: var(--surface-sunken) !important;
}

/* Contracts: indexation table */
.theme-v2 .idx-table th {
    background: var(--surface-sunken) !important;
    color: var(--text-tertiary) !important;
    border-bottom-color: var(--border-bold) !important;
}

.theme-v2 .wizard-step {
    background: var(--surface-sunken) !important;
    border-color: var(--border-default) !important;
    color: var(--text-disabled) !important;
}

.theme-v2 .wizard-preview-table th {
    background: var(--surface-sunken) !important;
    color: var(--text-tertiary) !important;
    border-bottom-color: var(--border-bold) !important;
}

/* Contracts: form labels */
.theme-v2 .form-group label {
    color: var(--text-secondary) !important;
}

/* Contracts: total cells */
.theme-v2 .ct-total-cell {
    color: var(--text-secondary) !important;
}

/* --- 9G3: PURCHASE ORDERS PAGE --- */
.theme-v2 .data-table thead th.sorted .sort-icon {
    color: var(--brand-primary) !important;
}

.theme-v2 .col-dd-search:focus,
.theme-v2 .col-dd-input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .col-dd-check-item input[type="checkbox"] {
    accent-color: var(--brand-primary) !important;
}

/* 9G4: detail page overrides consolidated in V2 ALL DETAIL PAGES section */

.theme-v2 .cd-doctype-toggle input:checked + .cd-doctype-req-label {
    color: var(--brand-primary) !important;
}

.theme-v2 .cd-ms-trigger.open {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .cd-ms-option.selected::before {
    color: var(--brand-primary) !important;
}

.theme-v2 .po-picker-search:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .po-picker-item.selected {
    background: #F0FAF5 !important;
    border-left-color: var(--brand-primary) !important;
}

/* --- 9H: FORECAST V2 PAGE --- */
.theme-v2 .fv2-grid td.editable input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .fv2-grid tr.fv2-fte-cat-header td {
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-default) !important;
}

.theme-v2 .fv2-view-toggle {
    background: var(--surface-sunken) !important;
}

.theme-v2 .fv2-view-toggle button.active {
    background: var(--brand-primary) !important;
    color: var(--text-inverse) !important;
}

.theme-v2 .tl-event.milestone {
    background: var(--brand-subtle) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .tl-event.threshold {
    background: var(--success-bg) !important;
    border-color: var(--success-border) !important;
    color: var(--success-text) !important;
}

.theme-v2 .tl-event.hire {
    background: var(--warning-bg) !important;
    border-color: var(--warning-border) !important;
    color: var(--warning-text) !important;
}

.theme-v2 .fv2-kpi-card {
    border-color: var(--border-default) !important;
    background: var(--surface-default) !important;
}

/* Forecast V2: tabs, buttons, KPI blue values, loading, inputs, badges, sliders */
.theme-v2 .fv2-tab.active {
    color: var(--brand-primary) !important;
    border-bottom-color: var(--brand-primary) !important;
}

.theme-v2 .fv2-kpi-card.blue .kpi-value {
    color: var(--brand-primary) !important;
}

.theme-v2 .fv2-btn.primary {
    background: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
}

.theme-v2 .fv2-btn.primary:hover {
    background: var(--brand-hover, #155237) !important;
}

.theme-v2 .fv2-grid td.editable input {
    border-color: var(--brand-primary) !important;
}

.theme-v2 .fv2-loading .spinner {
    border-top-color: var(--brand-primary) !important;
}

.theme-v2 .fv2-cost-badge.revenue_pct {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .fv2-cost-slider::-webkit-slider-thumb {
    background: var(--brand-primary) !important;
}

.theme-v2 .fv2-cost-slider-val {
    color: var(--brand-primary) !important;
}

.theme-v2 .fv2-modal-icon.info {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .fv2-modal-input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(27, 94, 66, 0.1) !important;
}

.theme-v2 .fv2-modal-btn.primary {
    background: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
}

.theme-v2 .fv2-modal-btn.primary:hover {
    background: var(--brand-hover, #155237) !important;
}


/* --- 9H2: FORECAST V2 — Header, Menu Bar & Scenario Chips --- */

/* Scenario chip: selected ring → brand green */
.theme-v2 .fv2-scenario-chip.selected {
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.3) !important;
}

/* Base button: V2 tokens */
.theme-v2 .fv2-btn {
    border-color: var(--border-default, #E5E7EB) !important;
    background: var(--surface-default, #FFFFFF) !important;
    color: var(--text-primary, #111827) !important;
}

.theme-v2 .fv2-btn:hover {
    background: var(--surface-sunken, #F9FAFB) !important;
    border-color: var(--border-bold, #D1D5DB) !important;
}

/* Success button (Excel): soft green instead of filled */
.theme-v2 .fv2-btn.success {
    background: var(--success-bg, #ECFDF5) !important;
    color: var(--success-text, #047857) !important;
    border-color: var(--success-border, #6EE7B7) !important;
}

.theme-v2 .fv2-btn.success:hover {
    background: #D1FAE5 !important;
    border-color: var(--success-text, #047857) !important;
}

/* Header bar small buttons: brand accent on hover */
.theme-v2 .fv2-scenario-bar .fv2-btn.small:hover {
    color: var(--brand-primary, #1B5E42) !important;
    border-color: var(--brand-primary, #1B5E42) !important;
    background: var(--brand-subtle, rgba(27, 94, 66, 0.08)) !important;
}

/* Tab hover: V2 surface tokens */
.theme-v2 .fv2-tab:hover {
    color: var(--text-primary, #111827) !important;
    background: var(--surface-sunken, #F9FAFB) !important;
}

/* Run select dropdown: V2 border + brand green focus ring */
.theme-v2 #runSelect {
    border-color: var(--border-default, #E5E7EB) !important;
    background: var(--surface-default, #FFFFFF) !important;
    color: var(--text-primary, #111827) !important;
}

.theme-v2 #runSelect:focus {
    border-color: var(--brand-primary, #1B5E42) !important;
    box-shadow: 0 0 0 3px rgba(27, 94, 66, 0.1) !important;
    outline: none !important;
}

/* Run/Scenario bar labels: uppercase micro-label style */
.theme-v2 .fv2-scenario-bar > span:first-child {
    color: var(--text-secondary, #6B7280) !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-weight: 600 !important;
}

/* Status badge: ghost outline style (works with JS-applied colors) */
.theme-v2 #runStatusBadge {
    background: transparent !important;
    border: 1px solid currentColor !important;
    border-radius: var(--radius-small, 6px) !important;
    font-size: 0.65rem !important;
    letter-spacing: 0.04em !important;
}

/* Scenario bar: tighter spacing */
.theme-v2 .fv2-scenario-bar {
    margin-bottom: 0.5rem !important;
    gap: 0.5rem !important;
}

/* Tabs: V2 border token + slight top margin for breathing room */
.theme-v2 .fv2-tabs {
    border-bottom-color: var(--border-default, #E5E7EB) !important;
    margin-top: 0.25rem !important;
}


/* --- 9I: FORECAST V3 PAGE --- */
.theme-v2 .fv3-cat-name {
    color: var(--text-primary) !important;
}

.theme-v2 .fv3-cat-type {
    color: var(--text-tertiary) !important;
    background: var(--surface-sunken) !important;
}

.theme-v2 .fv3-summary-row.neutral {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .fv3-year-tab {
    color: var(--text-secondary) !important;
}

.theme-v2 .fv3-year-tab.active {
    background: var(--brand-primary) !important;
    color: var(--text-inverse) !important;
}

.theme-v2 .fv3-grid .grid-cat-row td {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .fv3-grid .grid-sec-row td {
    background: var(--surface-sunken) !important;
}

.theme-v2 .fv3-grid td.cell-editable input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .fv3-grid td.cell-driver {
    color: var(--brand-primary) !important;
    background: var(--brand-subtle) !important;
}

.theme-v2 .fv3-save-bar {
    background: var(--brand-primary) !important;
}

.theme-v2 .fv3-save-bar button {
    background: #6EE7B7 !important;
    color: var(--text-primary) !important;
}

.theme-v2 .fv3-save-bar button:hover {
    background: #3DAA80 !important;
}

/* Forecast V3: tabs, buttons, view toggle, loading, category containers */
.theme-v2 .fv3-tab.active {
    color: var(--brand-primary) !important;
    border-bottom-color: var(--brand-primary) !important;
}

.theme-v2 .fv3-btn.primary {
    background: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
}

.theme-v2 .fv3-btn.primary:hover {
    background: var(--brand-hover, #155237) !important;
}

.theme-v2 .fv3-view-btn.active {
    background: var(--brand-primary) !important;
    color: white !important;
}

.theme-v2 .fv3-item-driver.quantity_price {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .fv3-grid td.cell-editable input {
    border-color: var(--brand-primary) !important;
}

.theme-v2 .fv3-grid td.cell-driver.has-value {
    color: var(--brand-primary) !important;
    background: var(--brand-subtle) !important;
}

.theme-v2 .fv3-loading .spinner {
    border-top-color: var(--brand-primary) !important;
}

.theme-v2 .fv3-header {
    background: var(--surface-default) !important;
    border-bottom-color: var(--border-default) !important;
}


/* --- 9I2: PRICING STUDIO PAGE --- */
.theme-v2 .ps-tab.active {
    color: var(--brand-primary) !important;
    border-bottom-color: var(--brand-primary) !important;
}

.theme-v2 .ps-btn.primary {
    background: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
}

.theme-v2 .ps-btn.primary:hover {
    background: var(--brand-hover, #155237) !important;
}

.theme-v2 .ps-slider::-webkit-slider-thumb {
    background: var(--brand-primary) !important;
}

.theme-v2 .ps-slider-val {
    color: var(--brand-primary) !important;
}

.theme-v2 .ps-form-group input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(27, 94, 66, 0.1) !important;
}

.theme-v2 .ps-module-item-header input[type="checkbox"] {
    accent-color: var(--brand-primary) !important;
}

.theme-v2 .ps-grand-total-item.highlight .gt-value {
    color: var(--brand-primary) !important;
}

.theme-v2 .ps-badge.sent {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .ps-loading .spinner {
    border-top-color: var(--brand-primary) !important;
}

.theme-v2 .ps-modal-icon.info {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

.theme-v2 .ps-modal-btn.primary {
    background: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
}

.theme-v2 .ps-modal-btn.primary:hover {
    background: var(--brand-hover, #155237) !important;
}

.theme-v2 .ps-fm .fg input:focus,
.theme-v2 .ps-fm .fg select:focus,
.theme-v2 .ps-fm .fg textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

.theme-v2 .ps-fm .cb-label input[type="checkbox"] {
    accent-color: var(--brand-primary) !important;
}

.theme-v2 .ps-it-btn.active {
    color: var(--brand-primary) !important;
    border-bottom-color: var(--brand-primary) !important;
}

.theme-v2 .ps-mm-item input[type="checkbox"] {
    accent-color: var(--brand-primary) !important;
}

.theme-v2 .ps-edit-btn:hover {
    color: var(--brand-primary) !important;
    background: var(--brand-subtle) !important;
}


/* --- 9J: BILLING SCHEDULE PAGE --- */
.theme-v2 .tab-btn {
    color: var(--text-tertiary) !important;
    border-bottom-color: transparent !important;
}

.theme-v2 .tab-btn:hover {
    color: var(--text-primary) !important;
}

.theme-v2 .tab-btn.active {
    color: var(--brand-primary) !important;
    border-bottom-color: var(--brand-primary) !important;
}

.theme-v2 .stat-card {
    border-color: var(--border-default) !important;
    background: var(--surface-default) !important;
}

.theme-v2 .stat-label {
    color: var(--text-tertiary) !important;
}

.theme-v2 .stat-value {
    color: var(--text-primary) !important;
}


/* 9K: contract/invoice detail overrides consolidated in V2 ALL DETAIL PAGES section */

/* Contract detail: type toggle buttons */
.theme-v2 .cd-type-btn:hover:not(.active) {
    background: var(--surface-sunken) !important;
}

.theme-v2 .cd-type-btn.onetime.active {
    background: #F0FAF5 !important;
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

/* Contract detail: btn-icon hover */
.theme-v2 .btn-icon:hover {
    color: var(--brand-primary) !important;
}


/* --- 9L: CUSTOMERS PAGE --- */
.theme-v2 .summary-container {
    background: var(--surface-sunken) !important;
    border-color: var(--border-default) !important;
}

.theme-v2 .summary-item {
    color: var(--text-tertiary) !important;
}

.theme-v2 .summary-item .value {
    color: var(--text-primary) !important;
}

.theme-v2 .data-table {
    border-color: var(--border-default) !important;
    font-size: 13px !important;
}

.theme-v2 .data-table thead th {
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
    border-bottom: 2px solid var(--border-bold) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.theme-v2 .data-table thead th:hover {
    background: var(--surface-sidebar-hover) !important;
}

.theme-v2 .data-table thead th.sorted .sort-icon {
    color: var(--brand-primary) !important;
}

.theme-v2 .data-table tbody td {
    border-bottom-color: var(--border-default) !important;
    color: var(--text-primary) !important;
}

.theme-v2 .data-table tbody tr:hover td {
    background: var(--surface-sunken) !important;
}


/* --- 9M: GENERAL FOCUS/ACCENT OVERRIDES --- */
/* Any element with blue focus rings → green */
.theme-v2 input:focus,
.theme-v2 select:focus,
.theme-v2 textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
    outline: none !important;
}

/* Checkboxes and radio buttons */
.theme-v2 input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

.theme-v2 input[type="radio"] {
    accent-color: var(--brand-primary);
}

/* Range sliders */
.theme-v2 input[type="range"] {
    accent-color: var(--brand-primary);
}


/* --- 9N: HEADER META BADGES (shared across pages) --- */
.theme-v2 .header-meta {
    color: var(--text-tertiary) !important;
}

.theme-v2 .header-left {
    color: var(--text-primary) !important;
}


/* --- 9O: PRINT/EXPORT BUTTON --- */
.theme-v2 .print-btn,
.theme-v2 .export-btn {
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-default) !important;
}

.theme-v2 .print-btn:hover,
.theme-v2 .export-btn:hover {
    background: var(--surface-sidebar-hover) !important;
    color: var(--text-primary) !important;
}


/* ============================================================
   V2 ALL DETAIL PAGES — Unified Overrides (Sessie 105)
   Covers: contract, invoice, billing, contract_line, purchase_order
   All detail pages use cd-* classes; page-specific classes below.
   ============================================================ */

/* --- Cards --- */
.theme-v2 .cd-card {
    background: var(--surface-default, #FFFFFF) !important;
    border: 1px solid var(--border-default, #E5E7EB) !important;
    border-radius: 8px !important;
    box-shadow: 0px 1px 1px rgba(30,31,33,0.08) !important;
}
.theme-v2 .cd-card-header {
    background: var(--surface-sunken, #F9FAFB) !important;
    border-bottom: 1px solid var(--border-default, #E5E7EB) !important;
    padding: 16px 24px !important;
}
.theme-v2 .cd-card-header h3 {
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}
.theme-v2 .cd-card-body {
    padding: 20px 24px !important;
}

/* --- Header + back link --- */
.theme-v2 .cd-header h1 {
    font-family: inherit !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}
.theme-v2 .cd-back {
    color: var(--text-tertiary) !important;
}
.theme-v2 .cd-back:hover {
    color: var(--brand-primary) !important;
}
.theme-v2 .cd-customer-badge {
    background: var(--surface-sunken) !important;
    border-color: var(--border-default) !important;
    color: var(--text-secondary) !important;
}
.theme-v2 .cd-customer-badge a {
    color: var(--text-secondary) !important;
}
.theme-v2 .cd-customer-badge a:hover {
    color: var(--brand-primary) !important;
}

/* --- Form grid + labels (uniform across ALL detail pages) --- */
.theme-v2 .cd-form-grid {
    gap: 16px !important;
}
.theme-v2 .cd-form-group label {
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--text-tertiary, #9CA3AF) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}
.theme-v2 .cd-form-group input,
.theme-v2 .cd-form-group select,
.theme-v2 .cd-form-group textarea {
    font-family: inherit !important;
    border: 1px solid var(--border-default, #E5E7EB) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    background: var(--surface-default) !important;
}
.theme-v2 .cd-form-group input:focus,
.theme-v2 .cd-form-group select:focus,
.theme-v2 .cd-form-group textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
    outline: none !important;
}

/* --- Read-only values (shared across all detail pages) --- */
.theme-v2 .cd-form-group .read-only-value,
.theme-v2 .read-only-value {
    font-family: inherit !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    padding: 8px 12px !important;
    background: var(--surface-sunken, #F9FAFB) !important;
    border: 1px solid var(--border-default, #E5E7EB) !important;
    border-radius: 6px !important;
    line-height: 1.4 !important;
}
.theme-v2 .cd-form-group .read-only-value a,
.theme-v2 .read-only-value a {
    color: var(--brand-primary, #1B5E42) !important;
}

/* --- ID badges (mono font, V2 colors) --- */
.theme-v2 .id-badge-lg,
.theme-v2 .cld-id-badge {
    font-family: inherit !important;
    background: var(--surface-sunken) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-default) !important;
}

/* --- Line cards --- */
.theme-v2 .cd-line-card {
    border: 1px solid var(--border-default, #E5E7EB) !important;
    border-radius: 6px !important;
    background: var(--surface-default) !important;
    transition: border-color 0.15s !important;
}
.theme-v2 .cd-line-card:hover {
    border-color: var(--border-bold, #D1D5DB) !important;
}
.theme-v2 .cd-line-id {
    background: var(--purple-bg) !important;
    color: var(--purple-text) !important;
}

/* --- Notes (shared cd-note-* pattern) --- */
.theme-v2 .cd-notes-thread .cd-note-bubble,
.theme-v2 .cd-note-bubble {
    background: var(--surface-sunken) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: 8px !important;
}
.theme-v2 .cd-note-legacy {
    background: #fffbeb !important;
    border-color: var(--border-default) !important;
}
.theme-v2 .cd-notes-input textarea {
    font-family: inherit !important;
    border: 1px solid var(--border-default, #E5E7EB) !important;
    border-radius: 6px !important;
}
.theme-v2 .cd-notes-input textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}

/* --- Buttons V2 overrides (detail pages) --- */
.theme-v2 .cd-delete-btn {
    background: #fef2f2 !important;
    border-color: var(--border-default) !important;
}
.theme-v2 .btn-primary {
    background: var(--brand-primary) !important;
}
.theme-v2 .btn-primary:hover {
    background: var(--brand-primary-hover, #164a35) !important;
}

/* --- Invoice detail specific (.inv-*) --- */
.theme-v2 .inv-billing-id {
    color: var(--purple-text, #7c3aed) !important;
    font-family: inherit !important;
}
.theme-v2 .inv-billing-card {
    border-color: var(--border-default) !important;
}
.theme-v2 .inv-billing-card:hover {
    background: var(--surface-sunken) !important;
}
.theme-v2 .inv-exact-label {
    color: var(--text-tertiary) !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
}
.theme-v2 .inv-exact-value {
    color: var(--text-primary) !important;
    font-family: inherit !important;
}
.theme-v2 .inv-exact-error {
    background: #fef2f2 !important;
    border-color: var(--border-default) !important;
}
.theme-v2 .inv-ref-value {
    font-family: inherit !important;
    color: var(--purple-text, #7c3aed) !important;
}
.theme-v2 .inv-line-idx {
    color: var(--text-quaternary, #a8a29e) !important;
}
.theme-v2 .inv-line-code {
    font-family: inherit !important;
    color: var(--text-tertiary) !important;
}
.theme-v2 .inv-lines-table th {
    color: var(--text-tertiary) !important;
    border-bottom-color: var(--border-default) !important;
}
.theme-v2 .inv-lines-table td {
    border-bottom-color: var(--border-subtle, #f1f0ee) !important;
    color: var(--text-primary) !important;
}
.theme-v2 .inv-lines-table tr:hover td {
    background: var(--surface-sunken) !important;
}
.theme-v2 .inv-lines-table input:focus,
.theme-v2 .inv-lines-table select:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(27, 94, 66, 0.15) !important;
}
.theme-v2 .inv-lines-table .totals-row td {
    border-top-color: var(--border-default) !important;
}
.theme-v2 .inv-lines-table .totals-label {
    color: var(--text-tertiary) !important;
}
.theme-v2 .inv-lines-table .grand-total td {
    color: var(--text-primary) !important;
}

/* --- Contract line detail specific (.cld-*) --- */
.theme-v2 .cld-status-badge.active {
    background: var(--green-bg, #dcfce7) !important;
    color: var(--green-text, #16a34a) !important;
}
.theme-v2 .cld-status-badge.paused {
    background: var(--yellow-bg, #fef3c7) !important;
    color: var(--yellow-text, #d97706) !important;
}
.theme-v2 .cld-status-badge.cancelled {
    background: var(--red-bg, #fee2e2) !important;
    color: var(--red-text, #dc2626) !important;
}
.theme-v2 .cld-billing-table th {
    color: var(--text-tertiary) !important;
    border-bottom-color: var(--border-default) !important;
}
.theme-v2 .cld-billing-table td {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-subtle, #f1f0ee) !important;
}
.theme-v2 .cld-billing-table tr:hover td {
    background: var(--surface-sunken) !important;
}
.theme-v2 .cld-pxq-preview {
    background: var(--purple-bg, #f5f3ff) !important;
    border-color: var(--border-default) !important;
    color: var(--purple-text, #7c3aed) !important;
}

/* --- Purchase order detail specific (.po-*) --- */
.theme-v2 .po-file-info {
    background: var(--surface-sunken) !important;
    border-color: var(--border-default) !important;
}
.theme-v2 .po-file-info a {
    color: var(--brand-primary) !important;
}
.theme-v2 .linked-table thead th {
    background: var(--surface-sunken) !important;
    color: var(--text-tertiary) !important;
    border-bottom-color: var(--border-default) !important;
}
.theme-v2 .linked-table td {
    border-bottom-color: var(--border-subtle, #f1f0ee) !important;
}
.theme-v2 .linked-table tr:hover td {
    background: var(--surface-sunken) !important;
}

/* --- Info link cards (billing detail) --- */
.theme-v2 .info-link-card {
    border-color: var(--border-default) !important;
    background: var(--surface-sunken) !important;
}
.theme-v2 .info-link-card:hover {
    background: var(--surface-hover, #f5f5f4) !important;
}
.theme-v2 .info-link-id {
    color: var(--brand-primary) !important;
    font-family: inherit !important;
}

/* ================================================================
   V2 BILLING PAGE — Tabs, Timeline, Bulk Bar
   ================================================================ */

/* V2 Billing Panel Toggle */
.theme-v2 .v2-bil-hidden { display: none !important; }

/* V2 Tabs */
.theme-v2 .v2-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #e8e0d4;
}
.theme-v2 .v2-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.15s;
}
.theme-v2 .v2-tab:hover { color: #1e293b; }
.theme-v2 .v2-tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }

/* V2 Summary Grid (billing page) */
.theme-v2 .v2-summary-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}
.theme-v2 .v2-summary-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.theme-v2 .v2-summary-card {
    background: white;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    padding: 14px 16px;
}
.theme-v2 .v2-summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 600;
}
.theme-v2 .v2-summary-value { font-size: 24px; font-weight: 700; color: #1e293b; }
.theme-v2 .v2-summary-detail { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* Summary card color variants */
.theme-v2 .v2-summary-card.info { border-left: 3px solid #3b82f6; }
.theme-v2 .v2-summary-card.info .v2-summary-value { color: #3b82f6; }
.theme-v2 .v2-summary-card.positive { border-left: 3px solid #16a34a; }
.theme-v2 .v2-summary-card.positive .v2-summary-value { color: #16a34a; }
.theme-v2 .v2-summary-card.warning { border-left: 3px solid #f59e0b; }
.theme-v2 .v2-summary-card.warning .v2-summary-value { color: #f59e0b; }
.theme-v2 .v2-summary-card.purple { border-left: 3px solid #8b5cf6; }
.theme-v2 .v2-summary-card.purple .v2-summary-value { color: #8b5cf6; }
.theme-v2 .v2-summary-card.neutral { border-left: 3px solid #94a3b8; }
.theme-v2 .v2-summary-card.neutral .v2-summary-value { color: #64748b; }

/* V2 Section Title */
.theme-v2 .v2-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 12px;
}
.theme-v2 .v2-section-title .badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 8px;
}

/* V2 Card */
.theme-v2 .v2-card {
    background: var(--surface-default, #FFFFFF);
    border: 1px solid var(--border-default, #E5E7EB);
    border-radius: 10px;
    padding: 20px;
}

/* NOTE: V2 Page Header, Filter Bar, Chip, Quick Filters —
   authoritative definitions are at the top of this file (lines 80-252).
   Do NOT add duplicate rules here. */

/* V2 Filter bar action buttons (rechts uitgelijnd) */
.theme-v2 .v2-filter-actions {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: auto;
}

/* V2 Bulk selection indicator (inline in quick-filters row) */
.theme-v2 .v2-bulk-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 4px 12px;
    background: rgba(27, 94, 66, 0.06);
    border: 1px solid var(--brand-primary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--brand-primary);
    font-weight: 500;
    white-space: nowrap;
}
.theme-v2 .v2-bulk-indicator .btn-success {
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 4px;
    background: var(--brand-primary, #1B5E42);
    color: #fff;
    border-color: var(--brand-primary, #1B5E42);
    font-weight: 600;
}

/* V2 Timeline cells (consolidated — matches mockup) */
.theme-v2 .v2-timeline-table td { padding: 6px 4px; }
.theme-v2 .tl-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 56px;
    height: 28px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.theme-v2 .tl-paid { background: #ECFDF5; color: #047857; }
.theme-v2 .tl-invoiced { background: #E9F2FF; color: #0C66E4; }
.theme-v2 .tl-planned { background: #FFF7D6; color: #B45309; }
.theme-v2 .tl-overdue { background: #FEF2F2; color: #DC2626; }
.theme-v2 .tl-empty { background: transparent; color: transparent; }

/* V2 Timeline Legend */
.theme-v2 .v2-timeline-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
    flex-wrap: wrap;
}
.theme-v2 .v2-legend-item { display: flex; align-items: center; gap: 6px; }
.theme-v2 .v2-legend-swatch { width: 14px; height: 14px; border-radius: 3px; }

/* V2 Row status tinting for billing table */
.theme-v2 .v2-row-paid { background: #f0fdf4 !important; }
.theme-v2 .v2-row-planned { background: #fffbeb !important; }
.theme-v2 .v2-row-invoiced { background: #eff6ff !important; }

/* Responsive: summary grid 5 cols → 2 cols on mobile */
@media (max-width: 768px) {
    .theme-v2 .v2-summary-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
    .theme-v2 .v2-filter-bar-row { flex-direction: column; align-items: stretch; }
    .theme-v2 .v2-search-wrap input { width: 100%; }
}

/* ============================================================
   GLOBAL SCROLLBAR (thin, subtle)
   ============================================================ */
.theme-v2 ::-webkit-scrollbar { width: 6px; height: 6px; }
.theme-v2 ::-webkit-scrollbar-track { background: transparent; }
.theme-v2 ::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
.theme-v2 ::-webkit-scrollbar-thumb:hover { background: var(--border-bold); }


/* ============================================================
   FORECAST PAGE RESTYLING (v3.65.0)
   Covers: forecast.html + forecast_v3.html
   Tasks 1-7 from Orbital Cashflow Forecast restyle spec
   ============================================================ */

/* -------- TAAK 1: Sticky filterband (white, replaces dark blue) -------- */

.theme-v2 .scenario-bar {
    background: #ffffff !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
    border-bottom: 1px solid #f3f4f6;
    position: sticky;
    z-index: 98;
}

.theme-v2 .scenario-row-1 {
    padding: 8px 20px !important;
}

.theme-v2 .scenario-row-2 {
    border-top: 1px solid #f3f4f6 !important;
    padding: 8px 20px !important;
}

/* Saldo labels → uppercase dot-label */
.theme-v2 .scenario-item label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af !important;
    text-transform: uppercase;
    opacity: 1 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Green dot before bank balance labels */
.theme-v2 .bank-balance-item > label::before,
.theme-v2 .bank-effective-item > label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}
/* Neutral dot for correction label */
.theme-v2 .bank-correction-item > label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}

/* Bank input wrapper → light theme */
.theme-v2 .bank-input-wrapper {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px !important;
}
.theme-v2 .bank-input-wrapper .currency {
    color: var(--text-primary) !important;
}
.theme-v2 .bank-input-wrapper input {
    color: var(--text-primary) !important;
    font-variant-numeric: tabular-nums;
}

/* Bank source text */
.theme-v2 .bank-source {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* Effective balance → dark text, green for positive */
.theme-v2 .effective-balance {
    color: #059669 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
}

/* Slider labels & values → dark text */
.theme-v2 .slider-item label {
    color: #9ca3af !important;
}
.theme-v2 .slider-value {
    color: #374151 !important;
}
.theme-v2 .slider-item input[type="range"] {
    accent-color: #10b981;
}

/* BTW toggle → light theme */
.theme-v2 .btw-btn {
    border: 1px solid #e5e7eb !important;
    background: #ffffff !important;
    color: #6b7280 !important;
}
.theme-v2 .btw-btn:hover:not(.active) {
    background: #f9fafb !important;
    color: #374151 !important;
}
.theme-v2 .btw-btn.active {
    background: var(--brand-primary, #1B5E42) !important;
    color: #ffffff !important;
    border-color: var(--brand-primary, #1B5E42) !important;
}

/* Adjustments section → light theme */
.theme-v2 .adj-section {
    border-left: 1px solid #f3f4f6 !important;
}
.theme-v2 .btw-section {
    border-left: 1px solid #f3f4f6 !important;
}
.theme-v2 #adj-btn {
    background: #f9fafb !important;
    color: #374151 !important;
    border: 1px solid #e5e7eb !important;
}
.theme-v2 #adj-btn:hover {
    background: #f3f4f6 !important;
}

/* Filter selectors bar */
.theme-v2 .fc-selectors-bar {
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
}
.theme-v2 .fc-selectors select {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    appearance: none;
    cursor: pointer;
    transition: background 0.15s;
}
.theme-v2 .fc-selectors select:hover {
    background: #f9fafb;
}
.theme-v2 .fc-selectors select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    border-color: transparent;
}
.theme-v2 .fc-selectors label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-transform: uppercase;
}
.theme-v2 .fc-sep {
    background: #f3f4f6;
}

/* Info-tip → updated styling */
.theme-v2 .info-tip {
    background: #f3f4f6;
    color: #9ca3af;
}
.theme-v2 .info-tip:hover {
    background: #e5e7eb;
    color: #6b7280;
}


/* -------- TAAK 2: KPI tiles (white bg, 2px accent line, dot+label) -------- */

/* Convert summary-card to kpi-tile pattern on forecast page */
.theme-v2 #dashboard-content .card.summary-card,
.theme-v2 #dashboard-content .grid .card[style*="border-left"] {
    background: #ffffff !important;
    border: 1px solid #f3f4f6 !important;
    border-left: 1px solid #f3f4f6 !important;
    border-radius: 12px !important;
    overflow: hidden;
    position: relative;
    box-shadow: none;
    padding-top: 0;
}

/* Accent line at top via ::before */
.theme-v2 #dashboard-content .card.summary-card::before,
.theme-v2 #dashboard-content .grid .card[style*="border-left"]::before {
    content: "";
    display: block;
    height: 2px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Accent colors per variant */
.theme-v2 #dashboard-content .summary-card.neutral::before { background: #10b981; }
.theme-v2 #dashboard-content .summary-card.positive::before { background: #6ee7b7; }
.theme-v2 #dashboard-content .summary-card.warning::before { background: #fbbf24; }
.theme-v2 #dashboard-content .summary-card.negative::before { background: #f87171; }
.theme-v2 #dashboard-content .summary-card.info::before { background: var(--brand-primary); }
.theme-v2 #dashboard-content .summary-card.purple::before { background: #8b5cf6; }

/* Cards with inline border-left colors (ARR %, Current Ratio, etc.) */
.theme-v2 #dashboard-content .grid .card[style*="#8b5cf6"]::before { background: #60a5fa; }
.theme-v2 #dashboard-content .grid .card[style*="#6366f1"]::before { background: #60a5fa; }
.theme-v2 #dashboard-content .grid .card[style*="#3b82f6"]::before { background: #60a5fa; }
.theme-v2 #dashboard-content .grid .card[style*="#22c55e"]::before { background: #6ee7b7; }
.theme-v2 #dashboard-content .grid .card[style*="#dc2626"]::before { background: #f87171; }

/* Override inline border-left styles */
.theme-v2 #dashboard-content .grid .card[style*="border-left"] {
    border-left-color: #f3f4f6 !important;
    border-left-width: 1px !important;
    border-left-style: solid !important;
}

/* Summary label → dot-label pattern */
.theme-v2 #dashboard-content .summary-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

/* Dot before label */
.theme-v2 #dashboard-content .summary-label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Dot colors per variant */
.theme-v2 #dashboard-content .summary-card.neutral .summary-label::before { background: #10b981; }
.theme-v2 #dashboard-content .summary-card.positive .summary-label::before { background: #6ee7b7; }
.theme-v2 #dashboard-content .summary-card.warning .summary-label::before { background: #fbbf24; }
.theme-v2 #dashboard-content .summary-card.negative .summary-label::before { background: #f87171; }

/* Summary value → larger, tabular nums */
.theme-v2 #dashboard-content .summary-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

/* Summary detail */
.theme-v2 #dashboard-content .summary-detail {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    margin-top: 4px;
}

/* KPI tile grid → consistent 12px gap on all forecast grids */
.theme-v2 #dashboard-content .grid.grid-4,
.theme-v2 #dashboard-content .grid.grid-3,
.theme-v2 #dashboard-content .grid.grid-2 {
    gap: 12px;
    margin-bottom: 12px;
}

/* Cards should fill row height and have left-aligned content */
.theme-v2 #dashboard-content .card {
    text-align: left;
    display: flex;
    flex-direction: column;
}

/* Override centered text-align from .summary-card base */
.theme-v2 #dashboard-content .card.summary-card {
    text-align: left;
    padding: 0;
}

/* Pad the card content below the 2px accent line */
.theme-v2 #dashboard-content .card.summary-card .summary-label,
.theme-v2 #dashboard-content .card.summary-card .summary-value,
.theme-v2 #dashboard-content .card.summary-card .summary-detail {
    padding-left: 16px;
    padding-right: 16px;
}
.theme-v2 #dashboard-content .card.summary-card .summary-label {
    padding-top: 14px;
}
.theme-v2 #dashboard-content .card.summary-card .summary-detail {
    padding-bottom: 16px;
}

/* Inline border-left cards (ARR %, Current Ratio etc.) → same padding */
.theme-v2 #dashboard-content .grid .card[style*="border-left"] {
    padding: 14px 16px 16px;
}

/* Row 2 KPI grid: remove inline margin-top */
.theme-v2 #dashboard-content .grid.grid-4[style*="margin-top"] {
    margin-top: 0 !important;
}

/* Chart cards: keep default card styling, no accent line */
.theme-v2 #dashboard-content .grid.grid-2 > .card {
    padding: 20px;
}

/* Section cards (tables): proper padding */
.theme-v2 #dashboard-content .card.section {
    padding: 20px;
}


/* -------- TAAK 3 + 4: Aging buckets & Bank reconciliation -------- */

/* Info-box inside grid → kpi-tile style (white, accent line) */
.theme-v2 #dashboard-content .grid .info-box {
    background: #ffffff !important;
    border: 1px solid #f3f4f6 !important;
    border-left: 1px solid #f3f4f6 !important;
    border-left-width: 1px !important;
    border-radius: 12px !important;
    overflow: hidden;
    position: relative;
    padding: 14px 16px 16px !important;
    padding-top: 18px !important;
}

/* Accent line at top via ::before */
.theme-v2 #dashboard-content .grid .info-box::before {
    content: "";
    display: block;
    height: 2px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Accent colors per aging urgency */
.theme-v2 #dashboard-content .grid .info-box.green::before { background: #10b981; }
.theme-v2 #dashboard-content .grid .info-box.yellow::before { background: #fbbf24; }
.theme-v2 #dashboard-content .grid .info-box.orange::before { background: #f87171; }
.theme-v2 #dashboard-content .grid .info-box.red::before { background: #dc2626; }
.theme-v2 #dashboard-content .grid .info-box.blue::before { background: #10b981; }

/* Info-box label (strong) → uppercase dot-label */
.theme-v2 #dashboard-content .grid .info-box strong {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Dot before label in grid info-boxes */
.theme-v2 #dashboard-content .grid .info-box strong::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.theme-v2 #dashboard-content .grid .info-box.green strong::before { background: #10b981; }
.theme-v2 #dashboard-content .grid .info-box.yellow strong::before { background: #fbbf24; }
.theme-v2 #dashboard-content .grid .info-box.orange strong::before { background: #f87171; }
.theme-v2 #dashboard-content .grid .info-box.red strong::before { background: #dc2626; }
.theme-v2 #dashboard-content .grid .info-box.blue strong::before { background: #10b981; }

/* Big number in info-box → larger, dark text */
.theme-v2 #dashboard-content .grid .info-box .big-number {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Bank reconciliation big numbers → extra large */
.theme-v2 #dashboard-content #bank-section .grid .info-box .big-number {
    font-size: 30px;
}

/* Small text in info-box */
.theme-v2 #dashboard-content .grid .info-box small {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
}

/* Netto tile: dynamic accent based on value (handled by parent color) */
/* Blue → emerald for positive (already mapped above) */

/* Source tags → chip style */
.theme-v2 .source-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    margin-top: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 8px;
}


/* -------- TAAK 5: Warning banners (amber/gray) -------- */

/* Standalone info-box (not in grid) → alert banner style */
.theme-v2 #dashboard-content .card.section > .info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    margin-bottom: 16px;
    border-left: none !important;
}

.theme-v2 #dashboard-content .card.section > .info-box.yellow {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
}
.theme-v2 #dashboard-content .card.section > .info-box.yellow strong {
    color: #92400e;
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
    display: inline;
}
.theme-v2 #dashboard-content .card.section > .info-box.yellow strong::before {
    display: none;
}
.theme-v2 #dashboard-content .card.section > .info-box.yellow {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: #92400e;
}

.theme-v2 #dashboard-content .card.section > .info-box.blue {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
}
.theme-v2 #dashboard-content .card.section > .info-box.blue strong {
    color: #374151;
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
    display: inline;
}
.theme-v2 #dashboard-content .card.section > .info-box.blue strong::before {
    display: none;
}
.theme-v2 #dashboard-content .card.section > .info-box.blue {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: #4b5563;
}


/* -------- TAAK 6: Cashflow prognosis table -------- */

/* Section titles in forecast */
.theme-v2 #dashboard-content .section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Table headers → sticky, uppercase */
.theme-v2 #dashboard-content table thead {
    position: sticky;
    top: 0;
    z-index: 7;
    background: #ffffff;
}
.theme-v2 #dashboard-content table thead tr {
    border-bottom: 1px solid #e5e7eb;
}
.theme-v2 #dashboard-content table th {
    padding: 8px 10px;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    background: #ffffff;
    text-align: left;
}
/* Right-aligned columns keep their alignment */
.theme-v2 #dashboard-content table th.right {
    text-align: right;
}

/* Monthly forecast table: compact column sizing */
.theme-v2 #dashboard-content #monthly-table td {
    padding: 8px 10px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.theme-v2 #dashboard-content #monthly-table td:first-child {
    white-space: normal;
    min-width: 70px;
}

/* Month rows → bolder, distinct background */
.theme-v2 #dashboard-content #monthly-table > tr:not(.daily-row):not(.total) {
    border-top: 1px solid #e5e7eb;
    transition: background 0.15s;
}
.theme-v2 #dashboard-content #monthly-table > tr:not(.daily-row):not(.total):hover {
    background: #f3f4f6;
}
.theme-v2 #dashboard-content #monthly-table > tr:not(.daily-row):not(.total) td {
    padding: 10px 10px;
    font-size: 13px;
    white-space: nowrap;
}
/* Explicit color for cells WITHOUT a color class */
.theme-v2 #dashboard-content #monthly-table > tr:not(.daily-row):not(.total) td:not(.text-green):not(.text-red):not(.text-correction):not(.text-muted) {
    color: #111827;
}

/* Day detail rows → compact, subtle */
.theme-v2 #dashboard-content .daily-row td {
    background: #ffffff !important;
    padding: 5px 10px !important;
    font-size: 11px;
    color: #374151;
    border-bottom: 1px solid #f9fafb;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.theme-v2 #dashboard-content .daily-row td:first-child {
    padding-left: 32px !important;
    color: #6b7280;
    white-space: normal;
}
.theme-v2 #dashboard-content .daily-row:hover td {
    background: rgba(16, 185, 129, 0.04) !important;
}
.theme-v2 #dashboard-content .daily-row .daily-items-tag {
    font-size: 10px;
    color: #9ca3af;
}
.theme-v2 #dashboard-content .daily-row.last-daily td {
    border-bottom: 1px solid #e5e7eb;
}

/* Netto CF daily coloring */
.theme-v2 #dashboard-content .daily-row .daily-cf-pos { color: #10b981; font-weight: 600; }
.theme-v2 #dashboard-content .daily-row .daily-cf-neg { color: #ef4444; font-weight: 600; }

/* Daily kas saldo */
.theme-v2 #dashboard-content .daily-row .daily-kas-pos { color: #10b981; font-style: normal; }
.theme-v2 #dashboard-content .daily-row .daily-kas-neg { color: #ef4444; font-style: normal; }

/* Cell colors — vivid green/red for cashflow direction (matches chart palette) */
.theme-v2 #dashboard-content .text-green { color: #10b981; }
.theme-v2 #dashboard-content .text-red { color: #ef4444; }
.theme-v2 #dashboard-content .text-correction { color: #d97706; }
.theme-v2 #dashboard-content .text-muted { color: #d1d5db; }
.theme-v2 #dashboard-content .font-bold { font-weight: 700; }

/* Negative row background (subtle) */
.theme-v2 #dashboard-content tr.negative:not(.daily-row) td {
    background: rgba(239, 68, 68, 0.04);
}

/* Previous month rows → subtle tint */
.theme-v2 #dashboard-content #monthly-table > tr:not(.daily-row)[style*="background: #f1f5f9"] {
    background: #f9fafb !important;
}

/* Totals row */
.theme-v2 #dashboard-content #monthly-table > tr.total {
    background: #f9fafb !important;
    border-top: 2px solid #e5e7eb;
}
.theme-v2 #dashboard-content #monthly-table > tr.total td {
    font-weight: 700;
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
}
/* Explicit color only for cells WITHOUT a color class */
.theme-v2 #dashboard-content #monthly-table > tr.total td:not(.text-green):not(.text-red):not(.text-correction):not(.text-muted) {
    color: #111827;
}

/* Clickable cells → dotted underline */
.theme-v2 #dashboard-content td.clickable,
.theme-v2 #dashboard-content .clickable {
    text-decoration-style: dotted;
    text-decoration-color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s;
}

/* Expand icon */
.theme-v2 #dashboard-content .expand-icon {
    color: #9ca3af;
}
.theme-v2 #dashboard-content .expand-icon:hover {
    color: #374151;
}

/* Prognose info balk (cashflow table header info) */
.theme-v2 #dashboard-content .card.section > .info-box.blue + table,
.theme-v2 #dashboard-content .card.section > table {
    /* Tables inherit standard styling */
}


/* -------- TAAK 7: Tooltips (rounded-xl, shadow-xl) -------- */

/* Daily hover popup → report-tooltip style */
.theme-v2 .daily-hover-popup {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 280px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
    font-size: 12px;
    color: #374151;
}

/* Popup title → uppercase label */
.theme-v2 .daily-hover-popup .popup-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
}

/* Popup items */
.theme-v2 .daily-hover-popup .popup-item {
    margin-bottom: 6px;
}
.theme-v2 .daily-hover-popup .popup-item .popup-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}
.theme-v2 .daily-hover-popup .popup-item .popup-amount {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

/* Popup total → border top separator */
.theme-v2 .daily-hover-popup .popup-total {
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
    margin-top: 6px;
    font-weight: 700;
}

/* Info-tip tooltip → updated style */
.theme-v2 .info-tip .info-tip-text {
    background: #ffffff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
    font-size: 12px;
    padding: 12px 16px;
}
.theme-v2 .info-tip .info-tip-text::after {
    border-top-color: #ffffff;
}

/* Modal dialogs → updated border-radius */
.theme-v2 .modal {
    border-radius: 12px;
}


/* -------- Forecast V3 (P&L Builder) KPI restyling -------- */

.theme-v2 .fv3-kpi-card {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    padding: 0;
}

.theme-v2 .fv3-kpi-card::before {
    content: "";
    display: block;
    height: 2px;
    width: 100%;
    background: #10b981;
}

/* Different accents for FV3 KPI cards */
.theme-v2 .fv3-kpi-card:nth-child(1)::before { background: #10b981; }
.theme-v2 .fv3-kpi-card:nth-child(2)::before { background: #6ee7b7; }
.theme-v2 .fv3-kpi-card:nth-child(3)::before { background: #fbbf24; }
.theme-v2 .fv3-kpi-card:nth-child(4)::before { background: #60a5fa; }

.theme-v2 .fv3-kpi-card > * {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.theme-v2 .fv3-kpi-card > *:first-child:not(::before) {
    padding-top: 14px;
}

.theme-v2 .fv3-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 1.25rem 0.25rem;
}

.theme-v2 .fv3-kpi-label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}
.theme-v2 .fv3-kpi-card:nth-child(1) .fv3-kpi-label::before { background: #10b981; }
.theme-v2 .fv3-kpi-card:nth-child(2) .fv3-kpi-label::before { background: #6ee7b7; }
.theme-v2 .fv3-kpi-card:nth-child(3) .fv3-kpi-label::before { background: #fbbf24; }
.theme-v2 .fv3-kpi-card:nth-child(4) .fv3-kpi-label::before { background: #60a5fa; }

.theme-v2 .fv3-kpi-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    font-variant-numeric: tabular-nums;
    padding: 0 1.25rem;
}

.theme-v2 .fv3-kpi-sub {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    padding: 4px 1.25rem 16px;
}

/* FV3 chart cards → updated border-radius */
.theme-v2 .fv3-chart-card {
    border-radius: 12px;
    border: 1px solid #f3f4f6;
}

/* FV3 grid → updated borders */
.theme-v2 .fv3-grid-wrapper {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}


/* -------- Responsive adjustments -------- */

@media (max-width: 1200px) {
    .theme-v2 .scenario-row-2 {
        flex-wrap: wrap;
        gap: 10px;
    }
    .theme-v2 .btw-section,
    .theme-v2 .adj-section {
        border: none !important;
        padding: 0 !important;
    }
}
