:root {
    --v2-shell-bg: #f5f7fb;
    --v2-surface: #ffffff;
    --v2-surface-muted: #f9fbff;
    --v2-border: #dfe5f2;
    --v2-text: #1f2738;
    --v2-text-muted: #6f7892;
    --v2-primary: #5b6ee1;
    --v2-primary-soft: #edf0ff;
    --v2-accent: #ff7b3d;
    --v2-shadow: 0 18px 48px rgba(31, 39, 56, 0.08);
    --v2-radius-lg: 24px;
    --v2-radius-md: 16px;
    --v2-radius-sm: 12px;
    --v2-sidebar-width: 280px;
    --v2-topbar-height: 76px;
}

body {
    min-height: 100vh;
    background: #F8F9FA;
    color: var(--v2-text);
    font-family: "Inter", "Segoe UI", sans-serif;
}

.v2-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--v2-sidebar-width) minmax(0, 1fr);
}

.v2-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.86);
    border-right: 1px solid var(--v2-border);
    backdrop-filter: blur(16px);
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
}

.v2-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0 16px;
    height: 56px;
    border-bottom: 1px solid #E4E7E9;
}

.v2-sidebar-brand img {
    width: 114px;
    height: 32px;
}

.v2-sidebar-selectors {
    display: grid;
    gap: 8px;
}

.v2-shell-card {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    box-shadow: 0 10px 30px rgba(91, 110, 225, 0.06);
}

.v2-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 9px 12px;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 13px;
    color: #757678;
}

.v2-sidebar-selectors .v2-shell-card {
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    box-shadow: none;
}

.v2-selector-shell {
    position: relative;
    padding: 0;
}

.v2-selector-select {
    width: 100%;
    border: 0;
    background: transparent;
    color: #757678;
    padding: 9px 36px 9px 12px;
    font-family: inherit;
    font-size: 13px;
    appearance: none;
    outline: none;
    cursor: pointer;
}

.v2-selector-select:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.v2-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.65;
    margin-top: -4px;
}

.v2-selector-shell .v2-chevron {
    position: absolute;
    right: 1rem;
    top: 50%;
    margin-top: 0;
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
}

/* Client selector with an inline "Add client" (+) button (Corego admins). */
.v2-selector-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.v2-selector-row .v2-selector-shell {
    flex: 1 1 auto;
    min-width: 0;
}

.v2-selector-add {
    flex: 0 0 auto;
    width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    background: var(--v2-surface);
    color: #5867CA;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.v2-selector-add:hover {
    border-color: #5867CA;
    background: rgba(88, 103, 202, 0.08);
}

.v2-sidebar-section-title {
    padding: 0 0.75rem;
    font-size: 11px;
    line-height: 16.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #757678;
}

.v2-sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.v2-sidebar-group {
    display: grid;
    gap: 0.25rem;
}

.v2-sidebar-group > summary {
    list-style: none;
    cursor: pointer;
}

.v2-sidebar-group > summary::-webkit-details-marker {
    display: none;
}

.v2-sidebar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    color: #757678;
    font-size: 11px;
    line-height: 16.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.v2-sidebar-group-header:hover {
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
}

.v2-sidebar-group-header-active {
    color: var(--v2-primary);
}

.v2-sidebar-group-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.v2-sidebar-group[open] > summary .v2-sidebar-group-caret {
    transform: rotate(180deg);
}

.v2-sidebar-group-body {
    display: grid;
    gap: 0.2rem;
    padding-top: 0.15rem;
}

.v2-sidebar-state {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
}

.v2-sidebar-state strong {
    font-size: 0.94rem;
}

.v2-sidebar-state span {
    color: var(--v2-text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.v2-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.875rem 0.95rem;
    border-radius: 10px;
    color: #4D4F51;
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 400;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.v2-sidebar-link:hover {
    background: #E6E8F7;
    color: #263178;
    transform: translateX(2px);
}

.v2-sidebar-link-active {
    background: #E6E8F7;
    color: #263178;
}

.v2-nav-icon {
    width: 1.1rem;
    flex: 0 0 1.1rem;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    opacity: 0.85;
}

/* Red placeholder shown for modules whose Module2.IconClass is empty, so a missing
   icon is obvious (especially in collapsed mode where only the icon is visible). */
.v2-nav-icon-missing {
    opacity: 1;
}

.v2-sidebar-brand-mark {
    display: none;
    width: 32px;
    height: 32px;
}

.v2-sidebar-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #E4E7E9;
    display: flex;
    justify-content: flex-end;
}

.v2-sidebar-collapse {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #4D4F51;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.v2-sidebar-collapse:hover {
    background: #E6E8F7;
    color: #263178;
}

/* ---- Collapsed sidebar ---- */
.v2-shell.v2-nav-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
}

.v2-nav-collapsed .v2-sidebar {
    padding: 0;
    gap: 0;
}

.v2-nav-collapsed .v2-sidebar-brand {
    padding: 0;
    justify-content: center;
}

.v2-nav-collapsed .v2-sidebar-brand img {
    display: none;
}

.v2-nav-collapsed .v2-sidebar-brand img.v2-sidebar-brand-mark {
    display: block;
}

.v2-nav-collapsed .v2-sidebar-selectors {
    display: none;
}

.v2-nav-collapsed .v2-sidebar-nav {
    padding: 0.75rem 0.5rem;
}

.v2-nav-collapsed .v2-sidebar-link {
    justify-content: center;
    gap: 0;
    padding: 0.55rem 0;
}

.v2-nav-collapsed .v2-sidebar-link > span {
    display: none;
}

.v2-nav-collapsed .v2-nav-icon {
    flex-basis: auto;
}

/* Section headers collapse to a divider line between icon groups. */
.v2-nav-collapsed .v2-sidebar-group > summary {
    pointer-events: none;
}

.v2-nav-collapsed .v2-sidebar-group-header {
    padding: 0;
    height: 1px;
    border-top: 1px solid #E4E7E9;
    overflow: hidden;
}

.v2-nav-collapsed .v2-sidebar-group-title,
.v2-nav-collapsed .v2-sidebar-group-caret {
    display: none;
}

.v2-nav-collapsed .v2-sidebar-state {
    display: none;
}

.v2-nav-collapsed .v2-sidebar-footer {
    justify-content: center;
    padding: 0.75rem 0;
}

.v2-nav-collapsed .v2-sidebar-collapse i {
    transform: rotate(180deg);
}

.v2-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.v2-topbar {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 1.5rem;
    border-bottom: 1px solid #E4E7E9;
    background: #ffffff;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
}

.v2-topbar-left,
.v2-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

/* The search fills the top bar's vertical space. */
.v2-topbar-left { 
    width: 100%;
    align-self: stretch; 
}

.v2-search-wrap {
    position: relative;
    align-self: stretch;
    display: flex;
    width: 100%;
}

.v2-search {
    width: 100%;
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #E4E7E9;
    border-radius: 10px;
    box-shadow: none;
    overflow: hidden;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
}

.v2-search-input {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    padding: 0 12px 0 36px;
    background: rgba(243, 244, 245, 0.25);
    min-width: 0;
}

.v2-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid #757678;
    border-radius: 50%;
    transform: translateY(-50%);
    flex: 0 0 14px;
}

.v2-search-icon::after {
    content: "";
    width: 7px;
    height: 2px;
    background: var(--v2-text-muted);
    position: absolute;
    right: -5px;
    bottom: -2px;
    width: 7px;
    height: 2px;
    background: #757678;
    transform: rotate(45deg);
    border-radius: 2px;
}

.v2-search-input input {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: transparent;
    color: #1E1E1E;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.v2-search-input input::placeholder {
    color: #757678;
}

/* Global search results dropdown. */
.v2-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 60vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #E4E7E9;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(31, 39, 56, 0.16);
    padding: 4px;
}

.v2-search-result {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: #1E1E1E;
    font-size: 13px;
    line-height: 18px;
    text-decoration: none;
    cursor: pointer;
}

.v2-search-result:hover,
.v2-search-result.v2-search-result-active {
    background: #F3F4F5;
    color: #263178;
    text-decoration: none;
}

.v2-search-empty {
    padding: 10px 12px;
    color: #757678;
    font-size: 13px;
}

body.theme-dark .v2-search-results { background: #232932; border-color: #2A313D; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
body.theme-dark .v2-search-result { color: #E5E9F0; }
body.theme-dark .v2-search-result:hover,
body.theme-dark .v2-search-result.v2-search-result-active { background: rgba(107, 122, 212, 0.18); color: #FFFFFF; }
body.theme-dark .v2-search-empty { color: #9CA3AF; }


.v2-topbar-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v2-border);
    border-radius: 14px;
    background: var(--v2-surface);
    color: var(--v2-text);
    font-size: 1.45rem;
    line-height: 1;
}

.v2-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.v2-profile-avatar {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #263178;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.v2-profile-text {
    display: grid;
    gap: 2px;
}

.v2-profile-name {
    font-size: 11px;
    line-height: 12px;
    font-weight: 600;
    color: #1E1E1E;
}

.v2-profile-role {
    font-size: 11px;
    line-height: 12px;
    font-weight: 400;
    color: #1E1E1E;
}

.v2-profile-menu,
.v2-language-menu {
    position: relative;
}

.v2-profile-menu > .v2-profile {
    cursor: pointer;
}

.v2-language-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    overflow: hidden;
}

.v2-language-toggle:hover {
    border-color: #5867CA;
}

.v2-language-toggle img {
    width: 24px;
    height: auto;
    border-radius: 2px;
    display: block;
}

.v2-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    padding: 8px 0;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(31, 39, 56, 0.08);
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    z-index: 1000;
}

