/* FinTrack - Cool Professional Theme */
/* Uses Bootstrap 5 utilities where possible, custom CSS only for gaps */

:root {
    /* Cool color palette - blues, greens, teals */
    --ft-primary: #2563eb;        /* Vibrant blue */
    --ft-secondary: #0d9488;      /* Teal */
    --ft-accent: #10b981;         /* Emerald green */
    --ft-success: #22c55e;        /* Green */
    --ft-info: #06b6d4;           /* Cyan */
    --ft-warning: #f59e0b;        /* Amber */
    --ft-danger: #ef4444;         /* Red */
    --ft-background: #f8fafc;     /* Slate 50 */
    --ft-surface: #ffffff;        /* White */
    --ft-dark: #1e293b;           /* Slate 800 */
    --ft-muted: #64748b;          /* Slate 500 */
    
    /* Bootstrap overrides */
    --bs-primary: var(--ft-primary);
    --bs-secondary: var(--ft-secondary);
    --bs-success: var(--ft-success);
    --bs-info: var(--ft-info);
    --bs-body-bg: var(--ft-background);
    --bs-body-color: var(--ft-dark);
}

/* Body */
body {
    background-color: var(--ft-background);
}

/* Navbar - cool gradient with fish background */
.fintrack-navbar {
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-secondary) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible; /* Allow dropdowns to overflow */
}

.fintrack-navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../img/fish-background-white.svg');
    background-size: 500px; /* Larger = bigger fish/bubbles visible */
    background-position: left top;
    background-repeat: repeat;
    pointer-events: none;
    opacity: 0.25; /* Subtler so labels are readable */
}

.fintrack-navbar > * {
    position: relative;
    z-index: 1;
}

/* Ensure navbar text is white and readable */
.fintrack-navbar .nav-link,
.fintrack-navbar .navbar-brand,
.fintrack-navbar .dropdown-toggle {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fintrack-navbar .nav-link:hover,
.fintrack-navbar .dropdown-toggle:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

.fintrack-navbar .navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Fix dropdown menus not showing */
.fintrack-navbar .dropdown-menu {
    z-index: 1050;
}

/* App container - simple flexbox layout */
.app-container {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* Sidebar - fixed width with fish background */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background-color: #e8f0f8; /* Pale steel blue base */
    border-right: 1px solid var(--bs-border-color);
    position: relative;
    overflow: hidden;
}

/* Main content - fills remaining space */
.app-main {
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
    padding: 1.5rem;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../img/fish-background.svg');
    background-size: 500px;
    background-position: top left;
    background-repeat: repeat;
    pointer-events: none;
    /* Lighter blue tint */
    filter: sepia(1) saturate(1.5) hue-rotate(200deg) brightness(0.85);
    opacity: 0.4;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

/* Make sidebar accordion/buttons semi-transparent to show fish but keep labels readable */
.sidebar .accordion-item,
.sidebar .accordion-button,
.sidebar .accordion-collapse {
    background-color: transparent !important;
}

.sidebar .accordion-button {
    font-weight: 600;
    color: var(--ft-dark) !important;
}

.sidebar .btn-group-vertical {
    background-color: transparent;
}

/* Ensure sidebar button labels are readable */
.sidebar .btn {
    font-weight: 500;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* Main content area - fish background */
.app-main::before {
    content: '';
    position: fixed;
    top: 56px; /* Below navbar */
    left: 200px; /* After sidebar */
    right: 0;
    bottom: 0;
    background-image: url('../img/fish-background.svg');
    background-size: 1000px;
    background-position: center;
    background-repeat: repeat;
    pointer-events: none;
    z-index: -1;
    /* Blue-tinted fish */
    filter: sepia(1) saturate(2) hue-rotate(200deg) brightness(0.6);
    opacity: 0.5;
}

.sidebar .nav-link {
    color: var(--ft-dark);
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    transition: background-color 0.15s ease;
}

.sidebar .nav-link:hover {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--ft-primary);
}

.sidebar .nav-link.active {
    background-color: var(--ft-primary);
    color: white;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--ft-dark);
}

.sidebar-subheading {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    color: var(--ft-muted);
    opacity: 0.8;
}

/* Sidebar accordion - supergroup headers */
.sidebar .accordion-button {
    background-color: transparent;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--ft-dark);
    padding: 0.5rem 0.75rem;
    box-shadow: none;
}

/* Personal header - clickable link + separate toggle */
.sidebar-heading-link {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--ft-dark);
}

.sidebar-heading-link:hover {
    color: var(--ft-primary);
}

.sidebar-heading-toggle {
    width: auto;
    flex-shrink: 0;
    background-color: transparent;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ft-dark);
    box-shadow: none;
}

.sidebar-heading-toggle::after {
    margin-left: 0;
}

/* Sidebar buttons - larger font, better readability */
.sidebar-btn {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-btn .sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Business entity buttons - two-line format */
.sidebar-btn-business {
    padding: 0.375rem 0.75rem;
    white-space: normal;
}

.sidebar-business-label {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
}

.sidebar-type-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    opacity: 0.7;
}