.v2-profile-dropdown[hidden] {
    display: none;
}

.v2-profile-dropdown-heading {
    padding: 6px 12px;
    color: #757678;
    font-size: 11px;
    line-height: 16.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.v2-profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #1E1E1E;
    font-size: 13px;
    line-height: 19.5px;
    text-decoration: none;
}

.v2-profile-dropdown-item:hover {
    background: #E6E8F7;
    color: #263178;
    text-decoration: none;
}

.v2-profile-dropdown-item img {
    width: 22px;
    height: auto;
    border-radius: 2px;
    flex: 0 0 22px;
}

.v2-content-shell {
    padding: 0;
    display: grid;
    gap: 0;
}

.v2-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #E4E7E9;
    color: #757678;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 12px;
    line-height: 18px;
    font-weight: 400;
}

.v2-breadcrumb-separator {
    color: #757678;
    font-size: 12px;
    font-weight: 400;
}

.v2-breadcrumb-current {
    color: #1E1E1E;
    font-weight: 600;
}

.v2-breadcrumb-link {
    color: inherit;
    text-decoration: none;
}

.v2-breadcrumb-link:hover,
.v2-breadcrumb-link:focus {
    color: #263178;
    text-decoration: underline;
}

.v2-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #E4E7E9;
}

.v2-page-header h1 {
    margin: 0;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 20px;
    line-height: 30px;
    font-weight: 600;
    color: #1E1E1E;
}

.v2-page-header p {
    margin: 0.35rem 0 0;
    color: var(--v2-text-muted);
}

.v2-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.v2-pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.15rem;
    border-radius: 14px;
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    color: var(--v2-text);
    font-weight: 600;
    text-decoration: none;
}

.v2-pill-button-primary {
    background: var(--v2-primary);
    border-color: var(--v2-primary);
    color: #fff;
    box-shadow: 0 16px 24px rgba(91, 110, 225, 0.24);
}

.v2-pill-button-accent {
    background: var(--v2-accent);
    border-color: var(--v2-accent);
    color: #fff;
}

.v2-tabs-bar,
.v2-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 13.5px 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #E4E7E9;
}

.v2-toolbar {
    padding: 1rem 1.5rem;
}

.v2-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.v2-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0;
    border-bottom: 2px solid transparent;
    color: #757678;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 21px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

a.v2-tab:hover {
    color: #263178;
}

.v2-tab-active {
    color: #263178;
    border-bottom-color: #263178;
}

.v2-tab-count {
    min-width: 28px;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eef1f7;
    color: var(--v2-text);
    font-size: 0.86rem;
    text-align: center;
}

.v2-toolbar-left,
.v2-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.v2-content-body {
    min-height: 420px;
}

.v2-footer {
    display: flex;
    justify-content: center;
    padding: 0.25rem 0 1rem;
    color: var(--v2-text-muted);
    font-size: 0.88rem;
}

.v2-page-content {
    display: grid;
    gap: 1rem;
}

.v2-data-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    box-shadow: var(--v2-shadow);
}

.v2-data-card {
    overflow: hidden;
}

.v2-data-table {
    overflow-x: auto;
}

.v2-data-table .table {
    margin-bottom: 0;
}

.v2-data-table thead th {
    padding: 1rem 1.25rem;
    background: #eef2ff;
    border-bottom: 1px solid var(--v2-border);
    color: var(--v2-text);
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.v2-data-table tbody td {
    padding: 1rem 1.25rem;
    border-color: var(--v2-border);
    color: var(--v2-text);
    vertical-align: middle;
}

.v2-row-link {
    color: var(--v2-text);
    font-weight: 600;
    text-decoration: none;
}

.v2-row-link:hover {
    color: var(--v2-primary);
}

.v2-row-meta {
    margin-top: 0.2rem;
    color: var(--v2-text-muted);
    font-size: 0.82rem;
}

.v2-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.v2-status-badge-active {
    background: rgba(39, 174, 96, 0.12);
    color: #16824a;
}

.v2-status-badge-inactive {
    background: rgba(111, 120, 146, 0.14);
    color: #5d657d;
}

.v2-table-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.v2-table-action {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    background: var(--v2-surface);
    color: var(--v2-text);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.v2-table-action:hover {
    color: var(--v2-primary);
    border-color: rgba(91, 110, 225, 0.28);
}

.v2-empty-state {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    min-height: 280px;
    padding: 2rem;
    text-align: center;
}

.v2-empty-state h2 {
    margin: 0;
    font-size: 1.35rem;
}

.v2-empty-state p {
    margin: 0;
    color: var(--v2-text-muted);
}

.v2-pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--v2-border);
}

.v2-pagination-summary {
    color: var(--v2-text-muted);
    font-size: 0.92rem;
}