.sidebar-entity-name {
    font-size: 0.8125rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Allow sidebar column to be slightly wider on larger screens */
@media (min-width: 992px) {
    .sidebar {
        max-width: 200px;
    }
}

.sidebar .accordion-button:not(.collapsed) {
    background-color: transparent;
    color: var(--ft-muted);
}

.sidebar .accordion-button::after {
    width: 0.75rem;
    height: 0.75rem;
    background-size: 0.75rem;
}

/* Gap between supergroup header and group list */
.sidebar .accordion-collapse .btn-group-vertical {
    margin-top: 0.25rem;
}

/* Sidebar module header - shown in non-dashboard modules */
.sidebar-module-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.module-icon-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-section-label {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

/* Module header - main content area */
.module-header {
    flex-shrink: 0;
}

.module-icon-wrapper {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Cards - clean and minimal */
.card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: var(--ft-surface);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--ft-muted);
}

/* Status Badges - using Bootstrap colors */
.badge-pending { background-color: var(--bs-warning-bg-subtle) !important; color: var(--bs-warning-text-emphasis) !important; }
.badge-provisional { background-color: var(--bs-info-bg-subtle) !important; color: var(--bs-info-text-emphasis) !important; }
.badge-actual { background-color: var(--bs-primary-bg-subtle) !important; color: var(--bs-primary-text-emphasis) !important; }
.badge-complete { background-color: var(--bs-success-bg-subtle) !important; color: var(--bs-success-text-emphasis) !important; }

/* Buttons - use Bootstrap's btn-* classes, these are overrides */
.btn-primary {
    --bs-btn-bg: var(--ft-primary);
    --bs-btn-border-color: var(--ft-primary);
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
}

.btn-success {
    --bs-btn-bg: var(--ft-success);
    --bs-btn-border-color: var(--ft-success);
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* =============================================================================
   Responsive Tables - Hide columns on narrow screens, NEVER use horizontal scroll
   ============================================================================= */
@media (max-width: 768px) {
    /* Hide Type column on tablets and smaller */
    .expense-table th:nth-child(2),
    .expense-table td:nth-child(2),
    .table .col-type {
        display: none;
    }
}

@media (max-width: 576px) {
    /* Hide more columns on mobile */
    .expense-table th:nth-child(3),
    .expense-table td:nth-child(3) {
        display: none;
    }
}

/* Dashboard Stats */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ft-primary);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--ft-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* HTMX Loading Indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Expense row editable cells - click to inline edit */
.expense-editable-cell {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.expense-editable-cell:hover {
    background-color: var(--bs-warning-bg-subtle) !important;
}

/* Custom date editor */
.date-editor .month-scroll-btn {
    color: var(--ft-primary);
}

.date-editor .month-scroll-btn:hover {
    color: var(--ft-dark);
}

.date-editor .day-input {
    padding: 0.15rem 0.25rem;
}

.date-editor .day-input::-webkit-inner-spin-button,
.date-editor .day-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.date-editor .day-input {
    -moz-appearance: textfield;
}

.date-editor .month-dropdown {
    max-height: 150px;
    overflow-y: auto;
}

.date-editor .month-option {
    font-size: 0.875rem;
}

/* Tracker row backgrounds - type-tinted rows with raised alpha for clarity */
.tracker-expense-row,
.tracker-expense-row td {
    background-color: rgba(var(--bs-danger-rgb), 0.10) !important;
}
.tracker-income-row,
.tracker-income-row td {
    background-color: rgba(var(--bs-success-rgb), 0.10) !important;
}
.tracker-refund-row,
.tracker-refund-row td {
    background-color: rgba(var(--bs-success-rgb), 0.08) !important;
}
.tracker-transfer-debit-row,
.tracker-transfer-debit-row td {
    background-color: rgba(var(--bs-danger-rgb), 0.08) !important;
}
.tracker-transfer-credit-row,
.tracker-transfer-credit-row td {
    background-color: rgba(var(--bs-success-rgb), 0.08) !important;
}
.tracker-transfer-internal-row,
.tracker-transfer-internal-row td {
    background-color: rgba(var(--bs-info-rgb), 0.08) !important;
}
.flip-h {
    transform: scaleX(-1);
}
.flip-v {
    transform: scaleY(-1);
}
.flip-hv {
    transform: scale(-1, -1);
}

/* Tracker expense amount - much darker red, still recognizably red */
.tracker-expense-row .text-danger-emphasis {
    color: #6d0f24 !important;
}

/* Amount formatting - tabular-nums for decimal alignment in columns */
.amount {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Tracker amount column - right-aligned, overflow spills LEFT into Description (not right) */
#cashflow-list td:nth-child(3),
#expense-list td:nth-child(3) {
    text-align: right !important;  /* physical right - end would flip in rtl */
    overflow: visible;
    direction: rtl;  /* overflow extends leftward into Description column */
}
#cashflow-list td:nth-child(3) .amount,
#expense-list td:nth-child(3) .amount {
    direction: ltr;  /* keep number digit order correct */
    display: inline-block;
}

.amount.positive { color: var(--ft-success); }
.amount.negative { color: var(--ft-danger); }

/* Modal styling */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

/* Calendar Grid - flexible columns that squeeze on smaller screens */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)); /* minmax(0,1fr) allows columns to shrink */
    gap: 2px;
}