.v2-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.v2-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    background: var(--v2-surface);
    color: var(--v2-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.v2-pagination-link:hover {
    color: var(--v2-primary);
    border-color: rgba(91, 110, 225, 0.28);
}

.v2-pagination-link-active {
    background: var(--v2-primary);
    border-color: var(--v2-primary);
    color: #fff;
}

.v2-pagination-link-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* Mobile navigation dropdown: hidden on desktop (the full sidebar nav is used instead). */
.v2-sidebar-nav-mobile {
    display: none;
}

.v2-sidebar-nav-mobile .v2-shell-card {
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    box-shadow: none;
}

@media (max-width: 1199.98px) {
    .v2-shell {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 991.98px) {
    .v2-shell {
        display: flex;
        flex-direction: column;
    }

    .v2-main {
        display: contents;
    }

    .v2-topbar {
        order: -1;
    }

    .v2-sidebar {
        order: 0;
        border-right: 0;
        border-bottom: 1px solid var(--v2-border);
    }

    .v2-content-shell {
        order: 1;
    }

    /* Collapse the sidebar nav into the dropdown; hide the full list and the collapse toggle. */
    .v2-sidebar-nav,
    .v2-sidebar-footer {
        display: none;
    }

    .v2-sidebar-nav-mobile {
        display: block;
    }

    .v2-page-header,
    .v2-tabs-bar,
    .v2-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .v2-topbar {
        flex-direction: row;
        align-items: center;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .v2-topbar-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .v2-topbar-right {
        flex: 0 0 auto;
    }

    .v2-page-actions,
    .v2-toolbar-right {
        justify-content: stretch;
    }

    .v2-search {
        width: 100%;
        min-width: 0;
    }

    .v2-profile-text {
        display: none;
    }

    .v2-profile {
        padding: 0;
        gap: 0;
    }

    .v2-pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   Generic v2 list pattern (reusable across all listing pages)
   ============================================================ */

.v2-list {
    display: grid;
    gap: 0;
}

/* Forms placed directly in a list section (e.g. the Transaction search filters) get
   padding so they don't run to the content edges, while list tables stay edge to edge. */
.v2-list > .v2-form {
    padding: 1.5rem;
}

.v2-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #E4E7E9;
}

.v2-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.v2-list-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.95rem;
    border-radius: var(--v2-radius-sm, 10px);
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    color: var(--v2-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.v2-list-action:hover {
    border-color: var(--v2-primary);
    color: var(--v2-primary);
}

.v2-list-action-primary {
    background: var(--v2-primary);
    border-color: var(--v2-primary);
    color: #fff;
}

.v2-list-action-primary:hover {
    background: var(--v2-primary);
    color: #fff;
    filter: brightness(0.95);
}

/* Row-selection checkbox column in the customer list. */
.v2-list-select-cell {
    width: 2.75rem;
    text-align: center;
    vertical-align: middle;
}

.v2-list-select-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #5867CA;
    cursor: pointer;
    margin: 0;
}

/* Grouped toolbar: a group button that opens a dropdown "layer" of actions. */
.v2-toolbar-group {
    position: relative;
    display: inline-flex;
}

.v2-toolbar-caret {
    margin-left: 0.15rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

.v2-toolbar-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    min-width: 240px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid #E4E7E9;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(31, 39, 56, 0.16);
}

.v2-toolbar-menu[hidden] { display: none; }

.v2-toolbar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #1E1E1E;
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.v2-toolbar-menu-item:hover { background: #F3F4F5; color: #263178; }
.v2-toolbar-menu-item .fa { width: 16px; text-align: center; color: #757678; }
.v2-toolbar-menu-item:hover .fa { color: #263178; }

.v2-toolbar-menu-divider { height: 1px; margin: 4px 6px; background: #E4E7E9; }

body.theme-dark .v2-toolbar-menu { background: #232932; border-color: #2A313D; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
body.theme-dark .v2-toolbar-menu-item { color: #E5E9F0; }
body.theme-dark .v2-toolbar-menu-item:hover { background: rgba(107, 122, 212, 0.18); color: #FFFFFF; }
body.theme-dark .v2-toolbar-menu-divider { background: #2A313D; }

.v2-list-action-active {
    background: rgba(91, 110, 225, 0.12);
    border-color: var(--v2-primary);
    color: var(--v2-primary);
}

.v2-list-check {
    width: 2.75rem;
    text-align: center;
    vertical-align: middle;
}

.v2-list-check-input {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--v2-primary);
}

.v2-archive-names {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    max-height: 11rem;
    overflow-y: auto;
    color: var(--v2-text);
    font-size: 0.9rem;
}

.v2-archive-names li {
    margin: 0.1rem 0;
}

.v2-list-action-icon {
    width: 1rem;
    text-align: center;
}

.v2-list-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    background: var(--v2-surface);
    min-width: 240px;
    height: 36px;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 14px;
    color: #1E1E1E;
}

.v2-list-search > .fa {
    color: #757678;
    font-size: 14px;
}

/* Keeps the search right-aligned in the tabs bar also when the module tab strip is not there
   (a module group with a single module). */
.v2-tabs-bar > .v2-list-search {
    margin-left: auto;
}

.v2-list-search input {
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    width: 100%;
}

.v2-list-search input::placeholder {
    color: #757678;
}

.v2-list-table-wrap {
    overflow-x: auto;
}

.v2-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.94rem;
}

.v2-list-table thead th {
    padding: 0.85rem 1rem;
    background: #eef1f9;
    color: var(--v2-text);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid var(--v2-border);
    white-space: nowrap;
}

.v2-list-table thead th.v2-list-th-sortable::after {
    content: "↕";
    margin-left: 0.35rem;
    color: var(--v2-text-muted);
    font-size: 0.85em;
}

.v2-list-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--v2-border);
    vertical-align: middle;
}

.v2-list-table tbody tr:hover {
    background: rgba(91, 110, 225, 0.04);
}

.v2-list-toggle {
    width: 1.5rem;
    color: var(--v2-text-muted);
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.v2-list-toggle::before {
    content: "›";
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 1.2rem;
    line-height: 1;
}

.v2-list-row-expanded > .v2-list-toggle::before {
    transform: rotate(90deg);
}

.v2-list-color-chip {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 5px;
    border: 1px solid var(--v2-border);
    vertical-align: middle;
    margin-right: 0.5rem;
}

.v2-list-primary {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
}

.v2-list-primary-name {
    font-weight: 600;
    color: var(--v2-text);
}

.v2-list-meta {
    display: block;
    color: var(--v2-text-muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.v2-list-tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    background: #eceff8;
    color: var(--v2-primary);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
}

.v2-list-tag-muted {
    background: #f1f3f7;
    color: var(--v2-text-muted);
}

.v2-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.v2-list-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--v2-text-muted);
}

.v2-list-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 17px 1.5rem 17px;
    border-top: 1px solid #E4E7E9;
    background: #ffffff;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
}

.v2-list-pagination a,
.v2-list-pagination span {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #E4E7E9;
    border-radius: 4px;
    background: var(--v2-surface);
    color: #757678;
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 500;
    text-decoration: none;
}

.v2-list-pagination a:hover {
    border-color: #5867CA;
    color: #5867CA;
}

.v2-list-pagination .v2-list-pagination-active {
    background: #5867CA;
    border-color: #5867CA;
    color: #fff;
}

.v2-list-pagination .v2-list-pagination-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Clickable row + expanded detail */
.v2-list-row-clickable {
    cursor: pointer;
}

.v2-list-row-clickable.v2-list-row-expanded {
    background: rgba(91, 110, 225, 0.06);
}

.v2-list-row-clickable.v2-list-row-expanded > .v2-list-toggle::before {
    transform: rotate(-90deg);
}

.v2-list-row-detail > .v2-list-row-detail-cell {
    padding: 1.5rem 1.35rem 2rem;
    background: #fff;
    border-bottom: 1px solid var(--v2-border);
}

.v2-list-row-new {
    background: rgba(91, 110, 225, 0.05);
}

.v2-list-row-new .v2-list-primary-name {
    font-style: italic;
    color: var(--v2-text-muted);
}

.v2-list-row-detail-loading,
.v2-list-row-detail-error {
    padding: 1.25rem;
    color: var(--v2-text-muted);
    text-align: center;
    font-style: italic;
}

.v2-list-row-detail-error {
    color: #c0392b;
}

/* ============================================================
   Generic v2 form pattern (reusable across all edit panels)
   ============================================================ */

.v2-form {
    display: grid;
    gap: 1.25rem;
}

.v2-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.v2-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    grid-column: span 4;
}

.v2-form-field-half {
    grid-column: span 6;
}

.v2-form-field-span-2 {
    grid-column: span 8;
}

.v2-form-field-span-3 {
    grid-column: span 12;
}

.v2-form-label {
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: #4D4F51;
}

.v2-form-required {
    color: #D52941;
    margin-left: 0.15rem;
}

.v2-form-input,
.v2-form-select,
.v2-form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    background: var(--v2-surface);
    color: var(--v2-text);
    font: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.v2-form-input:focus,
.v2-form-select:focus,
.v2-form-textarea:focus {
    outline: 0;
    border-color: var(--v2-primary);
    box-shadow: 0 0 0 3px rgba(91, 110, 225, 0.15);
}

.v2-form-textarea {
    resize: vertical;
    min-height: 4rem;
}

/* Field validation states (Figma node 1940-248): invalid inputs get a 2px #D52941
   border (1px border + 1px ring so the layout does not shift) and an error row below. */
.v2-form-input-invalid,
.v2-form-input-invalid:focus {
    border-color: #D52941;
    box-shadow: 0 0 0 1px #D52941;
}

.v2-form-error {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 4px;
    color: #D52941;
    font-size: 12px;
    line-height: 18px;
}

.v2-form-error .fa {
    font-size: 12px;
}

.v2-form-input-valid {
    border-color: #2e7d32;
}

.v2-form-error {
    font-size: 0.8rem;
    line-height: 1.3;
    color: #e23b3b;
}

/* Vertical list of feature checkboxes (product form). */
.v2-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* POS button font-color swatch picker (product edit form). */
.v2-fontcolor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-fontcolor-swatch {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--v2-border);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
}

.v2-fontcolor-swatch-white {
    color: #1E1E1E;
}

.v2-fontcolor-swatch .fa {
    opacity: 0;
}

.v2-fontcolor-swatch-selected {
    box-shadow: 0 0 0 2px var(--v2-primary);
}

.v2-fontcolor-swatch-selected .fa {
    opacity: 1;
}

/* Current POS button background image preview (product edit form). */
.v2-product-image-preview {
    width: 150px;
    height: 100px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}

/* Product-package member list (draggable pill rows + add dialog). */
.v2-package-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 4px;
}

.v2-package-add-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--v2-primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.v2-package-add-link:hover {
    text-decoration: underline;
}

.v2-package-products {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 13px;
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    min-height: 40px;
}

.v2-package-product-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: 40px;
    border-radius: 6px;
    background: #E8EBFC;
}

.v2-package-drag {
    flex: 0 0 auto;
    cursor: grab;
    color: #757678;
    font-size: 12px;
}

.v2-package-product-name {
    flex: 1 1 auto;
    min-width: 0;
    color: #263178;
    font-weight: 500;
    font-size: 12px;
}

.v2-package-product-price {
    margin-left: 0.4rem;
    color: #757678;
    font-weight: 400;
    font-size: 11px;
    white-space: nowrap;
}

/* Per-member quantity stepper (xN with -/+ buttons) */
.v2-package-qty {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 0.6rem;
}

.v2-package-qty-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #C7CEE8;
    border-radius: 6px;
    background: #ffffff;
    color: #263178;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.v2-package-qty-btn:hover {
    border-color: #5867CA;
    color: #5867CA;
}

.v2-package-qty-value {
    min-width: 28px;
    text-align: center;
    color: #263178;
    font-weight: 500;
    font-size: 12px;
}

body.theme-dark .v2-package-qty-btn {
    background: #1A1F28;
    border-color: #3A4566;
    color: #C7D1F5;
}

body.theme-dark .v2-package-qty-value {
    color: #C7D1F5;
}

.v2-package-remove {
    flex: 0 0 auto;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #DC2626;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.v2-package-hint {
    margin: 6px 0 0;
    color: #757678;
    font-size: 11px;
}

.v2-package-hint .fa {
    margin-right: 6px;
}

/* "Add products" dialog product picker list */
.v2-package-pick-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 50vh;
    overflow-y: auto;
}

.v2-package-pick {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.4rem;
    border-radius: 6px;
    font-size: 13px;
    color: var(--v2-text);
    cursor: pointer;
}

.v2-package-pick:hover {
    background: var(--v2-primary-soft);
}

.v2-package-pick input:disabled + .v2-package-pick-name {
    opacity: 0.5;
}

body.theme-dark .v2-package-products {
    border-color: #2A313D;
}

body.theme-dark .v2-package-product-row {
    background: #2A3350;
}

body.theme-dark .v2-package-product-name {
    color: #C7D1F5;
}

.v2-form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--v2-text);
    cursor: pointer;
}

/* In-form tab strip (used inside expanded edit panels) */
.v2-form-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid var(--v2-border);
}

/* Extra air under the tabstrip divider before the form content.
   Padding on the panel is used instead of margin on .v2-form-tabs because
   .v2-form is a CSS grid and a grid item's margin gets absorbed by its track. */
.v2-form-tab-panel:not([hidden]) {
    padding-top: 12px;
}

.v2-form-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 12px;
    border-radius: 6px;
    background: #E8EBFC;
    color: #263178;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 12px;
    line-height: 18px;
}

/* Server-side notification toast (Utils.Notify.Pop) */
.v2-notify {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    width: max-content;
    max-width: min(520px, calc(100% - 32px));
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--v2-border);
    border-left-width: 4px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(31, 39, 56, 0.18);
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    color: var(--v2-text);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.v2-notify-hide {
    opacity: 0;
}

.v2-notify-icon {
    margin-top: 1px;
    font-size: 16px;
    line-height: 18px;
}

.v2-notify-header {
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
}

.v2-notify-text {
    margin-top: 2px;
    font-size: 12px;
    line-height: 17px;
    color: var(--v2-text-muted);
}

.v2-notify-close {
    flex: 0 0 auto;
    margin-left: 0.4rem;
    border: 0;
    background: transparent;
    color: #757678;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.v2-notify-success { border-left-color: #2e7d32; }
.v2-notify-success .v2-notify-icon { color: #2e7d32; }
.v2-notify-danger { border-left-color: #e23b3b; }
.v2-notify-danger .v2-notify-icon { color: #e23b3b; }
.v2-notify-warning { border-left-color: #b8860b; }
.v2-notify-warning .v2-notify-icon { color: #b8860b; }
.v2-notify-info { border-left-color: #5867CA; }
.v2-notify-info .v2-notify-icon { color: #5867CA; }

.v2-form-tabs > .v2-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    padding: 10px 16px 10px;
    font-size: 13px;
    line-height: 19.5px;
    margin-bottom: -1px; /* overlap the divider so the active underline sits on it */
}

.v2-form-tabs > .v2-tab.v2-tab-active {
    color: #5867CA;
    border-bottom-color: #5867CA;
}

.v2-form-tab-panel[hidden] {
    display: none !important;
}

/* ============================================================
   Customer transactions sub-tab (Transaktiot)
   ============================================================ */
.v2-tx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.v2-tx-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--v2-text);
}

.v2-tx-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.v2-tx-actions .v2-form-button {
    gap: 0.4rem;
}

/* Row actions column (view details / delete) */
.v2-tx-actions-col {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.v2-tx-row-actions {
    display: inline-flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

.v2-tx-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--v2-border);
    border-radius: 6px;
    background: var(--v2-surface);
    color: var(--v2-text-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.v2-tx-row-action:hover {
    border-color: var(--v2-primary);
    color: var(--v2-primary);
}

.v2-tx-row-action-danger:hover {
    border-color: #e23b3b;
    color: #e23b3b;
}

/* Add-transaction dialog tabs / panels */
.v2-txadd-tabs {
    margin-bottom: 0.75rem;
}

.v2-txadd-subtabs {
    margin-bottom: 0.75rem;
}

.v2-txadd-panel[hidden],
.v2-txadd-subpanel[hidden] {
    display: none !important;
}

.v2-txadd-validity-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.v2-txadd-validity-row .v2-form-input {
    width: auto;
    flex: 0 1 auto;
}

.v2-txadd-validity-sep {
    color: var(--v2-text-muted);
}

/* Transaction details dialog body */
.v2-tx-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.v2-tx-detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.v2-tx-detail-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--v2-text-muted);
}

.v2-tx-detail-value {
    font-size: 0.95rem;
    color: var(--v2-text);
}

.v2-tx-detail-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--v2-text-muted);
    margin-bottom: 0.5rem;
}

.v2-tickets-section + .v2-tickets-section {
    margin-top: 1.25rem;
}

.v2-tickets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.v2-tickets-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* Keeps the buttons right-aligned also when the Liput/Lippusarjat toggle is not rendered
       (customer with no ticket products). */
    margin-left: auto;
}

.v2-tickets-actions .v2-form-button {
    gap: 0.4rem;
}

/* Liput / Lippusarjat segmented toggle */
.v2-tickets-toggle {
    display: inline-flex;
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    overflow: hidden;
}

.v2-tickets-toggle-btn {
    border: 0;
    background: var(--v2-surface);
    color: var(--v2-text);
    font: inherit;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.v2-tickets-toggle-btn + .v2-tickets-toggle-btn {
    border-left: 1px solid var(--v2-border);
}

.v2-tickets-toggle-btn:hover {
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
}

.v2-tickets-toggle-active,
.v2-tickets-toggle-active:hover {
    background: var(--v2-primary);
    color: #ffffff;
}

.v2-ticket-type-icon {
    margin-left: 0.4rem;
    color: var(--v2-text-muted);
}

.v2-tx-detail-table {
    margin: 0;
}

.v2-tx-detail-table thead th {
    background: var(--v2-surface-muted);
}

.v2-tx-detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.v2-tx-card {
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    overflow: hidden;
}

.v2-tx-table {
    margin: 0;
}

.v2-tx-table thead th {
    background: var(--v2-surface-muted);
}

.v2-tx-table tbody tr:last-child td {
    border-bottom: 0;
}

.v2-tx-amount-col {
    text-align: right;
    white-space: nowrap;
}

.v2-tx-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.v2-tx-badge-pos {
    background: #e6f4ea;
    color: #1e7d32;
}

.v2-tx-badge-neg {
    background: #fdeaea;
    color: #c0392b;
}

.v2-tx-amount-pos {
    color: #1e7d32;
    font-weight: 600;
}

.v2-tx-amount-neg {
    color: #c0392b;
    font-weight: 600;
}

.v2-tx-row-reversed td {
    color: var(--v2-text-muted);
    text-decoration: line-through;
}

.v2-tx-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--v2-border);
    background: var(--v2-surface-muted);
}

.v2-tx-balance-label {
    font-weight: 600;
    color: var(--v2-text);
}

.v2-tx-balance-value {
    font-weight: 700;
    color: #1e7d32;
}

.v2-tx-balance-negative .v2-tx-balance-value {
    color: #c0392b;
}

.v2-form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

/* ============================================================
   Generic on/off toggle pill list
   ------------------------------------------------------------
   Use anywhere you want a horizontal row of selectable chips
   backed by hidden checkboxes/radios. Selection state comes
   from the input :checked attribute (no JS required).
   ============================================================ */

.v2-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.v2-toggle-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1.05rem;
    border-radius: 10px;
    background: #f1f3f7;
    color: var(--v2-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid transparent;
}

.v2-toggle-pill:hover {
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
}

.v2-toggle-pill input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
    pointer-events: none;
}

.v2-toggle-pill:has(input:checked) {
    background: var(--v2-primary);
    color: #fff;
}

.v2-toggle-pill:has(input:checked):hover {
    background: var(--v2-primary);
    color: #fff;
    filter: brightness(0.95);
}

.v2-toggle-pill:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(91, 110, 225, 0.25);
}

.v2-toggle-pill:has(input:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
}

.v2-toggle-pill:has(input:disabled):hover {
    background: #f1f3f7;
    color: var(--v2-text);
}

.v2-toggle-pill-meta {
    margin-left: 0.4rem;
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.85em;
}

/* Multiselect dropdown: a form-control-looking toggle ("Kassat (2/24)") opening a checkbox list in
   a popover. Used where a pill per option would stretch the page (transaction search cashdesks). */
.v2-multiselect {
    position: relative;
}

.v2-multiselect-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    background: var(--v2-surface);
    color: var(--v2-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.v2-multiselect-toggle:focus {
    outline: 0;
    border-color: var(--v2-primary);
    box-shadow: 0 0 0 3px rgba(91, 110, 225, 0.15);
}

.v2-multiselect-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 30;
    min-width: 240px;
    padding: 0.5rem;
    border: 1px solid var(--v2-border);
    border-radius: 10px;
    background: var(--v2-surface);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
}

.v2-multiselect-menu[hidden] {
    display: none;
}