.calendar-header {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.25rem;
    min-width: 0; /* Allow header to shrink */
}

.calendar-day {
    min-height: 80px;
    min-width: 0; /* Allow cells to shrink - prevents column squishing */
    background-color: var(--ft-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    padding: 0.25rem;
    padding-bottom: 1.25rem; /* Space for day number at bottom-right */
    position: relative;
}

@media (max-width: 575.98px) {
    .calendar-day { min-height: 60px; }
}

.calendar-day-empty {
    background-color: var(--bs-tertiary-bg);
    border-color: transparent;
}

.calendar-day-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ft-muted);
    position: absolute;
    bottom: 0.25rem;
    right: 0.5rem;
}

/* Calendar items - type-based backgrounds (shared with Porter/Tracker, 0.06 alpha) */
.calendar-item {
    font-size: 0.625rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    min-width: 0; /* Allow flex child to shrink */
}

.calendar-item-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-item-amount {
    flex-shrink: 0; /* Keep amount visible */
}

.calendar-expense { background-color: rgba(var(--bs-danger-rgb), 0.06); }
.calendar-income { background-color: rgba(var(--bs-success-rgb), 0.06); }
.calendar-transfer { background-color: rgba(var(--bs-info-rgb), 0.06); }
.calendar-refund { background-color: rgba(var(--bs-warning-rgb), 0.06); }

.calendar-item:hover {
    filter: brightness(0.95);
}

.calendar-item i {
    font-size: 0.5625rem;
    flex-shrink: 0;
}

/* Table with fixed layout for proper truncation */
.table-layout-fixed {
    table-layout: fixed;
    width: 100%;
}

.table-layout-fixed td.text-truncate,
.table-layout-fixed th.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cashflow chart - reduced height */
#cashflow-chart-container {
    height: 150px !important;
    max-height: 150px !important;
}

/* Budget estimate indicator - dark yellow question mark */
.budget-indicator {
    color: #b45309; /* amber-700 - dark yellow/orange */
}

/* Transaction group separator - dark top border on first row cells */
.txn-border-top {
    border-top: 2px solid #212529 !important;
}

/* Transaction row top border - separates each transaction visually */
/* Must use border-collapse: separate to override Bootstrap's collapsed borders */
#transactions-list table {
    border-collapse: separate !important;
    border-spacing: 0;
}

.transaction > td {
    border-top: 2px solid #212529;
}

/* =====================================================
   Transaction Row States - Reconciliation Preview
   ===================================================== */

/* Transaction row status is indicated by match row background colors, not row styling */

/* Subtle debit/credit background colors for transaction rows */
tr.transaction.txn-debit > td {
    background-color: rgba(220, 53, 69, 0.06);
}

tr.transaction.txn-credit > td {
    background-color: rgba(25, 135, 84, 0.06);
}

/* =============================================================================
   Porter Page Styles
   ============================================================================= */

/* Transaction group separator - dark top border on first row of each group */
/* Using high specificity to override Bootstrap table styles */
table.table tbody.porter-txn-group > tr:first-child > td,
table.table tfoot.porter-txn-group > tr:first-child > td {
    border-top: 2px solid #212529 !important;
}

/* Single-row match selector - radio button toggle styling */
.transfer-account-selector label,
.cc-payment-selector label {
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}
.transfer-account-selector label:has(input:checked),
.cc-payment-selector label:has(input:checked) {
    /* Override to solid success when checked */
    background-color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
    color: white !important;
}
.transfer-account-selector label:has(input:checked) .badge,
.cc-payment-selector label:has(input:checked) .badge {
    background-color: rgba(255,255,255,0.9) !important;
    color: var(--bs-success) !important;
}

/* Expense match row - darker shade of danger (not green). Green = Income/Transfer in on Porter. */
.bg-expense-match {
    background-color: rgba(var(--bs-danger-rgb), 0.2);
}

/* Porter button styling */
.porter-txn-btn {
    background-color: transparent;
    border: none;
}
.porter-txn-btn:hover {
    transform: scale(1.15);
    transition: transform 0.1s ease-in-out;
}
.porter-txn-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.porter-txn-btn:disabled:hover {
    transform: none;
}

/* Porter type section: collapsed = single row (header only); chevron rotates when expanded */
.porter-type-header {
    line-height: 1.25;
    min-height: 0;
}
[data-bs-toggle="collapse"][data-ft-collapse-persist^="porter-"]:not(.collapsed) i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Important button styling - active state, not dimmed */
.important-btn {
    background-color: transparent;
    border: none;
}
.important-btn:hover {
    transform: scale(1.1);
}

/* Allow text truncation in flex containers */
.min-width-0 {
    min-width: 0;
}

/* Transfer icon flip for credit transactions (money coming in = flip both vertically and horizontally) */
.transfer-flip {
    display: inline-block;
    transform: scale(-1, -1);
}

/* ImportAnt rotation for transaction direction */
/* Debit (money out) = points right (no rotation needed, icon is pre-rotated) */
.important-debit {
    display: inline-block;
}
/* Credit (money in) = points left (flip horizontally) */
.important-credit {
    display: inline-block;
    transform: scaleX(-1);
}

/* =============================================================================
   Porter Navigation Header
   ============================================================================= */

/* Account badge cards in Porter navigation */
.porter-account-badge {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.125);
    min-width: 120px;
    transition: all 0.15s ease-in-out;
}
.porter-account-badge:hover {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: var(--bs-primary);
    transform: translateY(-1px);
}
.porter-account-badge.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}
.porter-account-badge.active .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}
.porter-account-badge.active .text-warning {
    color: #ffc107 !important;
}
.porter-account-badge.active .text-success {
    color: #90EE90 !important;
}

.porter-account-badge .badge-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}
.porter-account-badge .account-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}
.porter-account-badge .unreconciled-indicator {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.porter-account-badge .badge-stats {
    font-size: 0.75rem;
}

/* Transfer Account Badge Picker (horizontal radio badges in match rows) */
/* Uses Bootstrap btn-check pattern - label wraps hidden radio input */
.transfer-badge-option {
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}
.transfer-badge-option:has(input:checked) {
    background-color: var(--bs-info) !important;
    border-color: var(--bs-info) !important;
    color: white !important;
}
.transfer-badge-option:has(input:checked) .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}
.transfer-badge-option:hover:not(:has(input:checked)) {
    background-color: var(--bs-light);
    border-color: var(--bs-info);
}

/* =============================================================================
   Unified Dropzone (inline style)
   ============================================================================= */

/* Porter Summary Cards (transparent with thin borders) */
.porter-summary-card {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.porter-summary-card .card-body {
    background-color: transparent;
}

/* Porter Accounts Table (pivoted layout) */
.porter-accounts-table {
    table-layout: auto;
    background-color: transparent;
}
.porter-accounts-table th,
.porter-accounts-table td {
    vertical-align: middle;
    white-space: nowrap;
    background-color: transparent;
    border-color: rgba(0, 0, 0, 0.08);
}
.porter-accounts-table th:first-child,
.porter-accounts-table td:first-child {
    width: 70px;
    min-width: 70px;
}

/* Porter Navigation Buttons (compact for table headers) */
.porter-nav-btn {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--bs-body-color);
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}
.porter-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}
.porter-nav-btn.active {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    font-weight: 600;
}

/* Shared ripple animation for dropzone water effects */
@keyframes ripple {
    from { background-position: 0 0; }
    to { background-position: 60px 0; }
}

/* Title bar dropzone (swimming pool effect) */
.dropzone-title {
    padding: 0.375rem 1rem;
    border: 2px solid var(--bs-dark);
    border-radius: 0.5rem;
    background: linear-gradient(180deg, #e0f4ff 0%, #b8e6ff 50%, #7dd3fc 100%);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
/* Water ripple effect */
.dropzone-title::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.5) 10px,
        rgba(255, 255, 255, 0.5) 20px
    );
    animation: ripple 6s linear infinite;
    pointer-events: none;
}
.dropzone-title:hover {
    border-color: var(--bs-primary);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}
.dropzone-title.drag-over {
    border-color: var(--bs-primary);
    background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 50%, #0284c7 100%);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}
.dropzone-title .dropzone-text {
    color: #0369a1;
    font-weight: 600;
    position: relative;
    z-index: 1;
}
.dropzone-title i {
    position: relative;
    z-index: 1;
}

/* Compact dropzone variant (for headers) */
.dropzone-title.dropzone-compact {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}
.dropzone-title.dropzone-compact:hover {
    transform: scale(1.01);
}

/* =============================================================================
   Custom Icon Dropdown (Account Group Selector)
   ============================================================================= */

.account-group-dropdown .dropdown-toggle {
    background: var(--ft-surface);
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    min-height: 42px;
}

.account-group-dropdown .dropdown-toggle:hover {
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.account-group-dropdown .dropdown-toggle:focus {
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.account-group-dropdown .dropdown-toggle::after {
    transition: transform 0.2s ease;
}

.account-group-dropdown .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.account-group-dropdown .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    animation: dropdownFadeIn 0.15s ease-out;
    /* No scrollbar - dropdown auto-positions via Bootstrap's Popper.js */
    overflow: visible;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-group-dropdown .dropdown-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ft-muted);
    padding: 0.5rem 0.75rem 0.25rem;
}

.account-group-dropdown .dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.15s ease;
    font-weight: 500;
}

.account-group-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(13, 148, 136, 0.08) 100%);
    transform: translateX(2px);
}

.account-group-dropdown .dropdown-item.active {
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-secondary) 100%);
    color: white;
}