.v2-multiselect-tools {
    display: flex;
    gap: 0.75rem;
    padding: 0 0.25rem 0.5rem;
    border-bottom: 1px solid var(--v2-border);
}

.v2-multiselect-tool {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--v2-primary);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.v2-multiselect-tool:hover {
    text-decoration: underline;
}

.v2-multiselect-options {
    display: grid;
    gap: 0.35rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.5rem 0.25rem 0.25rem;
}

.v2-form-color-picker {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.v2-form-color {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.v2-form-color-chip {
    flex: 0 0 auto;
    width: 2.5rem;
    padding: 0;
    border: 1px solid var(--v2-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.1s ease;
}

.v2-form-color-chip:hover {
    border-color: var(--v2-primary);
}

.v2-form-color-chip:focus {
    outline: 0;
    border-color: var(--v2-primary);
    box-shadow: 0 0 0 3px rgba(91, 110, 225, 0.15);
}

.v2-form-color-text {
    flex: 1 1 auto;
}

.v2-form-color-palette {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.85rem 0.85rem 0.75rem;
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    background: var(--v2-surface);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: auto;
    z-index: 30;
    min-width: 270px;
    max-width: 100%;
}

.v2-form-color-picker.is-open .v2-form-color-palette {
    display: grid;
}

.v2-form-color-palette-title {
    grid-column: 1 / -1;
    margin: 0 0 0.15rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--v2-text);
}

.v2-form-color-palette-footer {
    grid-column: 1 / -1;
    margin-top: 0.3rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--v2-border);
    color: var(--v2-text-muted);
    font-size: 0.74rem;
    line-height: 1.4;
}

.v2-form-color-swatch {
    padding: 0;
    border-radius: 9px;
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.v2-form-color-swatch:hover {
    transform: translateY(-1px);
    border-color: var(--v2-primary);
    box-shadow: 0 5px 11px rgba(15, 23, 42, 0.10);
}

.v2-form-color-swatch:focus-visible {
    outline: 0;
    border-color: var(--v2-primary);
    box-shadow: 0 0 0 3px rgba(91, 110, 225, 0.25);
}

.v2-form-color-swatch-selected {
    border-color: var(--v2-primary);
    box-shadow: 0 0 0 2px var(--v2-primary);
}

.v2-form-color-swatch-fill {
    position: relative;
    height: 64px;
    width: 100%;
    background-color: var(--v2-swatch-color, #eef1f7);
}

.v2-form-color-swatch-stripe {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 10px;
    background: var(--v2-swatch-secondary, rgba(0, 0, 0, 0.32));
}

.v2-form-color-swatch-hex {
    padding: 0.4rem 0.3rem;
    background: var(--v2-surface);
    color: var(--v2-text);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.v2-form-color-swatch .fa-check {
    display: none;
}

.v2-form-color-swatch-white .v2-form-color-swatch-fill {
    box-shadow: inset 0 0 0 1px var(--v2-border);
}

.v2-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
}

.v2-form-footer[hidden] {
    display: none;
}

/* "Muut toiminnot" (other actions) tab. */
.v2-other-actions {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding-top: 0.5rem;
}

.v2-other-section-title {
    margin: 0 0 0.35rem;
    font-size: 16px;
    font-weight: 600;
    color: #1E1E1E;
}

.v2-other-section-desc {
    margin: 0 0 0.75rem;
    font-size: 13px;
    color: #757678;
}

.v2-ident-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.v2-ident-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.v2-ident-row .v2-form-field {
    flex: 1 1 0;
    margin: 0;
}

.v2-ident-delete {
    flex: 0 0 auto;
    height: 38px;
    width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    color: #D52941;
    cursor: pointer;
}

.v2-ident-delete:hover { border-color: #D52941; background: #FDECEE; }

.v2-other-actions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.v2-other-status {
    font-size: 13px;
    color: #2e7d32;
}

body.theme-dark .v2-other-section-title { color: #E5E9F0; }
body.theme-dark .v2-other-section-desc { color: #9CA3AF; }
body.theme-dark .v2-ident-delete { background: #1A1F28; border-color: #2A313D; }
body.theme-dark .v2-ident-delete:hover { border-color: #D52941; background: rgba(213, 41, 65, 0.15); }

.v2-form-footer-right {
    display: flex;
    gap: 0.6rem;
    margin-left: auto;
}

.v2-form-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    color: var(--v2-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.v2-form-button:hover {
    border-color: var(--v2-primary);
    color: var(--v2-primary);
}

.v2-form-button-primary {
    background: var(--v2-primary);
    border-color: var(--v2-primary);
    color: #fff;
}

.v2-form-button-primary:hover {
    background: var(--v2-primary);
    color: #fff;
    filter: brightness(0.95);
}

.v2-form-button-danger {
    background: #e23b3b;
    border-color: #e23b3b;
    color: #fff;
}

.v2-form-button-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* Generic centered modal/popup. */
.v2-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.45);
}

.v2-modal-overlay[hidden] {
    display: none;
}

.v2-modal-card {
    background: var(--v2-surface);
    color: var(--v2-text);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.v2-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.v2-modal-text {
    margin: 0;
    color: var(--v2-text-muted);
    line-height: 1.5;
}

.v2-modal-error {
    margin: 0;
    color: #c0392b;
    font-size: 0.9rem;
}

.v2-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

/* Push a modal action button to the left (e.g. a clear/reset action). */
.v2-modal-action-left {
    margin-right: auto;
}

body.theme-dark .v2-modal-card {
    background: #1A1F28;
    border: 1px solid #2A313D;
}

/* Wide modal variant: fixed header + scrollable body (e.g. bulk edit panel). */
.v2-modal-card-wide {
    max-width: 920px;
    max-height: 88vh;
    padding: 0;
    gap: 0;
    overflow: hidden;
}

/* Extra-wide variant for dialogs holding wide data tables (e.g. QR codes). */
.v2-modal-card-xwide {
    max-width: 95vw;
}

/* QR search page (/QrTicket/SearchQr). */
.v2-searchqr-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    max-width: 640px;
}

.v2-searchqr-form .v2-form-input {
    flex: 1 1 auto;
}

.v2-searchqr-form .v2-form-button {
    flex: 0 0 auto;
}

.v2-searchqr-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.v2-searchqr-title {
    margin: 0.75rem 0 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--v2-text);
}

.v2-searchqr-subtitle {
    margin: 1rem 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--v2-text);
}

.v2-card {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    padding: 1.25rem 1.35rem;
}

.v2-searchqr-card {
    border: 0;
    border-radius: 0;
}

.v2-settings-divider {
    border: 0;
    border-top: 1px solid var(--v2-border);
    margin: 1.75rem 0;
}

.v2-form-input-readonly {
    background: #f4f5fb;
}

.v2-searchqr-value {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.6rem;
    color: var(--v2-text);
}

.v2-searchqr-action {
    background: none;
    border: 0;
    padding: 0;
    color: var(--v2-primary);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.v2-searchqr-card-actions {
    margin-top: 1.1rem;
}

.v2-searchqr-empty {
    margin: 0;
    color: var(--v2-text-muted);
}

.v2-searchqr-status {
    margin: 0 0 0.85rem;
    color: var(--v2-text-muted);
    font-size: 0.88rem;
}

.v2-searchqr-json {
    background: #1a1f28;
    color: #e5e9f0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    font-size: 0.82rem;
    margin: 0;
}

.v2-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--v2-border);
    }

.v2-modal-close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--v2-text-muted);
    cursor: pointer;
}

.v2-modal-close:hover {
    color: var(--v2-text);
}

.v2-modal-card-wide .v2-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
}

.v2-viewcodes-group {
    margin: 0 0 0.85rem;
    font-weight: 600;
    color: var(--v2-text);
}

.v2-viewcodes-pager {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.v2-viewcodes-pager-info {
    color: var(--v2-text-muted);
    font-size: 0.88rem;
}

.v2-viewcodes-table-wrap {
    overflow-x: auto;
}

.v2-viewcodes-table {
    font-size: 0.86rem;
}

.v2-viewcodes-table th,
.v2-viewcodes-table td {
    white-space: nowrap;
}

.v2-viewcodes-row-used td {
    background: rgba(220, 53, 69, 0.12);
}

.v2-viewcodes-disabled {
    color: #dc3545;
    margin-right: 0.35rem;
}

body.theme-dark .v2-modal-header {
    border-bottom-color: #2A313D;
}

@media (max-width: 900px) {
    .v2-form-grid {
        grid-template-columns: 1fr;
    }

    .v2-form-field,
    .v2-form-field-half,
    .v2-form-field-span-2,
    .v2-form-field-span-3 {
        grid-column: span 1;
    }
}

/* ============================================================
   v2 Dialog template (header / body / footer)
   ============================================================ */

.v2-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
}

.v2-dialog-backdrop[hidden] {
    display: none;
}

.v2-dialog {
    width: min(900px, 100%);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(31, 39, 56, 0.2);
    overflow: hidden;
}

.v2-dialog-sm {
    width: min(420px, 100%);
}

.v2-dialog-md {
    width: min(640px, 100%);
}

.v2-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E4E7E9;
}

.v2-dialog-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.v2-dialog-title {
    margin: 0;
    font-size: 18px;
    line-height: 27px;
    font-weight: 600;
    color: #1E1E1E;
}

.v2-dialog-subtitle {
    margin: 0;
    font-size: 13px;
    line-height: 19.5px;
    color: #757678;
}

.v2-dialog-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #757678;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.v2-dialog-close:hover {
    background: #F3F4F5;
    color: #1E1E1E;
}

.v2-dialog-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    color: #1E1E1E;
}

.v2-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 1rem 1.5rem;
    border-top: 1px solid #E4E7E9;
}

.v2-dialog-button {
    height: 36px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    color: #1E1E1E;
    font-family: inherit;
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 500;
    cursor: pointer;
}

.v2-dialog-button:hover {
    border-color: #5867CA;
    color: #5867CA;
}

.v2-dialog-button-primary {
    background: #5867CA;
    border-color: #5867CA;
    color: #ffffff;
}

.v2-dialog-button-primary:hover {
    background: #4a59b5;
    border-color: #4a59b5;
    color: #ffffff;
}

.v2-dialog-button-danger {
    background: #e23b3b;
    border-color: #e23b3b;
    color: #ffffff;
}

.v2-dialog-button-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #ffffff;
}

/* Checkbox lists inside v2 dialogs (e.g. the remove-customer-data field picker). */
.v2-check-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
    margin-bottom: 1rem;
}

.v2-check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    cursor: pointer;
}

.v2-dialog-message {
    margin: 0;
}

/* Wider dialog variant (bulk-transaction and manage-data-fields dialogs). */
.v2-dialog-lg {
    width: min(960px, 100%);
}

/* Small square icon-only action buttons (row actions in the data-fields list). */
.v2-icon-button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    color: #757678;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.v2-icon-button:hover {
    background: #F3F4F5;
    color: #1E1E1E;
}

.v2-icon-button-danger:hover {
    background: #FDECEC;
    border-color: #E9B4B4;
    color: #C0392B;
}

/* Manage-data-fields dialog. */
.v2-df-list-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.v2-df-table {
    width: 100%;
}

.v2-df-table tbody td {
    vertical-align: middle;
}

.v2-df-table .fa-check {
    color: #2E7D32;
}

.v2-df-row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.v2-df-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.v2-df-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 10px;
    border: 1px solid #E4E7E9;
    border-radius: 16px;
    background: #F3F4F5;
    font-size: 13px;
    color: #1E1E1E;
}

.v2-df-option-remove {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #757678;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.v2-df-option-remove:hover {
    background: #E4E7E9;
    color: #1E1E1E;
}

.v2-df-option-add {
    display: flex;
    gap: 8px;
}

.v2-df-option-add .v2-form-input {
    flex: 1 1 auto;
}

.v2-df-flags {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Stacked fields inside the add-client dialog body. */
.v2-add-client-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Two-column field layout for the add-event dialog body. */
.v2-add-event-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.v2-add-event-grid > .v2-form-field {
    grid-column: auto;
}

.v2-add-event-grid > .v2-add-event-field-full {
    grid-column: 1 / -1;
}

.v2-add-event-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

@media (max-width: 560px) {
    .v2-add-event-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* The add-event form is the dialog's flex child; let its body scroll while the
   header and footer stay pinned on short viewports. */
.v2-dialog > [data-v2-add-event-form] {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.v2-dialog > [data-v2-add-event-form] > .v2-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
}

/* ============================================================
   v2 Action dropdown (trigger button with icon + caret + menu)
   ============================================================ */

.v2-action-dropdown {
    position: relative;
    display: inline-block;
}

.v2-action-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    color: #1E1E1E;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 500;
    cursor: pointer;
}

.v2-action-dropdown-trigger:hover {
    border-color: #5867CA;
    color: #5867CA;
}

.v2-action-dropdown-trigger-primary {
    background: #5867CA;
    border-color: #5867CA;
    color: #ffffff;
}

.v2-action-dropdown-trigger-primary:hover {
    background: #4a59b5;
    border-color: #4a59b5;
    color: #ffffff;
}

.v2-action-dropdown-trigger-accent {
    background: #FF6B35;
    border-color: #FF6B35;
    color: #ffffff;
}

.v2-action-dropdown-trigger-accent:hover {
    background: #e85a26;
    border-color: #e85a26;
    color: #ffffff;
}

.v2-action-dropdown-caret {
    font-size: 12px;
    line-height: 1;
}

.v2-action-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    padding: 8px 0;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(31, 39, 56, 0.08);
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    z-index: 1000;
}

.v2-action-dropdown-menu[hidden] {
    display: none;
}

.v2-action-dropdown-menu-right {
    left: auto;
    right: 0;
}

.v2-action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: #1E1E1E;
    font-family: inherit;
    font-size: 13px;
    line-height: 19.5px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.v2-action-dropdown-item:hover {
    background: #E6E8F7;
    color: #263178;
    text-decoration: none;
}

.v2-action-dropdown-item-danger {
    color: #B32A1F;
}

.v2-action-dropdown-item-danger:hover {
    background: rgba(179, 42, 31, 0.08);
    color: #B32A1F;
}

.v2-action-dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background: #E4E7E9;
}

/* ============================================================
   v2 Theme toggle (next to language flag)
   ============================================================ */

.v2-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    color: #1E1E1E;
    cursor: pointer;
    font-size: 14px;
}

.v2-theme-toggle:hover {
    border-color: #5867CA;
    color: #5867CA;
}

/* "v1" button in the top bar: switches back to the classic UI. */
.v2-version-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #E4E7E9;
    border-radius: 8px;
    background: #ffffff;
    color: #1E1E1E;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.v2-version-toggle:hover {
    border-color: #5867CA;
    color: #5867CA;
    text-decoration: none;
}