.account-group-dropdown .dropdown-item.active:hover {
    transform: translateX(2px);
}

.account-group-dropdown .dropdown-item img {
    transition: transform 0.15s ease;
}

.account-group-dropdown .dropdown-item:hover img {
    transform: scale(1.1);
}

.account-group-dropdown .dropdown-divider {
    margin: 0.25rem 0.5rem;
    opacity: 0.1;
}

.account-group-dropdown .selected-group-display img {
    margin-right: 0.5rem;
}

/* Group badge icons - ensure consistent sizing */
.group-badge-icon {
    object-fit: cover;
    flex-shrink: 0;
}

/* =============================================================================
   Generic Icon Select Dropdown (DRY component for all icon-enabled selects)
   ============================================================================= */

.icon-select-dropdown .dropdown-toggle {
    background: var(--ft-surface);
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.icon-select-dropdown .dropdown-toggle:hover {
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.icon-select-dropdown .dropdown-toggle:focus {
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.icon-select-dropdown .dropdown-toggle::after {
    transition: transform 0.2s ease;
}

.icon-select-dropdown .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.icon-select-dropdown .dropdown-menu,
.icon-select-dropdown .icon-select-menu {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.375rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
}

/* Multi-column grid layout for icon options */
.icon-select-dropdown .dropdown-menu.show,
.icon-select-dropdown .icon-select-menu.show {
    display: flex;
    flex-direction: column;
    min-width: 380px;
    max-width: min(560px, 90vw);
}

/* Options container uses grid for multi-column layout */
.icon-select-dropdown .icon-select-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    padding: 0.25rem;
}

/* Single column for grouped dropdowns (has headers) */
.icon-select-dropdown .dropdown-menu.show:has(.dropdown-header),
.icon-select-dropdown .icon-select-menu.show:has(.dropdown-header) {
    display: flex;
    flex-direction: column;
    max-width: 280px;
}

.icon-select-dropdown .dropdown-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ft-muted);
    padding: 0.5rem 0.75rem 0.25rem;
}

.icon-select-dropdown .dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 0.625rem;
    transition: all 0.15s ease;
    font-weight: 500;
    font-size: 0.85rem;
    background: var(--bs-gray-100, #f8f9fa);
    border: 1px solid transparent;
}

.icon-select-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(13, 148, 136, 0.12) 100%);
    border-color: rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.icon-select-dropdown .dropdown-item.active {
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-secondary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.icon-select-dropdown .dropdown-item.active:hover {
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-secondary) 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.4);
}

.icon-select-dropdown .dropdown-item img,
.icon-select-dropdown .dropdown-item i {
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.icon-select-dropdown .dropdown-item:hover img,
.icon-select-dropdown .dropdown-item:hover i {
    transform: scale(1.1);
}

.icon-select-dropdown .dropdown-divider {
    margin: 0.25rem 0.5rem;
    opacity: 0.1;
}

.icon-select-dropdown .selected-display img,
.icon-select-dropdown .selected-display i {
    flex-shrink: 0;
}

/* Search input in icon select dropdown */
.icon-select-dropdown .icon-select-search-container {
    position: sticky;
    top: 0;
    background: var(--bs-dropdown-bg, #fff);
    z-index: 1;
}

.icon-select-dropdown .icon-select-search {
    font-size: 0.8rem;
}

.icon-select-dropdown .icon-select-search:focus {
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Locked expense type display (when match is selected) */
.expense-type-locked {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--bs-light, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.expense-type-locked img {
    width: 20px;
    height: 20px;
}

.expense-type-locked-label {
    font-weight: 500;
    color: var(--bs-secondary, #6c757d);
}

/* Ensure icon select dropdowns appear above table rows and other dropdowns */
.icon-select-dropdown {
    position: relative;
}

/* =============================================================================
   Porter Matcher Row - Transaction matching controls
   Layout: [ExpenseType] [note...] [🔍] [☐ All]
   ============================================================================= */
.porter-matcher {
    flex-wrap: nowrap;
}
.porter-matcher-type {
    flex: 0 0 auto; /* Fixed size, don't grow or shrink */
    min-width: 100px; /* Ensure enough space for icon + short name */
    max-width: 140px; /* Cap width to prevent taking too much space */
}
.porter-matcher-type .selected-display {
    overflow: hidden;
    text-overflow: ellipsis;
}
.porter-matcher-note {
    flex: 0 1 auto; /* Can shrink if needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px; /* Limit note width */
}

/* Compact icon select - minimal styling for inline use (e.g., Porter matcher row) */
.icon-select-dropdown.icon-select-compact {
    display: inline-flex;
    max-width: 100%; /* Respect parent constraints */
}
.icon-select-dropdown.icon-select-compact .dropdown-toggle {
    background: transparent;
    border: none;
    padding: 0 0.25rem;
    box-shadow: none;
    max-width: 100%; /* Respect parent constraints */
    overflow: hidden;
}
.icon-select-dropdown.icon-select-compact .dropdown-toggle:hover,
.icon-select-dropdown.icon-select-compact .dropdown-toggle:focus {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    box-shadow: none;
}
.icon-select-dropdown.icon-select-compact .selected-display {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* When dropdown is open, elevate the entire container above siblings */
.icon-select-dropdown:has(.dropdown-menu.show),
.icon-select-dropdown:has(.icon-select-menu.show) {
    z-index: 1050;
}

.icon-select-dropdown .dropdown-menu.show,
.icon-select-dropdown .icon-select-menu.show {
    z-index: 1060 !important;
    /* Ensure dropdown doesn't clip at container boundaries */
    position: absolute;
}

/* =============================================================================
   Porter Responsive Design - No Horizontal Scrollbars
   ============================================================================= */

/* Base responsive utilities for Porter */
#transactions-card {
    overflow: visible; /* Allow dropdowns to flow outside card boundaries */
}
#transactions-card .card-body {
    overflow: visible;
}
#transactions-list {
    overflow-x: hidden;
    overflow-y: visible;
}
#transactions-list table {
    table-layout: fixed;
    width: 100%;
    overflow: visible;
}

/* Important help div - light brown background to match ant icon */
.important-help-bg {
    background-color: #f5e6d3 !important;
}

/* Expense Type Dropdown - ensure it appears above table rows */
.expense-type-dropdown {
    position: relative;
    z-index: 10;
}
.expense-type-dropdown .dropdown-menu.show {
    z-index: 1060 !important;
}
/* No-match form rows need visible overflow for dropdowns */
.no-match-form-row td {
    overflow: visible !important;
    position: relative;
}
/* Ensure the dropdown button has proper styling */
.expense-type-dropdown .btn {
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
}
.porter-col-date { /* Date column */ }
.porter-description-cell { 
    /* Description column - use table-layout: fixed behavior */
    width: 100%;
    max-width: 0; /* Forces cell to respect flex children's overflow */
}
.porter-col-actions { min-width: 40px; width: 40px; } /* Actions column - single Porter/Important button only */
.porter-status-label { /* Text labels in status badges */ }
.porter-status-icon { /* Icons that stay visible */ }
.porter-match-name { 
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
}
.porter-form-input {
    width: 100%;
    max-width: 100%;
}
.porter-amount-cell {
    white-space: nowrap;
}

/* Match row: show amount only when checkbox/radio is selected */
.porter-amount-cell.match-amount-when-selected {
    visibility: hidden;
}
tbody tr:has(.match-checkbox:checked) .porter-amount-cell.match-amount-when-selected,
tbody tr:has(.expense-match-checkbox:checked) .porter-amount-cell.match-amount-when-selected,
tbody tr:has(.transfer-account-radio:checked) .porter-amount-cell.match-amount-when-selected {
    visibility: visible;
}

/* Date and Amount stacking for diffs */
.porter-date-stack,
.porter-amount-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.25rem;
}
.porter-date-stack {
    justify-content: flex-start;
}
.porter-amount-stack {
    justify-content: flex-end;
}

/* Diff styling - monospace, no parentheses */
.porter-date-diff,
.porter-amount-diff {
    font-family: var(--bs-font-monospace);
    font-size: 0.75rem;
    font-weight: 500;
}
/* Transaction row description truncation - use inner element, not td */
#transactions-list .transaction td:nth-child(2) {
    /* Don't set overflow on td - let inner elements handle truncation */
}
#transactions-list .transaction .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Transfer match description: less stark white */
.transfer-match-description-input {
    background-color: rgba(255, 243, 205, 0.7) !important;
    border-color: rgba(253, 186, 116, 0.4) !important;
}

/* Transfer match row: seed [x] | Group: Account | Description | Amount. Partner left, one line when space. */
.transfer-match-account-desc {
    flex-wrap: nowrap;
}
.transfer-match-partner {
    flex-shrink: 0;
}

/* Cross-border amount inputs: numbers right-aligned for columnar display */
.cross-border-from-amount,
.cross-border-to-amount,
.cross-border-rate {
    text-align: right !important;
    direction: ltr;
}

/* Porter Transfer Match: Description stacks below partner at narrow widths */
@media (max-width: 1015px) {
    .transfer-match-account-desc {
        flex-wrap: wrap;
    }
    .transfer-match-account-desc .transfer-match-description-input {
        flex: 1 1 100%;
        min-width: 120px;
    }
}

/* Porter Responsive - Tablet (768px - 1106px) */
@media (max-width: 1106px) {
    /* Transaction row: narrow Status column, hide verbose text */
    .porter-status-label { display: none; }
    
    /* Match rows: constrain description width */
    .porter-match-name { max-width: 180px; }
    
    /* Score badge: hide percentage text on narrow screens */
    .porter-score-text { display: none; }
    
    /* Type badge: always show label with icon */
    
    /* No-match form: narrow inputs */
    .porter-form-input { max-width: 200px; }
    
    /* Bill It label: hide text, keep icon */
    .porter-bill-label { display: none; }
    
    /* Parson inspector: reduce padding */
    .parson-inspector { padding: 0.5rem !important; }
    .parson-inspector .badge { font-size: 0.65rem; }
}