body.theme-dark .v2-version-toggle { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-version-toggle:hover { border-color: #5867CA; color: #C7D1F5; }

.v2-theme-icon-light {
    display: none;
}

body.theme-dark .v2-theme-icon-dark {
    display: none;
}

body.theme-dark .v2-theme-icon-light {
    display: inline;
}

/* ============================================================
   v2 Dark mode overrides (body.theme-dark)
   ============================================================ */

body.theme-dark {
    background: #11151B;
    color: #E5E9F0;
}

/* Shell + sidebar */
body.theme-dark .v2-sidebar { background: rgba(26, 31, 40, 0.86); border-right-color: #2A313D; }
body.theme-dark .v2-sidebar-brand { border-bottom-color: #2A313D; }
body.theme-dark .v2-sidebar-section-title { color: #6B7280; }
body.theme-dark .v2-sidebar-group-header { color: #6B7280; }
body.theme-dark .v2-sidebar-group-header:hover { background: rgba(107, 122, 212, 0.16); color: #C7D1F5; }
body.theme-dark .v2-sidebar-group-header-active { color: #C7D1F5; }
body.theme-dark .v2-sidebar-link { color: #C7D1F5; }
body.theme-dark .v2-sidebar-link:hover { background: rgba(107, 122, 212, 0.18); color: #FFFFFF; }
body.theme-dark .v2-sidebar-link-active { background: rgba(107, 122, 212, 0.24); color: #FFFFFF; }

/* Sidebar selectors */
body.theme-dark .v2-sidebar-selectors .v2-shell-card { background: #1A1F28; border-color: #2A313D; }
body.theme-dark .v2-selector { color: #9CA3AF; }
body.theme-dark .v2-selector-select { color: #E5E9F0; background: transparent; }
body.theme-dark .v2-selector-select option { background: #1A1F28; color: #E5E9F0; }
body.theme-dark .v2-selector-add { background: #1A1F28; border-color: #2A313D; color: #C7D1F5; }
body.theme-dark .v2-selector-add:hover { border-color: #5867CA; background: rgba(88, 103, 202, 0.12); }

/* Topbar */
body.theme-dark .v2-topbar { background: #1A1F28; border-bottom-color: #2A313D; }
body.theme-dark .v2-search { background: #1A1F28; border-color: #2A313D; }
body.theme-dark .v2-search-input { background: rgba(255, 255, 255, 0.03); }
body.theme-dark .v2-search-input input { color: #E5E9F0; }
body.theme-dark .v2-search-input input::placeholder { color: #6B7280; }
body.theme-dark .v2-search-icon { border-color: #9CA3AF; }
body.theme-dark .v2-search-icon::after { background: #9CA3AF; }
body.theme-dark .v2-language-toggle { background: #1A1F28; border-color: #2A313D; }
body.theme-dark .v2-language-toggle:hover { border-color: #5867CA; }
body.theme-dark .v2-theme-toggle { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-theme-toggle:hover { border-color: #5867CA; color: #C7D1F5; }
body.theme-dark .v2-profile.v2-shell-card { background: #1A1F28; border-color: #2A313D; box-shadow: none; }
body.theme-dark .v2-profile-name { color: #E5E9F0; }
body.theme-dark .v2-profile-role { color: #9CA3AF; }
body.theme-dark .v2-profile-dropdown { background: #232932; border-color: #2A313D; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
body.theme-dark .v2-profile-dropdown-heading { color: #6B7280; }
body.theme-dark .v2-profile-dropdown-item { color: #E5E9F0; }
body.theme-dark .v2-profile-dropdown-item:hover { background: rgba(107, 122, 212, 0.18); color: #FFFFFF; }

/* Bands */
body.theme-dark .v2-breadcrumbs { background: #1A1F28; border-bottom-color: #2A313D; color: #9CA3AF; }
body.theme-dark .v2-breadcrumb-current { color: #E5E9F0; }
body.theme-dark .v2-breadcrumb-separator { color: #6B7280; }
body.theme-dark .v2-breadcrumb-link:hover, body.theme-dark .v2-breadcrumb-link:focus { color: #C7D1F5; }
body.theme-dark .v2-page-header { background: #1A1F28; border-bottom-color: #2A313D; }
body.theme-dark .v2-page-header h1 { color: #E5E9F0; }
body.theme-dark .v2-tabs-bar { background: #1A1F28; border-bottom-color: #2A313D; }
body.theme-dark .v2-tab { color: #9CA3AF; }
body.theme-dark a.v2-tab:hover { color: #C7D1F5; }
body.theme-dark .v2-tab-active { color: #C7D1F5; border-bottom-color: #5867CA; }
body.theme-dark .v2-toolbar { background: #1A1F28; border-bottom-color: #2A313D; }

/* List */
body.theme-dark .v2-list-toolbar { background: #1A1F28; border-bottom-color: #2A313D; }
body.theme-dark .v2-list-action { background: #232932; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-list-action:hover { border-color: #5867CA; color: #C7D1F5; }
body.theme-dark .v2-list-search { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-list-search input { color: #E5E9F0; }
body.theme-dark .v2-list-search input::placeholder { color: #6B7280; }
body.theme-dark .v2-list-search > .fa { color: #9CA3AF; }

/* List table */
body.theme-dark .v2-list-table thead th { background: #232932; color: #E5E9F0; border-bottom-color: #2A313D; }
body.theme-dark .v2-list-table thead th.v2-list-th-sortable::after { color: #9CA3AF; }
body.theme-dark .v2-list-table tbody td { color: #E5E9F0; border-bottom-color: #2A313D; }
body.theme-dark .v2-list-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
body.theme-dark .v2-list-toggle { color: #9CA3AF; }
body.theme-dark .v2-list-row-clickable.v2-list-row-expanded { background: rgba(255, 255, 255, 0.05); }
body.theme-dark .v2-list-row-detail > .v2-list-row-detail-cell { background: #1A1F28; }
body.theme-dark .v2-list-primary-name { color: #E5E9F0; }
body.theme-dark .v2-list-meta { color: #9CA3AF; }
body.theme-dark .v2-list-tag { background: rgba(107, 122, 212, 0.20); color: #C7D1F5; }
body.theme-dark .v2-list-tag-muted { background: rgba(255, 255, 255, 0.08); color: #9CA3AF; }
body.theme-dark .v2-list-empty { color: #9CA3AF; }

/* Pagination */
body.theme-dark .v2-list-pagination { background: #1A1F28; border-top-color: #2A313D; }
body.theme-dark .v2-list-pagination a,
body.theme-dark .v2-list-pagination span { background: #1A1F28; border-color: #2A313D; color: #9CA3AF; }
body.theme-dark .v2-list-pagination a:hover { border-color: #5867CA; color: #C7D1F5; }
body.theme-dark .v2-list-pagination .v2-list-pagination-active { background: #5867CA; border-color: #5867CA; color: #FFFFFF; }

/* Forms */
body.theme-dark .v2-form-input,
body.theme-dark .v2-form-select,
body.theme-dark .v2-form-textarea { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-form-input::placeholder,
body.theme-dark .v2-form-textarea::placeholder { color: #6B7280; }
body.theme-dark .v2-form-select option { background: #1A1F28; color: #E5E9F0; }
body.theme-dark .v2-form-label { color: #C7D1F5; }
body.theme-dark .v2-form-color-text { background: #1A1F28; color: #E5E9F0; }
body.theme-dark .v2-form-color-chip { border-color: #2A313D; }
body.theme-dark .v2-form-color-palette { background: #232932; border-color: #2A313D; }
body.theme-dark .v2-form-color-palette-title { color: #E5E9F0; }
body.theme-dark .v2-form-color-palette-footer { border-top-color: #2A313D; color: #9CA3AF; }
body.theme-dark .v2-form-color-swatch { background: #1A1F28; border-color: #2A313D; }
body.theme-dark .v2-form-color-swatch-hex { background: #1A1F28; color: #E5E9F0; }
body.theme-dark .v2-multiselect-toggle { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-multiselect-menu { background: #232932; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-multiselect-tools { border-bottom-color: #2A313D; }
body.theme-dark .v2-form-button { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-form-button:hover { border-color: #5867CA; color: #C7D1F5; }
body.theme-dark .v2-form-footer { border-top-color: #2A313D; }

/* Dialog */
body.theme-dark .v2-dialog { background: #1A1F28; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.50); }
body.theme-dark .v2-dialog-header { border-bottom-color: #2A313D; }
body.theme-dark .v2-dialog-title { color: #E5E9F0; }
body.theme-dark .v2-dialog-subtitle { color: #9CA3AF; }
body.theme-dark .v2-dialog-close { color: #9CA3AF; }
body.theme-dark .v2-dialog-close:hover { background: rgba(255, 255, 255, 0.06); color: #E5E9F0; }
body.theme-dark .v2-dialog-body { color: #E5E9F0; }
body.theme-dark .v2-dialog-footer { border-top-color: #2A313D; }
body.theme-dark .v2-dialog-button { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-dialog-button:hover { border-color: #5867CA; color: #C7D1F5; }

/* Action dropdown */
body.theme-dark .v2-action-dropdown-trigger { background: #1A1F28; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-action-dropdown-trigger:hover { border-color: #5867CA; color: #C7D1F5; }
body.theme-dark .v2-action-dropdown-menu { background: #232932; border-color: #2A313D; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
body.theme-dark .v2-action-dropdown-item { color: #E5E9F0; }
body.theme-dark .v2-action-dropdown-item:hover { background: rgba(107, 122, 212, 0.18); color: #FFFFFF; }
body.theme-dark .v2-action-dropdown-divider { background: #2A313D; }

/* Form tabs (in expanded row) */
body.theme-dark .v2-form-tabs { border-bottom-color: #2A313D; }
body.theme-dark .v2-form-banner { background: #232932; color: #C7D1F5; }
body.theme-dark .v2-notify { background: #232932; border-top-color: #2A313D; border-right-color: #2A313D; border-bottom-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-notify-text { color: #9CA3AF; }
body.theme-dark .v2-notify-close { color: #9CA3AF; }
body.theme-dark .v2-form-tabs > .v2-tab { color: #9CA3AF; }
body.theme-dark .v2-form-tabs > .v2-tab.v2-tab-active { color: #C7D1F5; border-bottom-color: #5867CA; }

/* Customer transactions sub-tab */
body.theme-dark .v2-tx-card { border-color: #2A313D; }
body.theme-dark .v2-tx-table thead th { background: #232932; }
body.theme-dark .v2-tx-balance { background: #232932; border-top-color: #2A313D; }
body.theme-dark .v2-tx-badge-pos { background: rgba(46, 125, 50, 0.22); color: #8FE3A4; }
body.theme-dark .v2-tx-badge-neg { background: rgba(192, 57, 43, 0.22); color: #F2A39B; }
body.theme-dark .v2-tx-amount-pos { color: #8FE3A4; }
body.theme-dark .v2-tx-amount-neg { color: #F2A39B; }
body.theme-dark .v2-tx-balance-value { color: #8FE3A4; }
body.theme-dark .v2-tx-balance-negative .v2-tx-balance-value { color: #F2A39B; }
body.theme-dark .v2-tx-row-action { background: #1A1F28; border-color: #2A313D; color: #9CA3AF; }
body.theme-dark .v2-tx-row-action:hover { border-color: #5867CA; color: #C7D1F5; }
body.theme-dark .v2-tx-row-action-danger:hover { border-color: #F2A39B; color: #F2A39B; }
body.theme-dark .v2-tx-detail-table thead th { background: #232932; }
body.theme-dark .v2-tickets-toggle { border-color: #2A313D; }
body.theme-dark .v2-tickets-toggle-btn { background: #1A1F28; color: #E5E9F0; }
body.theme-dark .v2-tickets-toggle-btn + .v2-tickets-toggle-btn { border-left-color: #2A313D; }
body.theme-dark .v2-tickets-toggle-active, body.theme-dark .v2-tickets-toggle-active:hover { background: #5867CA; color: #ffffff; }

/* ---- Legacy v1 pages rendered inside the v2 layout (e.g. /Event/EventSettings) ----
   Styles the untouched Bootstrap 3 markup to match the v2 look: underline tabs, white
   content card, v2 inputs/buttons/typography. Includes the BS3 .fade/.in bridging since
   the v2 layout ships Bootstrap 5 CSS only. */
.v2-legacy-page {
    padding: 1.5rem;
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
    color: #1E1E1E;
}

.v2-legacy-page .fade:not(.show) { opacity: 1; }

.v2-legacy-page > h2 {
    margin: 0 0 1rem;
    font-size: 20px;
    line-height: 30px;
    font-weight: 600;
    color: #1E1E1E;
}

.v2-legacy-page > h2 .fa-arrow-circle-left { cursor: pointer; color: #5867CA; margin-right: 0.35rem; }
.v2-legacy-page > h2 .fa-gear { margin-right: 0.35rem; color: #757678; }

/* Underline tab strip like the v2 tabs bar. */
.v2-legacy-page .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 0 1rem;
    padding: 0 0 1px;
    list-style: none;
    border-bottom: 1px solid #E4E7E9;
}

.v2-legacy-page .nav-tabs li { margin: 0; }

.v2-legacy-page .nav-tabs a {
    display: block;
    padding: 6px 2px 8px;
    color: #757678;
    font-size: 14px;
    line-height: 21px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.v2-legacy-page .nav-tabs a:hover { color: #263178; }

.v2-legacy-page .nav-tabs li.active a {
    color: #263178;
    border-bottom-color: #263178;
    font-weight: 600;
}

/* Tab content on a white card like the v2 panels. */
.v2-legacy-page .tab-content {
    background: #ffffff;
    border: 1px solid #E4E7E9;
    border-radius: 12px;
    padding: 24px;
}

.v2-legacy-page .tab-content > .tab-pane { display: none; }
.v2-legacy-page .tab-content > .tab-pane.active { display: block; }

.v2-legacy-page .tab-pane h2,
.v2-legacy-page .tab-pane h3 {
    margin: 0 0 1rem;
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    color: #1E1E1E;
}

.v2-legacy-page .tab-pane h4 {
    margin: 1rem 0 0.5rem;
    font-size: 14px;
    font-weight: 600;
    color: #1E1E1E;
}

.v2-legacy-page b, .v2-legacy-page strong {
    display: inline-block;
    margin: 0.75rem 0 0.25rem;
    font-size: 13px;
    font-weight: 600;
    color: #4D4F51;
}

/* Inputs, selects and textareas per the v2 form spec; the legacy markup stacks them bare. */
.v2-legacy-page .form-control,
.v2-legacy-page .input-field,
.v2-legacy-page select,
.v2-legacy-page textarea {
    display: block;
    width: 100%;
    max-width: 560px;
    margin: 0 0 10px;
    padding: 0.65rem 0.85rem;
    border: 1px solid #E4E7E9;
    border-radius: 6px;
    background: #ffffff;
    color: #1E1E1E;
    font-family: inherit;
    font-size: 15px;
    line-height: 19px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.v2-legacy-page .form-control:focus,
.v2-legacy-page .input-field:focus,
.v2-legacy-page select:focus,
.v2-legacy-page textarea:focus {
    outline: 0;
    border-color: #5867CA;
    box-shadow: 0 0 0 3px rgba(91, 110, 225, 0.15);
}

.v2-legacy-page textarea { min-height: 4rem; resize: vertical; }

.v2-legacy-page ::placeholder { color: rgba(30, 30, 30, 0.5); }

/* Field title lifted from the input's placeholder (script in EventSettings.cshtml). */
.v2-legacy-page .v2-legacy-field-title {
    max-width: 560px;
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 18px;
    color: #4D4F51;
}

.v2-legacy-page input[type="file"] { margin: 0.25rem 0 10px; font-size: 13px; }

/* Fields rendered by _InputTextFieldHelper. Its v1 floating-label markup puts the
   title after the input; stack it above per the v2 field spec (Figma 1748-14266). */
.v2-legacy-page .input-wrapper { margin: 0 0 10px; }

.v2-legacy-page .input-wrapper > label {
    display: block;
    margin: 0;
    max-width: 560px;
}

.v2-legacy-page .input-wrapper .rs-input {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
}

.v2-legacy-page .input-wrapper .input-label {
    display: block;
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    font-weight: 400;
    color: #4D4F51;
}

.v2-legacy-page .input-wrapper .input-field {
    margin: 0;
    max-width: none;
}

/* Checkbox and radio rows. */
.v2-legacy-page label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 12px 6px 0;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: #4D4F51;
    cursor: pointer;
}

.v2-legacy-page input[type="checkbox"],
.v2-legacy-page input[type="radio"] {
    accent-color: #5867CA;
    width: 15px;
    height: 15px;
    margin: 0;
}

/* Buttons per the v2 button spec. */
.v2-legacy-page .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    line-height: 19px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.v2-legacy-page .btn-primary { background: #5867CA; color: #ffffff; }
.v2-legacy-page .btn-primary:hover { background: #4a58b5; }

.v2-legacy-page .btn-default,
.v2-legacy-page .btn:not(.btn-primary):not(.btn-danger) {
    background: #F3F4F5;
    border-color: #E4E7E9;
    color: #1E1E1E;
}

.v2-legacy-page .btn-default:hover { background: #E6E8F7; }

.v2-legacy-page .btn-danger { background: #D52941; color: #ffffff; }

/* Tables inside the settings tabs. */
.v2-legacy-page table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 0 0 1rem;
}

.v2-legacy-page table th {
    background: #F3F4F5;
    color: #4D4F51;
    font-weight: 600;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #E4E7E9;
}

.v2-legacy-page table td {
    padding: 8px 12px;
    border-bottom: 1px solid #E4E7E9;
}

/* Inputs used as table cell editors (e.g. integration account grids). */
.v2-legacy-page table .form-control,
.v2-legacy-page table select {
    margin: 0;
}

/* Bootstrap 3 dropdowns under the v2 layout (Bootstrap 5 CSS toggles .show, BS3 JS
   toggles .open on the parent) - used by e.g. bootstrap-select. */
.v2-legacy-page .open > .dropdown-menu { display: block; }

.v2-legacy-page .dropdown-menu li > a {
    display: block;
    padding: 6px 12px;
    color: #1E1E1E;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.v2-legacy-page .dropdown-menu li > a:hover { background: #F3F4F5; }

/* Bootstrap 3 modals under the v2 layout (Bootstrap 5 CSS only). */
.modal.fade:not(.show) { opacity: 1; }
.modal.in { display: block; }
.modal-backdrop.in { opacity: 0.5; }

.v2-legacy-page .modal .close {
    border: 0;
    background: none;
    font-size: 20px;
    line-height: 1;
    color: #757678;
    cursor: pointer;
}

.v2-legacy-page .modal .modal-content,
.v2-legacy-page ~ .modal .modal-content,
.generic-modal-dialog .modal-content {
    border: 1px solid #E4E7E9;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(31, 39, 56, 0.16);
    font-family: "DM Sans", "Inter", "Segoe UI", sans-serif;
}

/* ============================================================
   Dark mode — components added after the original dark pass.
   ============================================================ */

/* Legacy pages (event settings, integrations) embed un-themed v1 content, so in dark mode we keep
   the legacy area as a light "document" card inside the dark shell rather than half-theming v1 markup. */
body.theme-dark .v2-legacy-page { background: #FBFCFC; border-radius: 12px; }

/* Icon buttons (e.g. data-field row actions) */
body.theme-dark .v2-icon-button { background: #1A1F28; border-color: #2A313D; color: #9CA3AF; }
body.theme-dark .v2-icon-button:hover { background: #232932; color: #E5E9F0; }
body.theme-dark .v2-icon-button-danger:hover { background: rgba(192, 57, 43, 0.20); border-color: #7F3B34; color: #F1B0A8; }

/* Data-field option chips */
body.theme-dark .v2-df-option { background: #232932; border-color: #2A313D; color: #E5E9F0; }
body.theme-dark .v2-df-option-remove:hover { background: #2A313D; color: #E5E9F0; }

/* Other light surfaces */
body.theme-dark .v2-data-card { background: rgba(26, 31, 40, 0.92); }
body.theme-dark .v2-data-table { background: #232932; }
body.theme-dark .v2-toggle-pill { background: #232932; }
body.theme-dark .v2-form-input-readonly { background: #161B22; }
body.theme-dark .v2-list-row-new { background: rgba(88, 103, 202, 0.14); }
body.theme-dark .v2-tab-count { background: #232932; color: #E5E9F0; }
body.theme-dark .v2-sidebar-footer { border-top-color: #2A313D; }
body.theme-dark .v2-package-hint,
body.theme-dark .v2-package-product-price { color: #9CA3AF; }