/* Porter Responsive - Small Tablet (below 992px) */
@media (max-width: 992px) {
    /* Further narrow match names */
    .porter-match-name { max-width: 140px; }
    
    /* Narrow form inputs more */
    .porter-form-input { max-width: 160px; }
    
    /* Transaction description truncation */
    #transactions-list .transaction td:nth-child(2) {
        max-width: 200px;
    }
}

/* Porter Responsive - Narrow Tablet (below 850px) */
@media (max-width: 850px) {
    /* Date column: narrower */
    .porter-col-date { 
        width: 65px !important;
        padding-left: 0.375rem !important;
        padding-right: 0.25rem !important;
    }
    
    /* Match names much narrower */
    .porter-match-name { max-width: 120px; }
    
    /* Form inputs narrower */
    .porter-form-input { max-width: 130px; }
    
    /* Status column: narrower */
    #transactions-list th:nth-child(3),
    #transactions-list td:nth-child(3) {
        width: 120px !important;
        max-width: 120px;
    }
    
    /* Amount column: narrower */
    #transactions-list th:nth-child(4),
    #transactions-list td:nth-child(4) {
        width: 80px !important;
    }
    
    /* Hide "Bill It" label text */
    .porter-bill-label { display: none; }
    
    /* Expense Type select: more compact */
    .porter-form-input,
    #transactions-list select.form-select-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Transaction description narrower */
    #transactions-list .transaction td:nth-child(2) {
        max-width: 160px;
    }
    
    /* Smaller badges */
    #transactions-list .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.35rem;
    }
}

/* Porter Responsive - Mobile (below 768px) */
@media (max-width: 768px) {
    /* Date column: compact format, narrower */
    .porter-col-date { 
        width: 50px !important;
        font-size: 0.7rem;
        padding-left: 0.25rem !important;
        padding-right: 0.125rem !important;
    }
    
    /* Status column even narrower */
    #transactions-list th:nth-child(3),
    #transactions-list td:nth-child(3) {
        width: 100px !important;
        max-width: 100px;
    }
    
    /* Amount column narrower */
    #transactions-list th:nth-child(4),
    #transactions-list td:nth-child(4) {
        width: 70px !important;
    }
    
    /* Stack Date + Diff and Amount + Diff vertically on mobile */
    .porter-date-stack,
    .porter-amount-stack {
        flex-direction: column;
    }
    .porter-date-stack {
        align-items: flex-start;
    }
    .porter-amount-stack {
        align-items: flex-end;
    }
    
    /* Match names even narrower */
    .porter-match-name { max-width: 100px; }
    
    /* Form inputs full width on mobile */
    .porter-form-input { 
        max-width: 120px;
        font-size: 0.8rem;
    }
    
    /* Parson inspector: compact mode */
    .parson-inspector { 
        font-size: 0.7rem;
        padding: 0.375rem !important;
    }
    .parson-inspector .badge { 
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
    .parson-inspector .fw-semibold { font-size: 0.75rem; }
    
    /* Hide timing details on mobile */
    .porter-timing-details { display: none; }
    
    /* Transaction row adjustments */
    #transactions-list .transaction td {
        padding: 0.25rem 0.375rem;
    }
    #transactions-list .transaction td:nth-child(2) {
        max-width: 150px;
    }
    
    /* Status badges: icon only */
    .porter-status-badge .porter-status-label { display: none; }
    
    /* Checkbox column narrower */
    #transactions-list th:last-child,
    #transactions-list td:last-child {
        width: 30px !important;
        padding: 0.25rem !important;
    }
}

/* Porter Responsive - Extra Small Mobile (below 576px) */
@media (max-width: 576px) {
    /* Date column: even more compact */
    .porter-col-date { 
        width: 45px !important;
        font-size: 0.65rem;
    }
    
    /* Even more compact */
    .porter-match-name { max-width: 80px; }
    .porter-form-input { max-width: 100px; }
    
    /* Hide account group badges on very small screens */
    .porter-group-badge { display: none; }
    
    /* Smaller character icons */
    .character-icon-sm {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* Transaction description very compact */
    #transactions-list .transaction td:nth-child(2) {
        max-width: 120px;
    }
}

/* ============================================
   Porter Import Animations
   ============================================ */

/* Fade out animation for imported transactions */
@keyframes porter-fade-out {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    70% {
        opacity: 0.5;
        transform: translateX(10px);
    }
    100% {
        opacity: 0;
        transform: translateX(20px);
    }
}

.imported-fade-out {
    animation: porter-fade-out 0.5s ease-out forwards;
}

/* Highlight animation for newly imported rows */
@keyframes porter-highlight-new {
    0% {
        background-color: var(--bs-success-bg-subtle);
    }
    100% {
        background-color: transparent;
    }
}

.imported-row-new {
    animation: porter-highlight-new 2s ease-out forwards;
}

/* Reconciled rows: icon and its img inherit row bg (no white box) */
.imported-row .imported-row-icon,
.imported-row .imported-row-icon img,
.imported-row .imported-row-icon .character-icon {
    background: transparent !important;
}

/* Reconciled list: numbers right-align, overflow visible, tabular nums */
.porter-reconciled-amount {
    font-variant-numeric: tabular-nums;
    min-width: 4.5em;
}
.reconciled-rows {
    overflow: visible;
}
.font-tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Table column widths */
.col-date { width: 80px; }
.col-amount { width: 100px; }
.col-actions { width: 120px; }
.col-type { width: 150px; }
/* Small icon column (e.g., settings table icon column) */
.col-icon-sm { width: 50px; }

/* Font size utilities (extending Bootstrap) */
.fs-7 { font-size: 0.8rem !important; }
.fs-8 { font-size: 0.7rem !important; }

/* Width utilities */
.w-80 { width: 80px; }
.w-100px { width: 100px; }
.w-120 { width: 120px; }
.w-150 { width: 150px; }
.w-200 { width: 200px; }

/* Min-width utilities */
.min-w-80 { min-width: 80px; }
.min-w-100 { min-width: 100px; }
.min-w-150 { min-width: 150px; }
.min-w-200 { min-width: 200px; }

/* Max-width utilities */
.max-w-80 { max-width: 80px; }
.max-w-100 { max-width: 100px; }
.max-w-150 { max-width: 150px; }
.max-w-200 { max-width: 200px; }
.max-w-300 { max-width: 300px; }
.max-w-400 { max-width: 400px; }

/* Group background tint - uses CSS custom property */
.group-bg-tint {
    background-color: color-mix(in srgb, var(--group-color, #6c757d) 10%, transparent);
}

/* Icon editor specific sizes */
.icon-preview-sm { width: 24px; height: 24px; }
.icon-preview-md { width: 48px; height: 48px; }
.icon-preview-lg { width: 96px; height: 96px; }
.icon-preview-xl { width: 128px; height: 128px; }

/* Crop container */
.crop-container {
    width: 400px;
    height: 400px;
    position: relative;
    overflow: hidden;
}

/* Form input compact sizes */
.form-control-xs {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
}

.form-select-xs {
    padding: 0.15rem 1.5rem 0.15rem 0.35rem;
    font-size: 0.7rem;
}

/* Porter/compact font-size utilities (beyond Bootstrap's fs-6) */
.fs-xs  { font-size: 0.6rem !important; }   /* 9.6px - badges, tiny labels */
.fs-xxs { font-size: 0.5rem !important; }   /* 8px - sub-labels */

/* Porter compact form input widths */
.porter-select-auto   { width: auto; }
.porter-select-narrow { width: 80px; min-width: 60px; }
.porter-select-md     { width: 120px; min-width: 100px; }
.porter-select-wide   { width: 160px; min-width: 100px; }
.porter-select-xl     { width: 220px; min-width: 150px; }

/* Summary/divider borders (replaces inline border-top: 2px solid) */
.porter-divider-top { border-top: 2px solid #212529 !important; }

/* Pre-formatted debug/log output */
.debug-pre {
    white-space: pre-wrap;
    font-family: var(--bs-font-monospace);
    font-size: 0.7rem;
    max-height: 200px;
    overflow-y: auto;
}

/* Force table cell to respect text-truncate in fixed-layout tables */
.td-truncate { max-width: 0; }

/* Table column width utilities (common sizes for th/col elements) */
.col-w-20  { width: 20px; }
.col-w-40  { width: 40px; }
.col-w-48  { width: 48px; }
.col-w-50  { width: 50px; }
.col-w-60  { width: 60px; }
.col-w-70  { width: 70px; }
.col-w-80  { width: 80px; }
.col-w-90  { width: 90px; }
.col-w-100 { width: 100px; }
.col-w-120 { width: 120px; }
.col-w-140 { width: 140px; }
.col-w-200 { width: 200px; }

/* Page header breadcrumb separator chevron (small relative to h1) */
.breadcrumb-chevron { font-size: 0.5em; }

/* Page header module icon (sized relative to h1) */
.header-module-icon { width: 1.5em; height: 1.5em; vertical-align: -0.2em; }

/* Input group compact width */
.input-group-w-110 { width: 110px; margin-left: auto; }
.input-group-w-120 { width: 120px; }

/* =============================================================================
   Toast Overlay - Fixed position, no layout shift, draggable
   ============================================================================= */

.toast-overlay-container {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1070; /* Above dropdowns (1060) */
    max-width: 480px;
    width: 100%;
    pointer-events: none; /* Allow clicks through container */
}

.toast-overlay-container .alert {
    pointer-events: auto; /* Toast itself is clickable */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: move; /* Indicate draggable */
    user-select: none; /* Prevent text selection while dragging */
    padding: 0.4rem 0.75rem; /* Compact: ~2 rows height */
    font-size: 0.9rem;
}

.toast-overlay-container .alert .fa-lg {
    font-size: 1rem;
}

.toast-overlay-container .alert.dragging {
    opacity: 0.9;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
